mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 21:44:55 +01:00
commit
0047d24698
3 changed files with 9 additions and 7 deletions
|
@ -349,7 +349,7 @@ RC522::StatusCode RC522::pcd_communicate_with_picc_(
|
||||||
// transmitting. Each iteration of the do-while-loop takes 17.86μs.
|
// transmitting. Each iteration of the do-while-loop takes 17.86μs.
|
||||||
// TODO check/modify for other architectures than Arduino Uno 16bit
|
// TODO check/modify for other architectures than Arduino Uno 16bit
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
for (i = 4; i > 0; i--) {
|
for (i = 2000; i > 0; i--) {
|
||||||
uint8_t n = pcd_read_register(
|
uint8_t n = pcd_read_register(
|
||||||
COM_IRQ_REG); // ComIrqReg[7..0] bits are: Set1 TxIRq RxIRq IdleIRq HiAlertIRq LoAlertIRq ErrIRq TimerIRq
|
COM_IRQ_REG); // ComIrqReg[7..0] bits are: Set1 TxIRq RxIRq IdleIRq HiAlertIRq LoAlertIRq ErrIRq TimerIRq
|
||||||
if (n & wait_i_rq) { // One of the interrupts that signal success has been set.
|
if (n & wait_i_rq) { // One of the interrupts that signal success has been set.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
MAJOR_VERSION = 1
|
MAJOR_VERSION = 1
|
||||||
MINOR_VERSION = 16
|
MINOR_VERSION = 16
|
||||||
PATCH_VERSION = '0b7'
|
PATCH_VERSION = '0b8'
|
||||||
__short_version__ = f'{MAJOR_VERSION}.{MINOR_VERSION}'
|
__short_version__ = f'{MAJOR_VERSION}.{MINOR_VERSION}'
|
||||||
__version__ = f'{__short_version__}.{PATCH_VERSION}'
|
__version__ = f'{__short_version__}.{PATCH_VERSION}'
|
||||||
|
|
||||||
|
|
|
@ -171,15 +171,17 @@ uint8_t crc8(uint8_t *data, uint8_t len) {
|
||||||
}
|
}
|
||||||
return crc;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void delay_microseconds_accurate(uint32_t usec) {
|
void delay_microseconds_accurate(uint32_t usec) {
|
||||||
if (usec == 0)
|
if (usec == 0)
|
||||||
return;
|
return;
|
||||||
|
if (usec < 5000UL) {
|
||||||
if (usec <= 16383UL) {
|
|
||||||
delayMicroseconds(usec);
|
delayMicroseconds(usec);
|
||||||
} else {
|
return;
|
||||||
delay(usec / 1000UL);
|
}
|
||||||
delayMicroseconds(usec % 1000UL);
|
uint32_t start = micros();
|
||||||
|
while (micros() - start < usec) {
|
||||||
|
delay(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue