implement full fwupdate stack

This commit is contained in:
2024-02-06 01:52:44 +01:00
parent 74dcdfd19b
commit ff6fcb75f0
4 changed files with 205 additions and 10 deletions

View File

@@ -6,6 +6,7 @@
#include <pb_encode.h>
#include "UsbDataHandler.h"
#include "crc.h"
#include "FirmwareUpdate.h"
// static memory only for decoding messages
static FirmwareStart msg_FirmwareStart;
@@ -123,14 +124,10 @@ void DataClbk_FirmwareDone(void *msg, uint32_t length) {
fresult_open = 0xFF;
FileOpen=false;
FirmwareUpdateArgs args;
args.device = msg_FirmwareDone.device_id;
memcpy(args.name, msg_FirmwareStart.name, sizeof(args.name));
// Spawn Task to Send this File over CAN
// this task should
// 1. send can message to send device with matching device id into bootloader mode
// - open the fw file on the SD card.
// 2. wait for the device to get ready.
// - send data 4x data
// - wait for ack
// 3 onec we are at the EOF
// - send done
FirmwareUpdateTask_start(args);
}