mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-22 20:06:40 +00:00
Define wait() in fusee-primary/secondary
This commit is contained in:
parent
674a91db8c
commit
a3d53fbb2c
2 changed files with 14 additions and 0 deletions
|
@ -13,6 +13,13 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
void wait(uint32_t microseconds) {
|
||||||
|
uint32_t old_time = TIMERUS_CNTR_1US_0;
|
||||||
|
while (TIMERUS_CNTR_1US_0 - old_time <= microseconds) {
|
||||||
|
/* Spin-lock. */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__((noreturn)) void watchdog_reboot(void) {
|
__attribute__((noreturn)) void watchdog_reboot(void) {
|
||||||
volatile watchdog_timers_t *wdt = GET_WDT(4);
|
volatile watchdog_timers_t *wdt = GET_WDT(4);
|
||||||
wdt->PATTERN = WDT_REBOOT_PATTERN;
|
wdt->PATTERN = WDT_REBOOT_PATTERN;
|
||||||
|
|
|
@ -12,6 +12,13 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
void wait(uint32_t microseconds) {
|
||||||
|
uint32_t old_time = TIMERUS_CNTR_1US_0;
|
||||||
|
while (TIMERUS_CNTR_1US_0 - old_time <= microseconds) {
|
||||||
|
/* Spin-lock. */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__((noreturn)) void watchdog_reboot(void) {
|
__attribute__((noreturn)) void watchdog_reboot(void) {
|
||||||
volatile watchdog_timers_t *wdt = GET_WDT(4);
|
volatile watchdog_timers_t *wdt = GET_WDT(4);
|
||||||
wdt->PATTERN = WDT_REBOOT_PATTERN;
|
wdt->PATTERN = WDT_REBOOT_PATTERN;
|
||||||
|
|
Loading…
Reference in a new issue