Skip to content

Commit 62a4d3e

Browse files
fixed some bugs
First a compilation error due to recent refactoring, also address erroneous handling of PROGMEM memory.
1 parent 9ecce97 commit 62a4d3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/LEDImage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ template <class PixelType>
8484
const PixelType LEDImageBase<PixelType>::pixel( int row, int column ) const {
8585
if (this->isProgMem()) {
8686
switch (sizeof(PixelType)) {
87-
case 16:
87+
case 4:
8888
return (PixelType)pgm_read_word_near( this->data() + row*this->columns() + column );
8989
break;
9090
default:
91-
case 8:
91+
case 2:
9292
return (PixelType)pgm_read_byte_near( this->data() + row*this->columns() + column );
9393
break;
9494
}
@@ -143,7 +143,7 @@ LEDImage<PixelType>::LEDImage(const LEDImageBase<PixelType>& other)
143143
_data( other.isProgMem() ?
144144
other.data() :
145145
(PixelType*)memcpy(
146-
new RGBColorType[(other.rows()*other.columns())],
146+
new PixelType[(other.rows()*other.columns())],
147147
other.data(),
148148
(other.rows()*other.columns())*sizeof(PixelType)
149149
)),

src/RGBAnimation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class GlyphSequenceAnimation : public RGBAnimationBase {
118118
class ImageSequenceAnimation : public RGBAnimationBase {
119119
public:
120120
struct Frame {
121-
const RGBImageBase* image;
121+
const LEDImageBase<RGBColorType>* image;
122122
int row;
123123
int column;
124124
unsigned long interval;

0 commit comments

Comments
 (0)