]>
cloudbase.mooo.com Git - z180-stamp.git/blob - include/common.h
2 * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
4 * SPDX-License-Identifier: GPL-2.0
13 #define GCC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
15 #define USED __attribute__((used))
16 #define UNUSED __attribute__((unused))
20 #include <avr/pgmspace.h>
21 #include <util/delay.h>
23 #define udelay(n) _delay_us(n)
34 } __attribute__((__packed__
));
36 #define SBIT(port,pin) ((*(volatile struct bits*)&port).b##pin)
39 // Known to work: 4.8.4, 4.9.1
40 // Known to fail: 4.8.3, 4.9.0
42 #if (GCC_VERSION < 40804) || (GCC_VERSION == 40900)
43 #define GCC_BUG_61443 1
58 #define stringify(s) tostring(s)
59 #define tostring(s) #s
61 #define FSTR(X) ((const FLASH char[]) { X } )
62 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
64 #define MIN(a,b) ({ typeof (a) _a = (a); \
65 typeof (b) _b = (b); \
67 #define MAX(a,b) ({ typeof (a) _a = (a); \
68 typeof (b) _b = (b); \
74 extern volatile uint_least8_t Stat
;
77 #define S_10MS_TO (1<<0)
78 #define S_MSG_PENDING (1<<1)
79 #define S_CON_PENDING (1<<2)
82 void my_puts(const char *s
)
88 void my_puts_P(const char *s
)