diff --git a/firmware/application/apps/ui_standalone_view.cpp b/firmware/application/apps/ui_standalone_view.cpp index f1413601..d099e16c 100644 --- a/firmware/application/apps/ui_standalone_view.cpp +++ b/firmware/application/apps/ui_standalone_view.cpp @@ -124,8 +124,9 @@ standalone_application_api_t api = { }; StandaloneView::StandaloneView(NavigationView& nav, uint8_t* app_image) - : nav_(nav), _app_image(app_image) { - if (_app_image == nullptr) { + : nav_(nav), + _app_image(*app_image) { + if (app_image == nullptr) { chDbgPanic("Invalid application image"); } diff --git a/firmware/application/apps/ui_standalone_view.hpp b/firmware/application/apps/ui_standalone_view.hpp index 97bda0d1..f5a8a78b 100644 --- a/firmware/application/apps/ui_standalone_view.hpp +++ b/firmware/application/apps/ui_standalone_view.hpp @@ -54,9 +54,9 @@ class StandaloneView : public View { private: bool initialized = false; NavigationView& nav_; - uint8_t* _app_image; + uint8_t& _app_image; standalone_application_information_t* get_application_information() const { - return reinterpret_cast(_app_image); + return reinterpret_cast(&_app_image); } MessageHandlerRegistration message_handler_sample{ diff --git a/firmware/common/i2cdev_ppmod.cpp b/firmware/common/i2cdev_ppmod.cpp index c0739df5..fb39f1b3 100644 --- a/firmware/common/i2cdev_ppmod.cpp +++ b/firmware/common/i2cdev_ppmod.cpp @@ -69,7 +69,7 @@ std::vector I2cDev_PPmod::downloadStandaloneApp(uint32_t index, size_t return {}; } - uint16_t data[3] = {(uint16_t)Command::COMMAND_APP_TRANSFER, index, offset / transfer_block_size}; + uint16_t data[3] = {(uint16_t)Command::COMMAND_APP_TRANSFER, (uint16_t)index, (uint16_t)(offset / transfer_block_size)}; std::vector ret(transfer_block_size); bool success = i2c_read((uint8_t*)&data, sizeof(data), (uint8_t*)ret.data(), transfer_block_size);