Skip to content

Commit 964de1a

Browse files
authored
Merge pull request #176 from crisobal/ctsc_fix
Fixed compile errors in LoraWan and cmake include missing from bluedroid in esp-idf 3.2.2
2 parents 3e6e976 + 2c5dcc1 commit 964de1a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
set(COMPONENT_SRCDIRS "src" "src/utility" "src/Fonts")
2-
set(COMPONENT_ADD_INCLUDEDIRS "src")
2+
set(COMPONENT_ADD_INCLUDEDIRS "src" "$ENV{IDF_PATH}/components/bt/bluedroid/api/include/api")
33
list(APPEND COMPONENT_REQUIRES "arduino")
44

5+
56
register_component()
67

78

@@ -15,5 +16,5 @@ if(CONFIG_M5STACK_FIRE)
1516
list(APPEND DEFINITIONS "M5STACK_FIRE")
1617
endif(CONFIG_M5STACK_FIRE)
1718

18-
target_compile_definitions(${COMPONENT_TARGET} PUBLIC ${DEFINITIONS})
19+
target_compile_definitions(${COMPONENT_NAME} PUBLIC ${DEFINITIONS})
1920

src/LoRaWan.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ bool LoRaWanClass::setDataRate(_data_rate_t dataRate, _physical_type_t physicalT
167167
loraDebugPrint(DEFAULT_DEBUGTIME);
168168
#endif
169169
delay(DEFAULT_TIMEWAIT);
170+
return true;
170171
}
171172

172173
void LoRaWanClass::setPower(short power)
@@ -430,8 +431,8 @@ short LoRaWanClass::receivePacket(char *buffer, short length, short *rssi)
430431
ptr += 5;
431432
for(short i = 0; ; i ++)
432433
{
433-
char temp[2] = {0};
434-
unsigned char tmp, result = 0;
434+
char temp[2] = {0, 0};
435+
unsigned char tmp = '?', result = 0;
435436

436437
temp[0] = *(ptr + i * 3);
437438
temp[1] = *(ptr + i * 3 + 1);
@@ -473,7 +474,7 @@ short LoRaWanClass::receivePacket(char *buffer, short length, short *rssi)
473474
for(short i = 0; ; i ++)
474475
{
475476
char temp[2] = {0};
476-
unsigned char tmp, result = 0;
477+
unsigned char tmp = '?', result = 0;
477478

478479
temp[0] = *(ptr + i * 3);
479480
temp[1] = *(ptr + i * 3 + 1);
@@ -858,7 +859,7 @@ short LoRaWanClass::receivePacketP2PMode(unsigned char *buffer, short length, sh
858859
for(short i = 0; i < number; i ++)
859860
{
860861
char temp[2] = {0};
861-
unsigned char tmp, result = 0;
862+
unsigned char tmp='?', result = 0;
862863

863864
temp[0] = *(ptr + i * 2);
864865
temp[1] = *(ptr + i * 2 + 1);
@@ -985,7 +986,7 @@ short LoRaWanClass::readLine(char *buffer, short length, unsigned char timeout)
985986
{
986987
short i = 0;
987988
unsigned long timerStart, timerEnd;
988-
char c;
989+
char c='\n';
989990

990991
timerStart = millis();
991992

0 commit comments

Comments
 (0)