2020-12-09 12:57:38 +01:00
|
|
|
#ifndef FSH_h
|
|
|
|
#define FSH_h
|
2021-01-26 12:54:51 +01:00
|
|
|
|
|
|
|
/* This is an architecture support file to manage the differences
|
|
|
|
* between the nano/uno.mega and the later nanoEvery, unoWifiRev2 etc
|
|
|
|
*
|
|
|
|
* IMPORTANT:
|
|
|
|
* To maintain portability the main code should NOT contain ANY references
|
|
|
|
* to the following:
|
|
|
|
*
|
|
|
|
* __FlashStringHelper Use FSH instead.
|
|
|
|
* PROGMEM use FLASH instead
|
|
|
|
* pgm_read_byte_near use GETFLASH instead.
|
|
|
|
*
|
|
|
|
*/
|
2020-12-09 12:57:38 +01:00
|
|
|
#include <Arduino.h>
|
|
|
|
#if defined(ARDUINO_ARCH_MEGAAVR)
|
2021-01-23 22:07:28 +01:00
|
|
|
#ifdef F
|
2021-01-26 12:54:51 +01:00
|
|
|
#undef F
|
2021-01-23 22:07:28 +01:00
|
|
|
#endif
|
2021-01-26 12:54:51 +01:00
|
|
|
#define F(str) (str)
|
2020-12-09 12:57:38 +01:00
|
|
|
typedef char FSH;
|
2021-01-03 10:11:11 +01:00
|
|
|
#define GETFLASH(addr) (*(const unsigned char *)(addr))
|
|
|
|
#define FLASH
|
2020-12-09 12:57:38 +01:00
|
|
|
#else
|
|
|
|
typedef __FlashStringHelper FSH;
|
2021-01-03 10:11:11 +01:00
|
|
|
#define GETFLASH(addr) pgm_read_byte_near(addr)
|
|
|
|
#define FLASH PROGMEM
|
2020-12-09 12:57:38 +01:00
|
|
|
#endif
|
|
|
|
#endif
|