У меня есть Google Coral Dev Micro с SoC RT1176 (800 МГц Cortex-m7 и 400 МГц Cortex-m4), m7 работает под управлением FreeRTOS, а m4 работает под управлением «голого железа», компилируется с использованием GCC none eabi 9.3.1 со следующим флаги:
Код: Выделить всё
-Wall -Wno-psabi -mthumb -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mapcs-frame --specs=nano.specs --specs=nosys.specs -u _printf_float -std=gnu99 -g -Os -save-temps -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DNDEBUG
fifo.h:
Код: Выделить всё
#include
#include
#include
#include
template
class LockLessFifo {
public:
LockLessFifo() : read_idx(0), write_idx(0), buffer({0}) {}
size_t size() {
if (read_idx
Источник: [url]https://stackoverflow.com/questions/78068613/atomic-increment-does-not-work-as-expected-in-interrupt[/url]
Мобильная версия