Access parts of the base system. More...
#include "system.h"#include "FreeRTOS.h"#include "task.h"#include <stdbool.h>#include <stdlib.h>#include <string.h>#include "utils/log.h"#include "exceptions.h"#include "gpio.h"Functions | |
| void | main () |
| void | system_delay_int (uint64_t ticks) |
| Sleeps for a certain number of ticks. | |
| void * | system_aligned_malloc (uint32_t bytes, uint32_t alignment) |
| Allocate memory with alignment. | |
| void | system_aligned_free (void *ptr) |
| Free allocated memory with alignment. | |
| void | system_initialize () |
| Initializes the system. | |
| void | system_get_boot_path (const char *device, char *buffer, size_t length) |
| Looks in the argv command line for a specific boot path. | |
Access parts of the base system.
Access parts of the base system. Like time and such.
| void system_aligned_free | ( | void * | ptr | ) |
Free allocated memory with alignment.
Free allocated memory with alignment.
| void * system_aligned_malloc | ( | uint32_t | bytes, |
| uint32_t | alignment ) |
Allocate memory with alignment.
Allocate memory aligned to a certain number of bytes. A lot of hardware requires aligned memory. Usually 32 bytes.
Must be a power of 2.
Offsets the pointer by the alignment and stores the original unaligned pointer before the pointer returned.
| void system_delay_int | ( | uint64_t | ticks | ) |
Sleeps for a certain number of ticks.
Waits for a certain number of ticks to elapse.
No interrupts version.
Recommend using FreeRTOS vTaskDelay instead.
| ticks | Number of ticks to wait for |
| void system_get_boot_path | ( | const char * | device, |
| char * | buffer, | ||
| size_t | length ) |
Looks in the argv command line for a specific boot path.
When mounting a file system, this can be used to change the directory into the one the program was launched from if the file system is the one its running from.
For example passing a device of "sd" into device, it will fill buffer with the /apps/my_app/ path if the game was launched from the sd. If not it will return / into it.
| device | Boot device |
| buffer | Outputted path buffer |
| length | Length of path buffer. |
| void system_initialize | ( | ) |
Initializes the system.
Initializes the system. Called from start.s, so this all happens before the C program starts running.