Skip to content

Commit

Permalink
Remove the custom PROGRAM SPACE definitions and use avr/pgmspace!
Browse files Browse the repository at this point in the history
  • Loading branch information
akatran committed Apr 3, 2016
1 parent 98ee2b0 commit a8f100b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions utility/ATXMegaD3/RF24_arch_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define __RF24_ARCH_CONFIG_H__

#include <stddef.h>
#include <avr/pgmspace.h>
#include "spi.h"
#include "gpio.h"
#include "compatibility.h"
Expand All @@ -46,24 +47,25 @@
#define IF_SERIAL_DEBUG(x)
#endif

// Avoid spurious warnings
#if 1
#if ! defined( NATIVE ) && defined( ARDUINO )
#undef PROGMEM
#define PROGMEM __attribute__(( section(".progmem.data") ))
#undef PSTR
#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
#endif
#endif
// Use the avr pgmspace commands
//// Avoid spurious warnings
//#if 1
//#if ! defined( NATIVE ) && defined( ARDUINO )
//#undef PROGMEM
//#define PROGMEM __attribute__(( section(".progmem.data") ))
//#undef PSTR
//#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
//#endif
//#endif

typedef uint16_t prog_uint16_t;
#define PSTR(x) (x)
#define printf_P printf
#define strlen_P strlen
#define PROGMEM
#define pgm_read_word(p) (*(p))
//#define PSTR(x) (x)
//#define printf_P printf
//#define strlen_P strlen
//#define PROGMEM
//#define pgm_read_word(p) (*(p))
#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
#define LOW GPIO::OUTPUT_LOW
Expand Down

0 comments on commit a8f100b

Please sign in to comment.