source: rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/avr/pgmspace.h@ 136

Last change on this file since 136 was 136, checked in by ertl-honda, 8 years ago

ライブラリとOS及びベーシックなサンプルの追加.

File size: 1.4 KB
Line 
1#ifndef __PGMSPACE_H_
2#define __PGMSPACE_H_ 1
3
4#include <inttypes.h>
5
6#define PROGMEM
7#define PGM_P const char *
8#define PSTR(str) (str)
9
10#define _SFR_BYTE(n) (n)
11
12typedef void prog_void;
13typedef char prog_char;
14typedef unsigned char prog_uchar;
15typedef int8_t prog_int8_t;
16typedef uint8_t prog_uint8_t;
17typedef int16_t prog_int16_t;
18typedef uint16_t prog_uint16_t;
19typedef int32_t prog_int32_t;
20typedef uint32_t prog_uint32_t;
21
22#define memcpy_P(dest, src, num) memcpy((dest), (src), (num))
23#define strcpy_P(dest, src) strcpy((dest), (src))
24#define strcat_P(dest, src) strcat((dest), (src))
25#define strcmp_P(a, b) strcmp((a), (b))
26#define strstr_P(a, b) strstr((a), (b))
27#define strlen_P(a) strlen((a))
28#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
29
30#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
31#define pgm_read_word(addr) (*(const unsigned short *)(addr))
32#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
33#define pgm_read_float(addr) (*(const float *)(addr))
34
35#define pgm_read_byte_near(addr) pgm_read_byte(addr)
36#define pgm_read_word_near(addr) pgm_read_word(addr)
37#define pgm_read_dword_near(addr) pgm_read_dword(addr)
38#define pgm_read_float_near(addr) pgm_read_float(addr)
39#define pgm_read_byte_far(addr) pgm_read_byte(addr)
40#define pgm_read_word_far(addr) pgm_read_word(addr)
41#define pgm_read_dword_far(addr) pgm_read_dword(addr)
42#define pgm_read_float_far(addr) pgm_read_float(addr)
43
44#endif
Note: See TracBrowser for help on using the repository browser.