projects
/
gps-watch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
application: Only reset the model when starting a new recording.
[gps-watch.git]
/
src
/
bootloader
/
bootloader.rs
diff --git
a/src/bootloader/bootloader.rs
b/src/bootloader/bootloader.rs
index 311b1a60e6a2ed491474eecf0d986c10d58d54a3..d4a686b5ea83a290f16f4518f251c71a5f3fc03f 100644
(file)
--- a/
src/bootloader/bootloader.rs
+++ b/
src/bootloader/bootloader.rs
@@
-46,6
+46,7
@@
enum Error {
UnknownCommand = 1,
InvalidArgument,
ChecksumMismatch,
UnknownCommand = 1,
InvalidArgument,
ChecksumMismatch,
+ PermissionDenied,
}
extern {
}
extern {
@@
-191,6
+192,11
@@
impl Bootloader {
if sector > 0xff {
Err(Error::InvalidArgument)
if sector > 0xff {
Err(Error::InvalidArgument)
+ } else if sector == 0x01 {
+ // The second sector contains the flash configuration field,
+ // and keeping it in the erased state has the potential
+ // to brick the device.
+ Err(Error::PermissionDenied)
} else {
flash::erase(sector);
} else {
flash::erase(sector);