Add pragma to ensure neopixel_write is always -Os

This commit is contained in:
Scott Shawcroft 2018-11-13 10:56:00 -08:00 committed by GitHub
parent ed9db80760
commit a3a690dc01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,11 @@
}
#endif
// Ensure this code is compiled with -Os. Any other optimization level may change the timing of it
// and break neopixels.
#pragma GCC push_options
#pragma GCC optimize ("Os")
uint64_t next_start_tick_ms = 0;
uint32_t next_start_tick_us = 1000;
@ -183,3 +188,5 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
mp_hal_enable_all_interrupts();
}
#pragma GCC pop_options