fcgdam / TTGO_LoRa32

Some sample code for the TTGO ESP32 Oled Lora board.
108 stars 58 forks source link

Compile errors in PlatformIO #7

Closed petervandepol closed 5 years ago

petervandepol commented 5 years ago

Greetings,

I am trying to compile the TTN_TTGOLora32 example, but I get compile errors in PlatformIO:

`src/main.cpp: In function 'int getChipRevision()': src/main.cpp:109:47: error: 'EFUSE_RD_CHIP_VER_RESERVE_S' was not declared in this scope return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> (EFUSE_RD_CHIP_VER_RESERVE_S)&&EFUSE_RD_CHIP_VER_RESERVE_V) ; ^ src/main.cpp:109:77: error: 'EFUSE_RD_CHIP_VER_RESERVE_V' was not declared in this scope return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> (EFUSE_RD_CHIP_VER_RESERVE_S)&&EFUSE_RD_CHIP_VER_RESERVE_V) ;

^ src/main.cpp: In function 'void printESPRevision()': src/main.cpp:117:18: error: 'EFUSE_RD_CHIP_VER_RESERVE_S' was not declared in this scope Serial.println(EFUSE_RD_CHIP_VER_RESERVE_S, BIN); ^ src/main.cpp:120:18: error: 'EFUSE_RD_CHIP_VER_RESERVE_V' was not declared in this scope Serial.println(EFUSE_RD_CHIP_VER_RESERVE_V, BIN); ^ lib/arduino-lmic-master/src/lmic/lmic.c:1040:17: warning: unused variable 'window' [-Wunused-variable] const char *window = (LMIC.txrxFlags & TXRX_DNW1) ? "RX1" : ((LMIC.txrxFlags & TXRX_DNW2) ? "RX2" : "Other"); ^ lib/arduino-lmic-master/src/lmic/lmic.c: In function 'processJoinAccept': lib/arduino-lmic-master/src/lmic/lmic.c:1467:10: warning: unused variable 'mic' [-Wunused-variable] u4_t mic = os_rlsbf4(&LMIC.frame[dlen-4]); // safe before modified by encrypt! ^ *** [.pioenvs/ttgo-lora32-v1/src/main.cpp.o] Error 1 lib/arduino-lmic-master/src/lmic/oslmic.c: In function 'os_clearCallback': lib/arduino-lmic-master/src/lmic/oslmic.c:45:10: warning: unused variable 'res' [-Wunused-variable] u1_t res = unlinkjob(&OS.scheduledjobs, job) || unlinkjob(&OS.runnablejobs, job); ^ ========================== [ERROR] Took 1.18 seconds ==========================`

fcgdam commented 5 years ago

Hi:

Platformio uses the latest ESP-IDF SDK for compiling while the original code was done for a previous version. Anyway, I've updated the code and it should compile fine now. Git pull/clone the latest version, and it should be ok. Still I haven't tested the modification, but it should work fine.

petervandepol commented 5 years ago

Working! Thank you so much!

PlumbumDN commented 5 years ago

Same problem for the BLE to LoRa bridge example. What version is supported? THX!

fcgdam commented 5 years ago

Same problem for the BLE to LoRa bridge example. What version is supported? THX!

Just make sure that Platformio is updated to the latest version (4) and the ESP framework is 2.2.2. Then you can pull the latest version, and it should compile now.