move more things to config

This commit is contained in:
Alex Mikhalev 2019-04-02 15:13:25 -07:00
parent ff800492a6
commit 0057e8cb49
3 changed files with 11 additions and 4 deletions

View File

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

View File

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

View File

@ -18,7 +18,7 @@ void DisplayClass::Init() {
// For Heltec ESP32 LoRa
// oled = new U8G2_SSD1306_128X64_NONAME_F_HW_I2C(U8G2_R0, 16, 15, 4);
// 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->clearDisplay();
oled->setPowerSave(false);