improve timing
This commit is contained in:
parent
208ee058fc
commit
d8557e9cb1
1 changed files with 2 additions and 1 deletions
|
@ -154,11 +154,12 @@ void QSPI_74HC595_4X_DISPLAYComponent::display()
|
||||||
const uint8_t *buf_ptr = reinterpret_cast<const uint8_t *>(this->buffer_);
|
const uint8_t *buf_ptr = reinterpret_cast<const uint8_t *>(this->buffer_);
|
||||||
for (uint8_t i = 0; i < 8; i++)
|
for (uint8_t i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
|
uint32_t start = micros();
|
||||||
this->enable();
|
this->enable();
|
||||||
this->write_cmd_addr_data(0, 0, 0, 0, buf_ptr, 8, 4);
|
this->write_cmd_addr_data(0, 0, 0, 0, buf_ptr, 8, 4);
|
||||||
buf_ptr += 8;
|
buf_ptr += 8;
|
||||||
this->disable();
|
this->disable();
|
||||||
delay_microseconds_safe(delay);
|
delay_microseconds_safe(delay - (micros() - start));
|
||||||
}
|
}
|
||||||
// zero out everything to have a somewhat uniform duty cycle for all digits
|
// zero out everything to have a somewhat uniform duty cycle for all digits
|
||||||
this->enable();
|
this->enable();
|
||||||
|
|
Loading…
Reference in a new issue