From 8c3378a72399b1e11fa1cb138e6be03aee5bf1a8 Mon Sep 17 00:00:00 2001 From: Maxime FRIESS Date: Wed, 16 Mar 2022 00:06:24 +0100 Subject: [PATCH] [ion/bootloader] Fixed wrong trampoline call. --- ion/src/device/bootloader/drivers/external_flash_tramp.cpp | 4 ++-- ion/src/device/bootloader/drivers/power.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ion/src/device/bootloader/drivers/external_flash_tramp.cpp b/ion/src/device/bootloader/drivers/external_flash_tramp.cpp index 29a2bf03e..2116c5034 100644 --- a/ion/src/device/bootloader/drivers/external_flash_tramp.cpp +++ b/ion/src/device/bootloader/drivers/external_flash_tramp.cpp @@ -371,13 +371,13 @@ void MassErase() { void WriteMemory(uint8_t * destination, const uint8_t * source, size_t length) { asm("cpsid if"); - reinterpret_cast(Ion::Device::Trampoline::address(Ion::Device::Trampoline::ExternalFlashWriteMemory))(destination, source, length); + (*reinterpret_cast(Ion::Device::Trampoline::address(Ion::Device::Trampoline::ExternalFlashWriteMemory)))(destination, source, length); asm("cpsie if"); } void EraseSector(int i) { asm("cpsid if"); - reinterpret_cast(Ion::Device::Trampoline::address(Ion::Device::Trampoline::ExternalFlashEraseSector))(i); + (*reinterpret_cast(Ion::Device::Trampoline::address(Ion::Device::Trampoline::ExternalFlashEraseSector)))(i); asm("cpsie if"); } diff --git a/ion/src/device/bootloader/drivers/power.cpp b/ion/src/device/bootloader/drivers/power.cpp index f38f9e978..5680bb30f 100644 --- a/ion/src/device/bootloader/drivers/power.cpp +++ b/ion/src/device/bootloader/drivers/power.cpp @@ -79,7 +79,7 @@ void __attribute__((noinline)) internalFlashStandby() { } void enterLowPowerMode() { - reinterpret_cast(Ion::Device::Trampoline::address(Ion::Device::Trampoline::Suspend))(); + (*reinterpret_cast(Ion::Device::Trampoline::address(Ion::Device::Trampoline::Suspend)))(); } }