Fix deprecated 'prog_*' typedef - Issue #34
- Remove prog_char from xpritnf - Remove prog_macro_t from acton_macro avr-libc-1.8 removed 'prog_*' typedef because the usage of the __progmem__ attribute on a type is not supported in GCC. http://www.nongnu.org/avr-libc/changes-1.8.html
This commit is contained in:
parent
adbd15d5bd
commit
796defa86c
@ -50,7 +50,7 @@ void action_exec(keyevent_t event);
|
||||
action_t action_for_key(uint8_t layer, key_t key);
|
||||
|
||||
/* macro */
|
||||
const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
|
||||
|
||||
/* user defined special function */
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
|
||||
|
@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifndef NO_ACTION_MACRO
|
||||
|
||||
#define MACRO_READ() (macro = pgm_read_byte(macro_p++))
|
||||
void action_macro_play(const prog_macro_t *macro_p)
|
||||
void action_macro_play(const macro_t *macro_p)
|
||||
{
|
||||
macro_t macro = END;
|
||||
uint8_t interval = 0;
|
||||
|
@ -21,15 +21,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#define MACRO_NONE 0
|
||||
#define MACRO(...) ({ static prog_macro_t _m[] PROGMEM = { __VA_ARGS__ }; _m; })
|
||||
#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; })
|
||||
|
||||
|
||||
typedef uint8_t macro_t;
|
||||
typedef macro_t prog_macro_t PROGMEM;
|
||||
|
||||
|
||||
#ifndef NO_ACTION_MACRO
|
||||
void action_macro_play(const prog_macro_t *macro);
|
||||
void action_macro_play(const macro_t *macro_p);
|
||||
#else
|
||||
#define action_macro_play(macro)
|
||||
#endif
|
||||
|
@ -106,7 +106,7 @@ action_t action_for_key(uint8_t layer, key_t key)
|
||||
|
||||
/* Macro */
|
||||
__attribute__ ((weak))
|
||||
const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
return MACRO_NONE;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ xputc:
|
||||
;---------------------------------------------------------------------------
|
||||
; Direct ROM string output
|
||||
;
|
||||
;Prototype: void xputs (const prog_char *str // rom string to be output
|
||||
;Prototype: void xputs (const char *str_p // rom string to be output
|
||||
; );
|
||||
|
||||
.func xputs
|
||||
@ -179,9 +179,9 @@ xitoa:
|
||||
; Formatted string output (16/32bit version)
|
||||
;
|
||||
;Prototype:
|
||||
; void xprintf (const prog_char *format, ...);
|
||||
; void xsprintf(char*, const prog_char *format, ...);
|
||||
; void xfprintf(void(*func)(char), const prog_char *format, ...);
|
||||
; void __xprintf (const char *format_p, ...);
|
||||
; void __xsprintf(char*, const char *format_p, ...);
|
||||
; void __xfprintf(void(*func)(char), const char *format_p, ...);
|
||||
;
|
||||
|
||||
#if USE_XPRINTF
|
||||
|
@ -23,7 +23,7 @@ void xputc(char chr);
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
void xputs(const prog_char *string);
|
||||
void xputs(const char *string_p);
|
||||
|
||||
/* The string placed in the ROM is forwarded to xputc() directly.
|
||||
*/
|
||||
@ -51,9 +51,9 @@ void xitoa(long value, char radix, char width);
|
||||
#define xsprintf(str, format, ...) __xsprintf(str, PSTR(format), ##__VA_ARGS__)
|
||||
#define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__)
|
||||
|
||||
void __xprintf(const prog_char *format, ...); /* Send formatted string to the registered device */
|
||||
void __xsprintf(char*, const prog_char *format, ...); /* Put formatted string to the memory */
|
||||
void __xfprintf(void(*func)(uint8_t), const prog_char *format, ...); /* Send formatted string to the specified device */
|
||||
void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */
|
||||
void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */
|
||||
void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */
|
||||
|
||||
/* Format string is placed in the ROM. The format flags is similar to printf().
|
||||
|
||||
|
@ -125,7 +125,7 @@ enum macro_id {
|
||||
DUMMY,
|
||||
};
|
||||
|
||||
const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
keyevent_t event = record->event;
|
||||
//uint8_t tap_count = record->tap_count;
|
||||
|
@ -209,7 +209,7 @@ static const uint16_t PROGMEM fn_actions[] = {
|
||||
/*
|
||||
* Macro definition
|
||||
*/
|
||||
const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
keyevent_t event = record->event;
|
||||
tap_t tap = record->tap;
|
||||
|
Reference in New Issue
Block a user