Skip to content

Commit 2c8dd57

Browse files
committed
Fix return type of ArduinoLEDMatrix::begin()
1 parent 3dd08de commit 2c8dd57

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

libraries/Arduino_LED_Matrix/src/Arduino_LED_Matrix.h

+10-5
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,19 @@ class ArduinoLEDMatrix
169169
void off(size_t pin) {
170170
turnLed(pin, false);
171171
}
172-
int begin() {
172+
bool begin() {
173+
bool rv = true;
173174
uint8_t type;
174175
uint8_t ch = FspTimer::get_available_timer(type);
176+
if(ch == -1) {
177+
return false;
178+
}
175179
// TODO: avoid passing "this" argument to remove autoscroll
176-
_ledTimer.begin(TIMER_MODE_PERIODIC, type, ch, 10000.0, 50.0, turnOnLedISR, this);
177-
_ledTimer.setup_overflow_irq();
178-
_ledTimer.open();
179-
_ledTimer.start();
180+
rv &= _ledTimer.begin(TIMER_MODE_PERIODIC, type, ch, 10000.0, 50.0, turnOnLedISR, this);
181+
rv &= _ledTimer.setup_overflow_irq();
182+
rv &= _ledTimer.open();
183+
rv &= _ledTimer.start();
184+
return rv;
180185
}
181186
void next() {
182187
uint32_t frame[3];

0 commit comments

Comments
 (0)