Skip to content

Commit e23ef9c

Browse files
committed
Correcting the calculation of micros()
1 parent 2f5538b commit e23ef9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/delay.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ unsigned long millis( void )
3636
// values to calculate micros. If there is a pending SysTick, add one to the millis counter in the calculation.
3737
unsigned long micros( void )
3838
{
39-
return RTIMER_NOW() * 1000000/RTIMER_ARCH_SECOND;
39+
return RTIMER_NOW() /(RTIMER_ARCH_SECOND/1000000);
4040
}
4141

4242
static struct etimer delay_timer;

0 commit comments

Comments
 (0)