From 3b2f2ea6c6fbfcb23ea9ab324c83d602d45a8820 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 9 Nov 2017 13:17:35 +0100 Subject: Update makefile, and bug fix in pio driver and usart --- sw/z80/arch/sleep.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sw/z80/arch/sleep.c (limited to 'sw/z80/arch/sleep.c') diff --git a/sw/z80/arch/sleep.c b/sw/z80/arch/sleep.c new file mode 100644 index 0000000..154e7ec --- /dev/null +++ b/sw/z80/arch/sleep.c @@ -0,0 +1,16 @@ +#include "sleep.h" + +void usleep(uint16_t microseconds) +{ + __asm + pop hl +loop: + ld bc, #SLEEP_UNIT +unit: + nop + dec bc + jr nz, unit + dec hl + jr nz,loop + __endasm; +} \ No newline at end of file -- cgit v1.2.1