Wolfvak e4dd8511cd make interrupt handlers more lazy, most processing is done in interruptible context now
- completely moved MCU interrupt handling outside of the critical section
- refactored a bit of the PXI code and command names
- merge the I2C read and write cmds to be one
- remove SET_VMODE cmd, now it's always initialized to BGR565 on boot and to RGB565 on firmlaunch
- atomic-ize more stuff
2020-08-25 10:49:52 -03:00

38 lines
737 B
C

#include "godmode.h"
#include "power.h"
#include "pxi.h"
#include "arm.h"
#include "shmem.h"
#include "hid.h"
SystemSHMEM *shmemBasePtr;
void main(int argc, char** argv, int entrypoint)
{
(void) argc;
(void) argv;
PXI_Reset();
// Don't even try to send any messages until the
// ARM11 says it's ready
PXI_Barrier(ARM11_READY_BARRIER);
// A pointer to the shared memory region is
// stored in the thread ID register in the ARM9
ARM_InitSHMEM();
#ifdef SCRIPT_RUNNER
// Run the script runner
if (ScriptRunner(entrypoint) == GODMODE_EXIT_REBOOT)
#else
// Run the main program
if (GodMode(entrypoint) == GODMODE_EXIT_REBOOT)
#endif
Reboot();
PowerOff();
}