Ti Constructor
 
Loading...
Searching...
No Matches
misc.c File Reference

Some random but useful functions. More...

Functions

CPU speed settings
char getCpuSpeed () __naked __z88dk_sdccdecl
 Get the current cpu speed.
 
void setCpuSpeed (char speed) __naked __z88dk_fastcall
 Set the current cpu speed.
 
unsigned int getTime () __naked __z88dk_sdccdecl
 Get bottom bytes of realtime clock.
 
void wait (unsigned char x) __naked __z88dk_fastcall
 Wait for amount of time (1/8th of sec)
 
char isqrt (unsigned int val)
 DEPRECATED Int square root
 

Detailed Description

Some random but useful functions.

Optional #defines

Function Documentation

◆ getCpuSpeed()

char getCpuSpeed ( )

Get the current cpu speed.

Returns
char of a value 0-3 0 for 8 mhz and 3 for 14.99 mhz for more info: https://wikiti.brandonw.net/index.php?title=83Plus:Ports:20

◆ getTime()

unsigned int getTime ( )

Get bottom bytes of realtime clock.

Returns
16-bit unsigned int of the bottom bytes of the real time clock See: https://wikiti.brandonw.net/index.php?title=83Plus:Ports:45 and https://wikiti.brandonw.net/index.php?title=83Plus:Ports:40

◆ isqrt()

char isqrt ( unsigned int val)

DEPRECATED Int square root

Parameters
[val]unsigned int
Returns
char value of sqrt(val)

This function is DEPRECATED and slow! Please use sqrt_rounded() in fast_math.c

◆ setCpuSpeed()

void setCpuSpeed ( char speed)

Set the current cpu speed.

Parameters
[speed]char of a value 0-3 0 for 8 mhz and 3 for 14.99 mhz for more info: https://wikiti.brandonw.net/index.php?title=83Plus:Ports:20

◆ wait()

void wait ( unsigned char x)

Wait for amount of time (1/8th of sec)

Parameters
[x]Amount of time to wait in intervals of 1/8th of a secound