Skip to content

Commit

Permalink
Merge pull request #4838 from tonhuisman/feature/P131-optimize-reduce…
Browse files Browse the repository at this point in the history
…-build-size

[P131] Optimization for build size
  • Loading branch information
TD-er authored Oct 12, 2023
2 parents 3b9416d + 39e3299 commit 73bc76d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/_P131_NeoPixelMatrix.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// #######################################################################################################

/** Changelog:
* 2023-10-03 tonhuisman: Optimizate alignment of settings struct, exclude some logging if BUILD_NO_DEBUG is defined
* 2023-02-27 tonhuisman: Implement support for getting config values, see AdafruitGFX_Helper.h changelog for details
* 2022-07-30 tonhuisman: Add commands to set scroll-options (settext, setscroll, setstep, setspeed, setempty, setright)
* Fix issue that on startup the display wasn't cleared (unit reset should turn off the display)
Expand Down Expand Up @@ -385,8 +386,10 @@ boolean Plugin_131(uint8_t function, struct EventStruct *event, String& string)
P131_data_struct *P131_data = static_cast<P131_data_struct *>(getPluginTaskData(event->TaskIndex));

success = (nullptr != P131_data) && P131_data->plugin_init(event); // Start the display
# ifndef BUILD_NO_DEBUG
} else {
addLog(LOG_LEVEL_ERROR, F("NEOMATRIX: No GPIO pin configured, init cancelled."));
# endif // ifndef BUILD_NO_DEBUG
}

break;
Expand Down
4 changes: 3 additions & 1 deletion src/src/PluginStructs/P131_data_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ bool P131_data_struct::plugin_init(struct EventStruct *event) {
bool success = false;

if (!isInitialized()) {
# ifndef BUILD_NO_DEBUG
addLog(LOG_LEVEL_INFO, F("NEOMATRIX: Init start."));
# endif // ifndef BUILD_NO_DEBUG
matrix = new (std::nothrow) Adafruit_NeoMatrix(_matrixWidth,
_matrixHeight,
_tileWidth,
Expand Down Expand Up @@ -94,9 +96,9 @@ bool P131_data_struct::plugin_init(struct EventStruct *event) {
log += _ypix;
addLogMove(LOG_LEVEL_INFO, log);
}
# endif // ifndef BUILD_NO_DEBUG
} else {
addLog(LOG_LEVEL_INFO, F("NEOMATRIX: Init failed."));
# endif // ifndef BUILD_NO_DEBUG
}

if (isInitialized()) {
Expand Down
1 change: 1 addition & 0 deletions src/src/PluginStructs/P131_data_struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ struct P131_content_struct {
int16_t pixelPos = 0; // current left-offset on display
int16_t speed = 0; // 0.1 sec. steps
int16_t loop = -1; // steps before we go, -1 = restart from speed
int16_t _filler1 = 0; // Filler added to achieve better instance/memory alignment
int8_t stepWidth = 0; // Nr. of pixels to scroll - 1
bool active = false;
bool rightScroll = false;
Expand Down

0 comments on commit 73bc76d

Please sign in to comment.