Commit a8f100b2 authored by akatran's avatar akatran

Remove the custom PROGRAM SPACE definitions and use avr/pgmspace!

parent 98ee2b03
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define __RF24_ARCH_CONFIG_H__ #define __RF24_ARCH_CONFIG_H__
#include <stddef.h> #include <stddef.h>
#include <avr/pgmspace.h>
#include "spi.h" #include "spi.h"
#include "gpio.h" #include "gpio.h"
#include "compatibility.h" #include "compatibility.h"
...@@ -46,24 +47,25 @@ ...@@ -46,24 +47,25 @@
#define IF_SERIAL_DEBUG(x) #define IF_SERIAL_DEBUG(x)
#endif #endif
// Avoid spurious warnings // Use the avr pgmspace commands
#if 1 //// Avoid spurious warnings
#if ! defined( NATIVE ) && defined( ARDUINO ) //#if 1
#undef PROGMEM //#if ! defined( NATIVE ) && defined( ARDUINO )
#define PROGMEM __attribute__(( section(".progmem.data") )) //#undef PROGMEM
#undef PSTR //#define PROGMEM __attribute__(( section(".progmem.data") ))
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) //#undef PSTR
#endif //#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
#endif //#endif
//#endif
typedef uint16_t prog_uint16_t; typedef uint16_t prog_uint16_t;
#define PSTR(x) (x) //#define PSTR(x) (x)
#define printf_P printf //#define printf_P printf
#define strlen_P strlen //#define strlen_P strlen
#define PROGMEM //#define PROGMEM
#define pgm_read_word(p) (*(p)) //#define pgm_read_word(p) (*(p))
#define PRIPSTR "%s" #define PRIPSTR "%s"
#define pgm_read_byte(p) (*(p)) //#define pgm_read_byte(p) (*(p))
// Function, constant map as a result of migrating from Arduino // Function, constant map as a result of migrating from Arduino
#define LOW GPIO::OUTPUT_LOW #define LOW GPIO::OUTPUT_LOW
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment