Skip to content

Commit

Permalink
Merge pull request #1 from itzandroidtab/multispan
Browse files Browse the repository at this point in the history
updated bootloader to different pin + updates from klib
  • Loading branch information
itzandroidtab authored Jan 23, 2024
2 parents f483097 + 2ab574f commit cfeb648
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class dfu {
* @return true
* @return false
*/
static bool write(uint32_t offset, uint8_t* data, uint32_t length) {
static bool write(const uint32_t offset, const uint8_t* data, const uint32_t length) {
// get the address we are trying to write
const uint32_t address = app_vector_address + offset;

Expand All @@ -48,7 +48,7 @@ class dfu {
}

// write the data to the flash (always write the full dfu buffer size)
return target::io::flash::write(address, data, transfer_size);
return target::io::flash::write(address, std::span<const uint8_t>{data, transfer_size});
}

/**
Expand Down Expand Up @@ -85,7 +85,7 @@ using usb_bulk = target::io::usb<target::io::periph::lqfp_80::usb0, klib::usb::d
*/
static __attribute__((__noreturn__, __naked__)) void start_application() {
// helper using for moving the vector table
using irq = klib::irq_flash<16>;
using irq = klib::irq_flash<0, 16>;

// move the vector table to the vector table
// of the user
Expand All @@ -100,7 +100,7 @@ static __attribute__((__noreturn__, __naked__)) void start_application() {

int main() {
// get the bootloader pin
using bootloader_pin = target::io::pin_in<target::pins::package::lqfp_80::p40>;
using bootloader_pin = target::io::pin_in<target::pins::package::lqfp_80::p39>;

// init it as a pin in
bootloader_pin::init();
Expand Down

0 comments on commit cfeb648

Please sign in to comment.