fixed warning (#2297)

This commit is contained in:
Bernd Herzog 2024-10-14 17:03:24 +02:00 committed by GitHub
parent fcc52e83de
commit 023cee2c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View File

@ -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");
}

View File

@ -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<standalone_application_information_t*>(_app_image);
return reinterpret_cast<standalone_application_information_t*>(&_app_image);
}
MessageHandlerRegistration message_handler_sample{

View File

@ -69,7 +69,7 @@ std::vector<uint8_t> 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<uint8_t> ret(transfer_block_size);
bool success = i2c_read((uint8_t*)&data, sizeof(data), (uint8_t*)ret.data(), transfer_block_size);