I’ve got some code that I’d like to selectively compile, depending on the features of the board the user is using:
A. 32-bit double + low RAM (e.g., Uno) - low precision
B. 32-bit double + high RAM (e.g., Mega) - library emulating 64-bit double math
C. 64-bit double (ESP8266, ARM M0) - native high precision
ideally I’d like to detect features rather than a list of specific boards/CPUs. e.g.,
#if sizeof(double) == 8 #if program_memory >= 8*1024 ... #else ... #endif #else ... #endif
are there suitable preprocessor #defines that I could use? or will I need a long list of specific boards/CPUs like:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) ....