Add bootloader extension

This commit is contained in:
Thomas Stoddard
2026-10-21 19:22:50 -04:00
committed by Kyle Schwarz
parent 4db27aa187
commit 6ac041cadc
61 changed files with 13816 additions and 68 deletions
@@ -0,0 +1,48 @@
#ifndef __BOOTLOADER_BYTESVIEW_H_
#define __BOOTLOADER_BYTESVIEW_H_
#ifdef __cplusplus
#include <cstdint>
#include <cstddef>
namespace icsneo {
namespace Bootloader {
class BytesView {
private:
const uint8_t* ptr = nullptr;
size_t length = 0;
public:
BytesView() = default;
BytesView(const uint8_t* buf, size_t size) : ptr(buf), length(size) {}
const uint8_t* begin() const {
return ptr;
}
const uint8_t* end() const {
return ptr + length;
}
const uint8_t* data() const {
return ptr;
}
size_t size() const {
return length;
}
const uint8_t& operator[](size_t index) const {
return ptr[index];
}
};
} // namespace Bootloader
} // namespace icsneo
#endif // __cplusplus
#endif // __BOOTLOADER_BYTESVIEW_H_