mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Bootloader: don't touch RTC memory if it doesn't contain a valid command (#619)
This commit is contained in:
parent
3136c61346
commit
cef5abd3cf
@ -1,5 +1,5 @@
|
|||||||
XTENSA_TOOLCHAIN ?= ../../tools/xtensa-lx106-elf/bin/
|
XTENSA_TOOLCHAIN ?= ../../tools/xtensa-lx106-elf/bin/
|
||||||
ESPTOOL ?= ../../tools/esptool
|
ESPTOOL ?= ../../tools/esptool/esptool
|
||||||
|
|
||||||
BIN_DIR := ./
|
BIN_DIR := ./
|
||||||
TARGET_DIR := ./
|
TARGET_DIR := ./
|
||||||
@ -50,4 +50,3 @@ clean:
|
|||||||
|
|
||||||
|
|
||||||
.PHONY: all clean default
|
.PHONY: all clean default
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
|
/* Copyright (c) 2015-2016 Ivan Grokhotkov. All rights reserved.
|
||||||
* This file is part of eboot bootloader.
|
* This file is part of eboot bootloader.
|
||||||
*
|
*
|
||||||
* Redistribution and use is permitted according to the conditions of the
|
* Redistribution and use is permitted according to the conditions of the
|
||||||
@ -115,14 +115,16 @@ void main()
|
|||||||
int res = 9;
|
int res = 9;
|
||||||
struct eboot_command cmd;
|
struct eboot_command cmd;
|
||||||
|
|
||||||
if (eboot_command_read(&cmd)) {
|
if (eboot_command_read(&cmd) == 0) {
|
||||||
|
// valid command was passed via RTC_MEM
|
||||||
|
eboot_command_clear();
|
||||||
|
ets_putc('@');
|
||||||
|
} else {
|
||||||
|
// no valid command found
|
||||||
cmd.action = ACTION_LOAD_APP;
|
cmd.action = ACTION_LOAD_APP;
|
||||||
cmd.args[0] = 0;
|
cmd.args[0] = 0;
|
||||||
ets_putc('~');
|
ets_putc('~');
|
||||||
} else {
|
|
||||||
ets_putc('@');
|
|
||||||
}
|
}
|
||||||
eboot_command_clear();
|
|
||||||
|
|
||||||
if (cmd.action == ACTION_COPY_RAW) {
|
if (cmd.action == ACTION_COPY_RAW) {
|
||||||
ets_putc('c'); ets_putc('p'); ets_putc(':');
|
ets_putc('c'); ets_putc('p'); ets_putc(':');
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user