Make the sleeps faster

Based on tests they are not faster, even though the raw sleeps have less instuctions.

But having them call get_tmr breaks important logic.
Make both raw to avoid any future problems.
This commit is contained in:
Kostas Missos 2018-07-05 02:02:17 +03:00
parent 879fc643d9
commit a14f554657
2 changed files with 6 additions and 6 deletions

View file

@ -37,15 +37,15 @@ u32 get_tmr_us()
void msleep(u32 milliseconds)
{
u32 start = get_tmr_ms();
while ((get_tmr_ms() - start) <= milliseconds)
u32 start = RTC(0x10) | (RTC(0xC)<< 10);
while (((RTC(0x10) | (RTC(0xC)<< 10)) - start) <= milliseconds)
;
}
void usleep(u32 microseconds)
{
u32 start = get_tmr_us();
while ((get_tmr_us() - start) <= microseconds)
u32 start = TMR(0x10);
while ((TMR(0x10) - start) <= microseconds)
;
}

View file

@ -21,7 +21,7 @@
#include "types.h"
#define byte_swap_32(num) ((num>>24)&0xff) | ((num<<8)&0xff0000) | \
((num>>8)&0xff00) | ((num<<24)&0xff000000); \
((num>>8)&0xff00) | ((num<<24)&0xff000000) \
typedef struct _cfg_op_t
{
@ -38,7 +38,7 @@ void exec_cfg(u32 *base, const cfg_op_t *ops, u32 num_ops);
u32 crc32c(const void *buf, u32 len);
/* This is a faster implementation of memcmp that checks two u32 values */
/* every 128 Bytes block. Intented for only for Backup and Restore */
/* every 128 Bytes block. Intented only for Backup and Restore */
u32 memcmp32sparse(const u32 *buf1, const u32 *buf2, u32 len);
#endif