Files
Upsilon/bootloader/trampoline.cpp
2022-03-17 20:05:20 +01:00

43 lines
1006 B
C++

#include <string.h>
#include <ion/src/device/shared/drivers/external_flash.h>
#include <ion/src/device/n0110/drivers/power.h>
#include <bootloader/trampoline.h>
#include <bootloader/boot.h>
namespace Bootloader {
void __attribute__((noinline)) suspend() {
Ion::Device::Power::internalFlashSuspend(true);
}
void* Trampolines[TRAMPOLINES_COUNT]
__attribute__((section(".trampolines_table")))
__attribute__((used))
= {
(void*) Bootloader::suspend, // Suspend
(void*) Ion::Device::ExternalFlash::EraseSector, // External erase
(void*) Ion::Device::ExternalFlash::WriteMemory, // External write
(void*) memcmp,
(void*) memcpy,
(void*) memmove,
(void*) memset,
(void*) strchr,
(void*) strcmp,
(void*) strlcat,
(void*) strlcpy,
(void*) strlen,
(void*) strncmp
};
void* CustomTrampolines[CUSTOM_TRAMPOLINES_COUNT]
__attribute__((section(".custom_trampolines_table")))
__attribute__((used))
= {
(void*) Bootloader::Boot::mode,
(void*) Bootloader::Boot::setMode
};
}