Skip to content

Commit c05a37d

Browse files
authored
Merge pull request #50 from soburi/correct_micros
Correcting the calculation of micros()
2 parents 2f5538b + e23ef9c commit c05a37d

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)