@@ -109,9 +109,9 @@ void Screen_::restoreCache()
109109// CACHE END
110110
111111// STORAGE START
112- #ifdef ENABLE_STORAGE
113112void Screen_::loadFromStorage ()
114113{
114+ #ifdef ENABLE_STORAGE
115115 storage.begin (" led-wall" , true );
116116 setBrightness (255 );
117117
@@ -128,17 +128,19 @@ void Screen_::loadFromStorage()
128128 setBrightness (storage.getUInt (" brightness" , 255 ));
129129 setCurrentRotation (storage.getUInt (" rotation" , 0 ));
130130 storage.end ();
131+ #endif
131132}
132133
133134void Screen_::persist ()
134135{
136+ #ifdef ENABLE_STORAGE
135137 storage.begin (" led-wall" );
136138 storage.putBytes (" data" , renderBuffer_, ROWS * COLS);
137139 storage.putUInt (" brightness" , brightness_);
138140 storage.putUInt (" rotation" , currentRotation);
139141 storage.end ();
140- }
141142#endif
143+ }
142144// STORAGE END
143145
144146void Screen_::setup ()
@@ -168,10 +170,9 @@ void Screen_::setup()
168170 SPI.begin (PIN_CLOCK, 34 , PIN_DATA, 25 ); // SCLK, MISO, MOSI, SS
169171 SPI.beginTransaction (SPISettings (10000000 , MSBFIRST, SPI_MODE0));
170172
171- hw_timer_t *Screen_timer = timerBegin (0 , 80 , true );
172- timerAttachInterrupt (Screen_timer, &onScreenTimer, true );
173- timerAlarmWrite (Screen_timer, TIMER_INTERVAL_US, true );
174- timerAlarmEnable (Screen_timer);
173+ hw_timer_t *Screen_timer = timerBegin (1000000 );
174+ timerAttachInterrupt (Screen_timer, &onScreenTimer);
175+ timerAlarm (Screen_timer, TIMER_INTERVAL_US, true , 0 );
175176#endif
176177}
177178
0 commit comments