AceRoutine
1.0.1
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
src
ace_routine
compat.h
Go to the documentation of this file.
1
/*
2
MIT License
3
4
Copyright (c) 2018 Brian T. Park
5
6
Permission is hereby granted, free of charge, to any person obtaining a copy
7
of this software and associated documentation files (the "Software"), to deal
8
in the Software without restriction, including without limitation the rights
9
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
copies of the Software, and to permit persons to whom the Software is
11
furnished to do so, subject to the following conditions:
12
13
The above copyright notice and this permission notice shall be included in all
14
copies or substantial portions of the Software.
15
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
SOFTWARE.
23
*/
24
47
#ifndef ACE_ROUTINE_FLASH_H
48
#define ACE_ROUTINE_FLASH_H
49
50
class
__FlashStringHelper;
51
52
#if defined(ARDUINO_ARCH_AVR)
53
#include <avr/pgmspace.h>
54
#define FPSTR(p) (reinterpret_cast<const __FlashStringHelper *>(p))
55
56
#elif defined(ARDUINO_ARCH_SAMD)
57
#include <avr/pgmspace.h>
58
#define FPSTR(p) (reinterpret_cast<const __FlashStringHelper *>(p))
59
60
#elif defined(TEENSYDUINO)
61
#include <avr/pgmspace.h>
62
#define FPSTR(p) (reinterpret_cast<const __FlashStringHelper *>(p))
63
64
65
#elif defined(ESP8266)
66
#include <pgmspace.h>
67
68
#elif defined(ESP32)
69
#include <pgmspace.h>
70
71
// The FPSTR() macro is broken on ESP32 until
72
// https://github.com/espressif/arduino-esp32/issues/1371 is fixed, hopefully
73
// in v1.0.3.
74
#undef FPSTR
75
#define FPSTR(p) (reinterpret_cast<const __FlashStringHelper *>(p))
76
77
#elif defined(UNIX_HOST_DUINO)
78
#include <pgmspace.h>
79
80
#else
81
#error Unsupported platform
82
83
#endif
84
85
#endif
Generated by
1.8.17