summaryrefslogtreecommitdiffstats
path: root/sw/z80/arch/sleep.c
blob: 154e7ecd4664d3e006f4683e05759d0397fdf38f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}