Skip to content

Fix return type of ArduinoLEDMatrix::begin() #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions libraries/Arduino_LED_Matrix/src/Arduino_LED_Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,19 @@ class ArduinoLEDMatrix
void off(size_t pin) {
turnLed(pin, false);
}
int begin() {
bool begin() {
bool rv = true;
uint8_t type;
uint8_t ch = FspTimer::get_available_timer(type);
if(ch == -1) {
return false;
}
// TODO: avoid passing "this" argument to remove autoscroll
_ledTimer.begin(TIMER_MODE_PERIODIC, type, ch, 10000.0, 50.0, turnOnLedISR, this);
_ledTimer.setup_overflow_irq();
_ledTimer.open();
_ledTimer.start();
rv &= _ledTimer.begin(TIMER_MODE_PERIODIC, type, ch, 10000.0, 50.0, turnOnLedISR, this);
rv &= _ledTimer.setup_overflow_irq();
rv &= _ledTimer.open();
rv &= _ledTimer.start();
return rv;
}
void next() {
uint32_t frame[3];
Expand Down
Loading