LSatan / SmartRC-CC1101-Driver-Lib

This driver library can be used for many libraries that use a simple RF ASK module, with the advantages of the cc1101 module. It offers many direct setting options as in SmartRF Studio and calculates settings such as MHz directly.
Other
432 stars 95 forks source link

Examples Crashing #150

Open CarlosDanielDev opened 6 months ago

CarlosDanielDev commented 6 months ago

When attempting to run the minimal receiver example from the Arduino library for the CC1101 module, I encountered several compilation errors and warnings. These occurred in the ELECHOUSE_CC1101_SRC_DRV.cpp file.

Steps to Reproduce:

Error Messages:

The specific errors and warnings I encountered are:

ELECHOUSE_CC1101_SRC_DRV.cpp:149:3: error: this 'while' clause does not guard... [-Werror=misleading-indentation]
   while(digitalRead(MISO_PIN));
   ^~~~~

ELECHOUSE_CC1101_SRC_DRV.cpp:150:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
  digitalWrite(SS_PIN, HIGH);
    ^~~~~~~~~~~~

  ELECHOUSE_CC1101_SRC_DRV.cpp:533:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]
 if (freq0 > 255){freq1+=1;freq0-=256;}
     ~~~~~~^~~~~

     ELECHOUSE_CC1101_SRC_DRV.cpp:983:5: error: unused variable 's2' [-Werror=unused-variable]
 int s2 = 0;
     ^~

     ELECHOUSE_CC1101_SRC_DRV.cpp:500:13: error: 'a' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 PA_TABLE[0] = a;
 ~~~~~~~~~~~~^~~
cc1plus: some warnings being treated as errors

I would appreciate any help in understanding and resolving these issues.

feyhong1112 commented 5 months ago

Did you check thet you update the lastest lib and did not include any .ccp file in the sketch Esp32C3 work Success compile both new and old: image image