File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929#include "py/runtime.h"
3030#include "shared-bindings/displayio/FourWire.h"
3131#include "shared-bindings/displayio/ParallelBus.h"
32+ #include "shared-bindings/time/__init__.h"
3233
3334#include <stdint.h>
3435
@@ -73,18 +74,15 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
7374 uint8_t * data = cmd + 2 ;
7475 self -> send (self -> bus , true, cmd , 1 );
7576 self -> send (self -> bus , false, data , data_size );
77+ uint16_t delay_length_ms = 10 ;
7678 if (delay ) {
7779 data_size ++ ;
78- uint16_t delay_length_ms = * (cmd + 1 + data_size );
80+ delay_length_ms = * (cmd + 1 + data_size );
7981 if (delay_length_ms == 255 ) {
8082 delay_length_ms = 500 ;
8183 }
82- uint64_t start = ticks_ms ;
83- while (ticks_ms - start < delay_length_ms ) {}
84- } else {
85- uint64_t start = ticks_ms ;
86- while (ticks_ms - start < 10 ) {}
8784 }
85+ common_hal_time_delay_ms (delay_length_ms );
8886 i += 2 + data_size ;
8987 }
9088 self -> end_transaction (self -> bus );
You can’t perform that action at this time.
0 commit comments