Browse Source

move more things to config

drive-to-target
Alex Mikhalev 6 years ago
parent
commit
0057e8cb49
  1. 6
      main/ugv_comms.cc
  2. 7
      main/ugv_config.h
  3. 2
      main/ugv_display.cc

6
main/ugv_comms.cc

@ -61,9 +61,9 @@ void CommsClass::Init() {
ESP_LOGI(TAG, "LoRa initialized"); ESP_LOGI(TAG, "LoRa initialized");
#else #else
e32::Config lora_config; e32::Config lora_config;
lora_config.uart_port = UART_NUM_2; lora_config.uart_port = LORA_UART;
lora_config.uart_rx_pin = 13; lora_config.uart_rx_pin = LORA_RX;
lora_config.uart_tx_pin = 15; lora_config.uart_tx_pin = LORA_TX;
ret = lora.Init(lora_config); ret = lora.Init(lora_config);
if (ret != ESP_OK) { if (ret != ESP_OK) {
const char *error_name = esp_err_to_name(ret); const char *error_name = esp_err_to_name(ret);

7
main/ugv_config.h

@ -7,7 +7,14 @@
#define LORA_FREQ (433E6) #define LORA_FREQ (433E6)
#define LORA_UART UART_NUM_2
#define LORA_RX 13
#define LORA_TX 15
#define OLED_H 64 #define OLED_H 64
#define OLED_W 128 #define OLED_W 128
#define OLED_RESET U8X8_PIN_NONE
#define OLED_CLOCK 4
#define OLED_DATA 5
#define GPS_UART UART_NUM_1 #define GPS_UART UART_NUM_1

2
main/ugv_display.cc

@ -18,7 +18,7 @@ void DisplayClass::Init() {
// For Heltec ESP32 LoRa // For Heltec ESP32 LoRa
// oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, 16, 15, 4); // oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, 16, 15, 4);
// For wemos Lolin ESP32 // For wemos Lolin ESP32
oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, U8X8_PIN_NONE, 4, 5); oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, OLED_RESET, OLED_CLOCK, OLED_DATA);
oled->initDisplay(); oled->initDisplay();
oled->clearDisplay(); oled->clearDisplay();
oled->setPowerSave(false); oled->setPowerSave(false);

Loading…
Cancel
Save