Solve the pgmspace.h problem centrally.
We previously put replacements for the von Neuman architecture into arduino.h already, now let's complete this by having only one #include <avr/pgmspace.h> in arduino.h. Almost all sources include arduino.h anyways, so this is mostly a code reduction.
This commit is contained in:
parent
52f5a56d71
commit
ce40b678f6
10
arduino.h
10
arduino.h
|
|
@ -71,14 +71,20 @@
|
||||||
|
|
||||||
For the AVR definitions, see /usr/lib/avr/include/avr/pgmspace.h on Linux.
|
For the AVR definitions, see /usr/lib/avr/include/avr/pgmspace.h on Linux.
|
||||||
*/
|
*/
|
||||||
#ifndef __AVR__
|
#ifdef __AVR__
|
||||||
|
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#define PROGMEM
|
#define PROGMEM
|
||||||
#define PGM_P const char *
|
#define PGM_P const char *
|
||||||
#define PSTR(s) ((const PROGMEM char *)(s))
|
#define PSTR(s) ((const PROGMEM char *)(s))
|
||||||
#define pgm_read_byte(x) (*((uint8_t *)(x)))
|
#define pgm_read_byte(x) (*((uint8_t *)(x)))
|
||||||
#define pgm_read_word(x) (*((uint16_t *)(x)))
|
#define pgm_read_word(x) (*((uint16_t *)(x)))
|
||||||
#define pgm_read_dword(x) (*((uint32_t *)(x)))
|
#define pgm_read_dword(x) (*((uint32_t *)(x)))
|
||||||
#endif /* ! __AVR__ */
|
|
||||||
|
#endif /* __AVR__, ! __AVR__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ports and functions
|
ports and functions
|
||||||
|
|
|
||||||
9
dda.h
9
dda.h
|
|
@ -11,15 +11,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#else
|
|
||||||
#define PROGMEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
types
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Enum to denote an axis
|
// Enum to denote an axis
|
||||||
enum axis_e { X = 0, Y, Z, E, AXIS_COUNT };
|
enum axis_e { X = 0, Y, Z, E, AXIS_COUNT };
|
||||||
|
|
|
||||||
1
heater.c
1
heater.c
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <avr/eeprom.h>
|
#include <avr/eeprom.h>
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
|
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
|
||||||
3
serial.h
3
serial.h
|
|
@ -3,9 +3,6 @@
|
||||||
|
|
||||||
#include "config_wrapper.h"
|
#include "config_wrapper.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#ifdef __AVR__
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#endif
|
|
||||||
#include "simulator.h"
|
#include "simulator.h"
|
||||||
|
|
||||||
#ifdef USB_SERIAL
|
#ifdef USB_SERIAL
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#ifndef SIMULATOR
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "sermsg.h"
|
#include "sermsg.h"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
#ifndef _SERSENDF_H
|
#ifndef _SERSENDF_H
|
||||||
#define _SERSENDF_H
|
#define _SERSENDF_H
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#endif
|
|
||||||
#include "arduino.h"
|
#include "arduino.h"
|
||||||
|
|
||||||
|
|
||||||
void sersendf(char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
void sersendf(char *format, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
void sersendf_P(PGM_P format_P, ...) __attribute__ ((format (printf, 1, 2)));
|
void sersendf_P(PGM_P format_P, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue