Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCAFEDECAF committed Oct 21, 2024
1 parent e426535 commit f37346c
Show file tree
Hide file tree
Showing 7 changed files with 473 additions and 473 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ jobs:
- arduino-platform: "esp8266:esp8266"
url: "https://arduino.esp8266.com/stable/package_esp8266com_index.json"
fqbn: "esp8266:esp8266:d1_mini"
board-options: "xtal=160,ssl=basic,mmu=3232,non32xfer=fast,eesz=4M1M,ip=hb2n"
compiler-warnings: "all"
websockets-library-version: "WebSockets" # We can install latest
- arduino-platform: "esp32:[email protected]"
url: "https://dl.espressif.com/dl/package_esp32_index.json"
fqbn: "esp32:esp32:esp32"
board-options: "CPUFreq=240,FlashFreq=80,FlashSize=4M,PartitionScheme=default,DebugLevel=none"
compiler-warnings: "default"
websockets-library-version: "[email protected]" # On esp32:[email protected] we cannot go beyond version 2.4.0

steps:
Expand Down Expand Up @@ -59,8 +63,8 @@ jobs:
# in the build matrix.
- name: Compile example sketches
run: |
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/VanBusDump
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/PacketParser
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/LiveWebPage
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/SendPacket
arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/DisplayNotifications
arduino-cli compile --fqbn ${{ matrix.fqbn }} --board-options ${{ matrix.board-options }} --warnings ${{ matrix.compiler-warnings }} ./examples/VanBusDump
arduino-cli compile --fqbn ${{ matrix.fqbn }} --board-options ${{ matrix.board-options }} --warnings ${{ matrix.compiler-warnings }} ./examples/PacketParser
arduino-cli compile --fqbn ${{ matrix.fqbn }} --board-options ${{ matrix.board-options }} --warnings ${{ matrix.compiler-warnings }} ./examples/LiveWebPage
arduino-cli compile --fqbn ${{ matrix.fqbn }} --board-options ${{ matrix.board-options }} --warnings ${{ matrix.compiler-warnings }} ./examples/SendPacket
arduino-cli compile --fqbn ${{ matrix.fqbn }} --board-options ${{ matrix.board-options }} --warnings ${{ matrix.compiler-warnings }} ./examples/DisplayNotifications
8 changes: 4 additions & 4 deletions examples/LiveWebPage/Esp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const char PROGMEM unknownStr[] = "UNKNOWN";

void PrintSystemSpecs()
{
Serial.printf_P(PSTR("CPU Speed: %u MHz (CPU_F_FACTOR = %d)\n"), ESP.getCpuFreqMHz(), CPU_F_FACTOR);
Serial.printf_P(PSTR("CPU Speed: %u MHz (CPU_F_FACTOR = %ld)\n"), ESP.getCpuFreqMHz(), CPU_F_FACTOR);
Serial.printf_P(PSTR("SDK: %s\n"), ESP.getSdkVersion());

#ifndef ARDUINO_ARCH_ESP32
Expand All @@ -24,14 +24,14 @@ void PrintSystemSpecs()
Serial.printf_P(PSTR("Flash ide size: %s MBytes\n"), FloatToStr(floatBuf, ideSize/1024.0/1024.0, 2));
Serial.printf_P(PSTR("Flash ide speed: %s MHz\n"), FloatToStr(floatBuf, ESP.getFlashChipSpeed()/1000000.0, 2));
FlashMode_t ideMode = ESP.getFlashChipMode();
Serial.printf_P(PSTR("Flash ide mode: %S\n"),
Serial.printf_P(PSTR("Flash ide mode: %s\n"),
ideMode == FM_QIO ? qioStr :
ideMode == FM_QOUT ? qoutStr :
ideMode == FM_DIO ? dioStr :
ideMode == FM_DOUT ? doutStr :
unknownStr);
#ifndef ARDUINO_ARCH_ESP32
Serial.printf_P(PSTR("Flash chip configuration %S\n"), ideSize != realSize ? PSTR("wrong!") : PSTR("ok."));
Serial.printf_P(PSTR("Flash chip configuration %s\n"), ideSize != realSize ? PSTR("wrong!") : PSTR("ok."));
#endif // ARDUINO_ARCH_ESP32

Serial.print(F("Wi-Fi MAC address: "));
Expand Down Expand Up @@ -67,7 +67,7 @@ const char* EspSystemDataToJson(char* buf, const int n)
"\"esp_flash_size_ide\": \"%s MBytes\",\n"
"\"esp_flash_speed_ide\": \"%s MHz\",\n"

"\"esp_flash_mode_ide\": \"%S\",\n"
"\"esp_flash_mode_ide\": \"%s\",\n"

"\"esp_mac_address\": \"%s\",\n"
"\"esp_ip_address\": \"%s\",\n"
Expand Down
8 changes: 4 additions & 4 deletions examples/LiveWebPage/IRrecv.ino
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ volatile unsigned long lastIrPulse = 0;

volatile TIrParams irparams;

void ICACHE_RAM_ATTR irPinChangeIsr()
void IRAM_ATTR irPinChangeIsr()
{
if (irparams.rcvstate == STATE_STOP) return;

Expand Down Expand Up @@ -130,7 +130,7 @@ enum IrButton_t
IB_VALIDATE = 0xF98D3EE1
}; // enum IrButton_t

// Returns a PSTR (allocated in flash, saves RAM). In printf formatter use "%S" (capital S) instead of "%s".
// Returns a PSTR (allocated in flash, saves RAM)
PGM_P IrButtonStr(unsigned long data)
{
return
Expand Down Expand Up @@ -226,7 +226,7 @@ const char* ParseIrPacketToJson(const TIrPacket& pkt)
"\"event\": \"display\",\n"
"\"data\":\n"
"{\n"
"\"mfd_remote_control\": \"%S%S\"\n"
"\"mfd_remote_control\": \"%s%s\"\n"
"}\n"
"}\n";

Expand Down Expand Up @@ -304,7 +304,7 @@ bool IrReceive(TIrPacket& irPacket)
#ifdef DEBUG_IR_RECV
Serial.printf_P
(
PSTR("[irRecv] val = 0x%lX (%S), intv = %lu, held = %S"),
PSTR("[irRecv] val = 0x%lX (%s), intv = %lu, held = %s"),
irPacket.value,
irPacket.buttonStr,
interval,
Expand Down
2 changes: 1 addition & 1 deletion examples/LiveWebPage/LiveWebPage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ void SendJsonText(const char* json)
} // if
} // SendJsonText

void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length)
void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t)
{
switch(type)
{
Expand Down
Loading

0 comments on commit f37346c

Please sign in to comment.