The use of the ESP8266 in the world of IoT

User avatar
By eriksl
#38038 Please apply this patch. Otherwise my compiler will warn (and thus stop: -Werror). It's indeed wrong, function() in C means "arguments not specified", not "no arguments", use function(void) for that.

Code: Select alldiff --git a/appcode/rboot-api.c b/appcode/rboot-api.c
index 6cf15ca..b93f065 100644
--- a/appcode/rboot-api.c
+++ b/appcode/rboot-api.c
@@ -22,7 +22,7 @@ extern "C" {
 #endif
 
 // get the rboot config
-rboot_config ICACHE_FLASH_ATTR rboot_get_config() {
+rboot_config ICACHE_FLASH_ATTR rboot_get_config(void) {
    rboot_config conf;
    spi_flash_read(BOOT_CONFIG_SECTOR * SECTOR_SIZE, (uint32*)&conf, sizeof(rboot_config));
    return conf;
@@ -63,7 +63,7 @@ bool ICACHE_FLASH_ATTR rboot_set_config(rboot_config *conf) {
 }
 
 // get current boot rom
-uint8 ICACHE_FLASH_ATTR rboot_get_current_rom() {
+uint8 ICACHE_FLASH_ATTR rboot_get_current_rom(void) {
    rboot_config conf;
    conf = rboot_get_config();
    return conf.current_rom;
diff --git a/appcode/rboot-api.h b/appcode/rboot-api.h
index abfcc60..515437f 100644
--- a/appcode/rboot-api.h
+++ b/appcode/rboot-api.h
@@ -24,9 +24,9 @@ typedef struct {
    uint8 extra_bytes[4];
 } rboot_write_status;
 
-rboot_config ICACHE_FLASH_ATTR rboot_get_config();
+rboot_config ICACHE_FLASH_ATTR rboot_get_config(void);
 bool ICACHE_FLASH_ATTR rboot_set_config(rboot_config *conf);
-uint8 ICACHE_FLASH_ATTR rboot_get_current_rom();
+uint8 ICACHE_FLASH_ATTR rboot_get_current_rom(void);
 bool ICACHE_FLASH_ATTR rboot_set_current_rom(uint8 rom);
 rboot_write_status ICACHE_FLASH_ATTR rboot_write_init(uint32 start_addr);
 bool ICACHE_FLASH_ATTR rboot_write_flash(rboot_write_status *status, uint8 *data, uint16 len);
User avatar
By ftheirs
#50174 First of all I'd like to thanks Richard for sharing this code :)

I'm a truly newbie with the compile and linking things. I usually program the C-code and the IDE do all the dirty things for me. Also, I'm a windows user and don't know how to carry out some steps.

I read all your post (or I think so) and I understand the idea and how it should work. My problem is now that I can't compile the things so.. is there a step by step tutorial but for windows users? I'm currently using platformio to write my code and I'd like to reuse your rBoot instead of create some rudimentary OtA upgrade code. I have also problems with the arduino OtA example... I'm really lost :/