9 #include <PlatformDetermination.h>
10 #include <TextUtilities.h>
13 #include <BasicIoAbstraction.h>
153 uint8_t
safeProgCpy(
char* dst,
const char* pgmSrc, uint8_t size);
157 #include <avr/pgmspace.h>
158 #define get_info_callback(x) ((MenuCallbackFn)pgm_read_ptr_near(x))
159 #define TCMENU_DEFINED_PLATFORM PLATFORM_ARDUINO_8BIT
164 #include <pgmspace.h>
165 #define get_info_callback(x) ((MenuCallbackFn)(*x))
166 #define TCMENU_DEFINED_PLATFORM PLATFORM_ARDUINO_32BIT
170 #if (defined __AVR__ || defined ESP_H) && !defined __MBED__
171 #define PGM_TCM PROGMEM
172 extern char szGlobalBuffer[];
173 inline char* potentialProgramMemory(
const char *x) {
175 return szGlobalBuffer;
177 #define get_info_char(x) ((char) pgm_read_byte_near(x))
178 #define get_info_int(x) ((int16_t)pgm_read_word_near(x))
179 #define get_info_uint(x) ((unsigned int)pgm_read_word_near(x))
180 #define safeProgStrLen(x) (strlen_P(x))
182 #define TCMENU_DEFINED_PLATFORM PLATFORM_ARDUINO_32BIT
184 #define potentialProgramMemory(x) (x)
185 #define get_info_char(x) ((char)(*x))
186 #define get_info_int(x) ((int16_t)(*x))
187 #define get_info_uint(x) ((unsigned int)(*x))
188 #define get_info_callback(x) ((MenuCallbackFn)(*x))
189 #define safeProgStrLen(x) (strlen(x))
191 #if !defined(pgm_read_dword) && (defined(__MBED__) || defined(BUILD_FOR_PICO_CMAKE))
192 # define pgm_read_byte(addr) (*(const unsigned char *)(addr))
193 # define pgm_read_word(addr) (*(const unsigned short *)(addr))
194 # define pgm_read_dword(addr) (*(const unsigned long *)(addr))
195 # define pgm_read_float(addr) (*(const float *)(addr))
196 # define pgm_read_ptr(addr) (*(addr))
197 # define memcpy_P memcpy
contains the definitions of each message and field.
uint32_t getBoardSerialNumber()
Definition: tcUtil.cpp:27
BooleanMenuInfo * newBooleanMenuInfo(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, BooleanNaming naming)
Definition: tcUtil.cpp:107
uint8_t safeProgCpy(char *dst, const char *pgmSrc, uint8_t size)
Definition: tcUtil.cpp:32
void showVersionDialog(const ConnectorLocalInfo *localInfo)
Definition: tcUtil.cpp:45
AnalogMenuInfo * newAnalogMenuInfoP(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max, uint16_t offset, uint16_t divisor, const char *unit)
Definition: tcUtil.cpp:91
FloatMenuInfo * newFloatMenuInfo(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, int decimalPlaces)
Definition: tcUtil.cpp:120
AnyMenuInfo * newAnyMenuInfo(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max=0)
Definition: tcUtil.cpp:76
FloatMenuInfo * newFloatMenuInfoP(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, int decimalPlaces)
Definition: tcUtil.cpp:114
BooleanMenuInfo * newBooleanMenuInfoP(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, BooleanNaming naming)
Definition: tcUtil.cpp:100
AnyMenuInfo * newAnyMenuInfoP(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max=0)
Definition: tcUtil.cpp:70
AnalogMenuInfo * newAnalogMenuInfo(const char *name, menuid_t id, uint16_t eeprom, MenuCallbackFn cb, uint16_t max, uint16_t offset, uint16_t divisor, const char *unit)
Definition: tcUtil.cpp:82