Make examples friendlier for non GCC compilers and fixed slave_mem_i2c.c to compile on boards without I2C pins (#336)

This commit is contained in:
Graham Sanderson
2023-03-10 15:41:40 -06:00
committed by GitHub
parent 9d3fea1419
commit 60829a134a
39 changed files with 89 additions and 86 deletions

View File

@@ -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);
}
@@ -50,7 +54,7 @@ int main() {
apa102_mini_program_init(pio, sm, offset, SERIAL_FREQ, PIN_CLK, PIN_DIN);
for (int i = 0; i < TABLE_SIZE; ++i)
wave_table[i] = powf(sinf(i * M_PI / TABLE_SIZE), 5.f) * 255;
wave_table[i] = (uint8_t) (powf(sinf(i * M_PI / TABLE_SIZE), 5.f) * 255);
uint t = 0;
while (true) {