Skip to content
This repository
Browse code

PROGMEM compatibility for ARM Processors

gets rid of ‘pgm_read_byte’ errors on ARM processors.
Tested to be working with Texas Instruments’ Tiva C Series Launchpad.
Backwards compatible with Arduino Uno (tested and working).
commit 5f59d75ce01ad0fa2e7c07300eb88f3a1a36a044 1 parent b7ccc5b
udawat authored

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. +11 1 Arduino/MPU6050/MPU6050.h
12 Arduino/MPU6050/MPU6050.h
@@ -38,8 +38,18 @@ THE SOFTWARE.
38 38 #define _MPU6050_H_
39 39
40 40 #include "I2Cdev.h"
41   -//#include <avr/pgmspace.h>
42 41
  42 +// supporting link: http://forum.arduino.cc/index.php?&topic=143444.msg1079517#msg1079517
  43 +// also: http://forum.arduino.cc/index.php?&topic=141571.msg1062899#msg1062899s
  44 +#ifndef __arm__
  45 +#include <avr/pgmspace.h>
  46 +#else
  47 +#define PROGMEM /* empty */
  48 +#define pgm_read_byte(x) (*(x))
  49 +#define pgm_read_word(x) (*(x))
  50 +#define pgm_read_float(x) (*(x))
  51 +#define PSTR(STR) STR
  52 +#endif
43 53
44 54
45 55 #define MPU6050_ADDRESS_AD0_LOW 0x68 // address pin low (GND), default for InvenSense evaluation board

0 comments on commit 5f59d75

Please sign in to comment.
Something went wrong with that request. Please try again.