Skip to content
Prev Previous commit
Next Next commit
M_PI is a GNU extension to math.h, so define it locally if necessary
IAR generates error Pe020 'identifier is undefined'.
  • Loading branch information
Ben Avison committed Sep 13, 2022
commit 17e70b9ad4ec5223286f008d9c3ac13690ee2a48
4 changes: 4 additions & 0 deletions pio/apa102/apa102.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// Global brightness value 0->31
#define BRIGHTNESS 16

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

void put_start_frame(PIO pio, uint sm) {
pio_sm_put_blocking(pio, sm, 0u);
}
Expand Down
4 changes: 4 additions & 0 deletions pio/st7789_lcd/st7789_lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

#define SERIAL_CLK_DIV 1.f

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

// Format: cmd length (including cmd byte), post delay in units of 5 ms, then cmd payload
// Note the delays have been shortened a little
static const uint8_t st7789_init_seq[] = {
Expand Down