File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,26 @@ static const uint16_t render_timings[] =
215215 1500 , // 8, 3170
216216// Always on 9, ~6000
217217};
218+
218219
220+ /* * Egregious hack to work around paranoia in the DAL API.
221+ */
222+ struct FakeMicroBitDisplay : public MicroBitComponent
223+ {
224+ uint8_t width;
225+ uint8_t height;
226+ uint8_t brightness;
227+ uint8_t strobeRow;
228+ uint8_t strobeBitMsk;
229+ uint8_t rotation;
230+ uint8_t mode;
231+ uint8_t greyscaleBitMsk;
232+ uint8_t timingCount;
233+ uint16_t nonce;
234+ Timeout renderTimer;
235+ };
236+
237+ Timeout *renderTimer = &((FakeMicroBitDisplay*)(&(uBit.display)))->renderTimer;
219238
220239void microbit_display_obj_t::renderRow () {
221240 mp_uint_t brightness = previous_brightness+1 ;
@@ -224,7 +243,7 @@ void microbit_display_obj_t::renderRow() {
224243 return ;
225244 previous_brightness = brightness;
226245 // Attach to timer
227- uBit. display . renderTimer . attach_us (this , µbit_display_obj_t ::renderRow, render_timings[brightness]);
246+ renderTimer-> attach_us (this , µbit_display_obj_t ::renderRow, render_timings[brightness]);
228247
229248}
230249
You can’t perform that action at this time.
0 commit comments