diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index e4e17b33e28..488bf404f3a 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -25,3 +25,9 @@ set(COMPONENT_PRIV_INCLUDEDIRS "include/driver") set(COMPONENT_REQUIRES esp_ringbuf) register_component() + + +if(GCC_NOT_5_2_0) + # uses C11 atomic feature + set_source_files_properties(spi_master.c PROPERTIES COMPILE_FLAGS -std=gnu11) +endif() diff --git a/components/driver/component.mk b/components/driver/component.mk index a208f6ae20f..bff34c912ea 100644 --- a/components/driver/component.mk +++ b/components/driver/component.mk @@ -6,3 +6,7 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_PRIV_INCLUDEDIRS := include/driver +ifeq ($(GCC_NOT_5_2_0), 1) +# uses C11 atomic feature +spi_master.o: CFLAGS += -std=gnu11 +endif