REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
flasher.cpp
Go to the documentation of this file.
1//******************************************************************************
2// Flash write/erase functions (TLC/T3x/T4x/TMM), LMEM cache functions for T3.6
3//******************************************************************************
4// WARNING: you can destroy your MCU with flash erase or write!
5// This code may or may not protect you from that.
6//
7// Original by Niels A. Moseley, 2015.
8// Modifications for OTA updates by Jon Zeeff, Deb Hollenback
9// Paul Stoffregen's T4.x flash routines from Teensy4 core added by Jon Zeeff
10// Frank Boesing's T3.x flash routines adapted for OTA by Joe Pasquariello
11// Largely adapted and rewritten for the Anabrid REDAC infrastructure by SvenK
12// This code is released into the public domain.
13//******************************************************************************
14
15#include <proto/main.pb.h>
16#include <Arduino.h> // Serial, etc. (if used)
17#include <iostream>
18#include <ota/flasher.h>
19
20loader::FirmwareBuffer::FirmwareBuffer() {}
21
22loader::FirmwareBuffer::~FirmwareBuffer() {}
23
24UnitResult loader::Updater::begin(const pb_UpdateBegin &flash_begin, pb_UpdateResponse &res) {
25 std::cout << "Updater::begin" << std::endl;
26 res.which_kind = pb_UpdateResponse_ack_tag;
27 res.kind.ack.chunk_size = 1024;
28 return UnitResult::ok();
29}
30
31bool loader::Updater::write(const pb_UpdateWrite &flash_write, pb_UpdateResponse &res) {
32 std::cout << "Updater::write" << std::endl;
33 return UnitResult::ok();
34}
35
36void loader::Updater::status(JsonObject &msg_out) {
37 std::cout << "Updater::status" << std::endl;
38}
39
40UnitResult loader::Updater::abort(const pb_UpdateAbort& flash_abort, pb_UpdateResponse &res) {
41 std::cout << "Updater::abort" << std::endl;
42 return UnitResult::ok();
43}
44
45UnitResult loader::Updater::commit(const pb_UpdateCommit &flash_end, pb_UpdateResponse &res) {
46 std::cout << "Updater::commit" << std::endl;
47 return UnitResult::ok();
48}
void flash_write(void *addr, const void *data, uint32_t len)
Definition eeprom.cpp:99