raburton / rboot

An open source bootloader for the ESP8266
https://richard.burtons.org/tag/rboot/?order=ASC
MIT License
301 stars 72 forks source link

New GPIO mode features (pin selection, erase SDK config on GPIO boot) #13

Closed projectgus closed 8 years ago

projectgus commented 8 years ago

Hi Richard,

These are two additional GPIO mode features I added and found useful. Please let me know what you think.

Angus

raburton commented 8 years ago

Looks good. I'm without internet access at home till Monday so can't easily play and test things out for a few days, but I do plan to accept the PR as soon as I get the chance to have a go with it. I did always want make it easier for people to use other GPIOs (I only did 16 because I have nodemcu devboards with a button), but never got chance and no one asked for it so far, so your effort is appreciated.

raburton commented 8 years ago

Would you mind trying out the gpio branch, I've merged in your changes with a few tweaks (nothing serious, but be nice to make sure it all still works as expected for you).

projectgus commented 8 years ago

Thanks for cleaning the patch up. Looks good to me, and works fine. There's two small changes I'd suggest:

diff --git a/rboot.c b/rboot.c
index b52c420..0e95db5 100644
--- a/rboot.c
+++ b/rboot.c
@@ -341,7 +341,7 @@ uint32 NOINLINE find_image(void) {
        ets_printf("rBoot Option: Config chksum\r\n");
 #endif
 #ifdef BOOT_GPIO_ENABLED
-       ets_printf("rBoot Option: GPIO mode\r\n");
+       ets_printf("rBoot Option: GPIO mode (%d)\r\n", BOOT_GPIO_NUM);
 #endif
 #ifdef BOOT_RTC_ENABLED
        ets_printf("rBoot Option: RTC data\r\n");
diff --git a/rboot.h b/rboot.h
index 6588635..3981c37 100644
--- a/rboot.h
+++ b/rboot.h
@@ -27,7 +27,7 @@ extern "C" {
 //#define BOOT_RTC_ENABLED

 // uncomment to enable GPIO booting
-#define BOOT_GPIO_ENABLED
+//#define BOOT_GPIO_ENABLED

 // set the GPIO number used by MODE_GPIO_ROM (will
 // default to 16 if not manually set), only applicable
raburton commented 8 years ago

Oops, left that define enabled from my testing. Fixed, and added the gpio number to the message as requested. All pushed up to master. Thanks for this.