From 66fc2402e4d71688b5fe745fe7813b88385f0aec Mon Sep 17 00:00:00 2001 From: Jeff-Haas Date: Thu, 13 Apr 2017 23:15:30 -0700 Subject: [PATCH] Revert "Updates for current Arduino IDE" This reverts commit 89d8a53ddfefc7c03c7391c2947466021437bfcb. --- examples/BasicAnimations/ani_arduino.h | 2 +- tlc_animations.h | 8 ++++---- tlc_progmem_utils.h | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/BasicAnimations/ani_arduino.h b/examples/BasicAnimations/ani_arduino.h index 9304658..dc92f1a 100644 --- a/examples/BasicAnimations/ani_arduino.h +++ b/examples/BasicAnimations/ani_arduino.h @@ -1,5 +1,5 @@ #define ANI_ARDUINO_FRAMES 80 -const uint8_t ani_arduino[NUM_TLCS * 24 * ANI_ARDUINO_FRAMES] PROGMEM = { +uint8_t ani_arduino[NUM_TLCS * 24 * ANI_ARDUINO_FRAMES] PROGMEM = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,6,176,206, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,65,10,64,247,15,240,255, 0,0,0,0,0,0,0,0,0,0,0,0,1,160,122,13,192,255,15,240,254,11,192,89, diff --git a/tlc_animations.h b/tlc_animations.h index 7e06ffd..0882db9 100644 --- a/tlc_animations.h +++ b/tlc_animations.h @@ -30,7 +30,7 @@ #include "tlc_progmem_utils.h" /** The currently playing animation */ -const uint8_t *tlc_currentAnimation; +prog_uint8_t *tlc_currentAnimation; /** The number of frames in the current animation */ volatile uint16_t tlc_animationFrames; /** The number of PWM periods to display each frame - 1 */ @@ -39,11 +39,11 @@ volatile uint16_t tlc_animationPeriodsPerFrame; volatile uint16_t tlc_animationPeriodsWait; volatile void tlc_animationXLATCallback(void); -void tlc_playAnimation(const uint8_t PROGMEM *animation, uint16_t frames, uint16_t periodsPerFrame); +void tlc_playAnimation(prog_uint8_t *animation, uint16_t frames, uint16_t periodsPerFrame); /** \addtogroup ExtendedFunctions \code #include "tlc_animations.h" \endcode - - void tlc_playAnimation(const uint8_t PROGMEM *animation, uint16_t frames, + - void tlc_playAnimation(prog_uint8_t *animation, uint16_t frames, uint16_t periodsPerFrame) - plays an animation from progmem. */ /* @{ */ @@ -55,7 +55,7 @@ void tlc_playAnimation(const uint8_t PROGMEM *animation, uint16_t frames, uint16 \param periodsPerFrame number of PWM periods to wait between each frame (0 means play the animation as fast as possible). The default PWM period for a 16MHz clock is 1.024ms. */ -void tlc_playAnimation(const uint8_t PROGMEM *animation, uint16_t frames, uint16_t periodsPerFrame) +void tlc_playAnimation(prog_uint8_t *animation, uint16_t frames, uint16_t periodsPerFrame) { tlc_currentAnimation = animation; tlc_animationFrames = frames; diff --git a/tlc_progmem_utils.h b/tlc_progmem_utils.h index e1f7c97..e87406e 100644 --- a/tlc_progmem_utils.h +++ b/tlc_progmem_utils.h @@ -26,17 +26,17 @@ #include "Tlc5940.h" #include "pinouts/pin_functions.h" -void tlc_setGSfromProgmem(const uint8_t PROGMEM *gsArray); +void tlc_setGSfromProgmem(prog_uint8_t *gsArray); #if VPRG_ENABLED -void tlc_setDCfromProgmem(const uint8_t PROGMEM *dcArray); +void tlc_setDCfromProgmem(prog_uint8_t *dcArray); #endif /** \addtogroup ExtendedFunctions \code #include "tlc_progmem_utils.h" \endcode - - void tlc_setGSfromProgmem(const uint8_t PROGMEM *gsArray) - copies the progmem + - void tlc_setGSfromProgmem(prog_uint8_t *gsArray) - copies the progmem grayscale to current grayscale array. Requires a \link Tlc5940::update Tlc.update() \endlink. - - void tlc_setDCfromProgmem(const uint8_t PROGMEM *dcArray) - shifts the data from a + - void tlc_setDCfromProgmem(prog_uint8_t *dcArray) - shifts the data from a progmem dot correction array (doesn't need an update). */ /* @{ */ @@ -44,7 +44,7 @@ void tlc_setDCfromProgmem(const uint8_t PROGMEM *dcArray); any data: call Tlc.update(). An example: \code #include "tlc_progmem_utils.h" -const uint8_t PROGMEM gsArray1[NUM_TLCS * 24] = { +prog_uint8_t gsArray1[NUM_TLCS * 24] = { GS_DUO((4095 * 16)/16, (4095 * 15)/16), GS_DUO((4095 * 14)/16, (4095 * 13)/16), GS_DUO((4095 * 12)/16, (4095 * 11)/16), GS_DUO((4095 * 10)/16, (4095 * 9)/16), GS_DUO((4095 * 8)/16, (4095 * 7)/16), GS_DUO((4095 * 6)/16, (4095 * 5)/16), @@ -62,9 +62,9 @@ Tlc.update(); The format of the grayscale array is explained in #tlc_GSData. \param gsArray A progmem array of grayscale data. */ -void tlc_setGSfromProgmem(const uint8_t PROGMEM *gsArray) +void tlc_setGSfromProgmem(prog_uint8_t *gsArray) { - const uint8_t PROGMEM *gsArrayp = gsArray; + prog_uint8_t *gsArrayp = gsArray; uint8_t *gsDatap = tlc_GSData; while (gsDatap < tlc_GSData + NUM_TLCS * 24) { *gsDatap++ = pgm_read_byte(gsArrayp++); @@ -78,14 +78,14 @@ void tlc_setGSfromProgmem(const uint8_t PROGMEM *gsArray) /** \addtogroup ReqVPRG_ENABLED From tlc_progmem_utils.h: - - tlc_setDCfromProgmem(const uint8_t PROGMEM *dcArray) - shifts the data from a + - tlc_setDCfromProgmem(prog_uint8_t *dcArray) - shifts the data from a progmem dot correction array (doesn't need an update). */ /* @{ */ /** Sets the dot correction data from an array in progmem. An example: \code #include "tlc_progmem_utils.h" -const uint8_t PROGMEM dcArray1[NUM_TLCS * 12] = { +prog_uint8_t dcArray1[NUM_TLCS * 12] = { DC_QUARTET(32, 63, 32, 63), DC_QUARTET(32, 63, 32, 63), DC_QUARTET(32, 63, 32, 63), DC_QUARTET(32, 63, 32, 63), }; @@ -103,12 +103,12 @@ tlc_setDCfromProgmem(dcArray1); \param dcArray A progmem array of dot correction data to be shifted out. \see \link Tlc5940::setAllDC Tlc.setAllDC \endlink */ -void tlc_setDCfromProgmem(const uint8_t PROGMEM *dcArray) +void tlc_setDCfromProgmem(prog_uint8_t *dcArray) { tlc_dcModeStart(); - const uint8_t PROGMEM *p = dcArray; - const uint8_t PROGMEM *dcArrayEnd = dcArray + NUM_TLCS * 12; + prog_uint8_t *p = dcArray; + prog_uint8_t *dcArrayEnd = dcArray + NUM_TLCS * 12; while (p < dcArrayEnd) { tlc_shift8(pgm_read_byte(p++)); }