有api可得知是否使用了2nd boot否?
-
- Posts: 41
- Joined: Tue May 05, 2015 4:48 pm
- Contact:
有api可得知是否使用了2nd boot否?
Postby alexsunmiu » Fri Jun 05, 2015 11:40 pm
如题,system_get_boot_mode和boot ver都不是做这个的,有些场景下,我们的确需要知道当前模块是否使用了2nd boot,譬如ota时,若未使用2nd boot,则拒绝 升级之类的。
another ESP8266 cloud service. https://espush.cn/
Re: 有api可得知是否使用了2nd boot否?
Postby alexchang » Sun Jun 07, 2015 6:45 pm
我也有這個問題,我後來是在編譯 USER1 的時候傳入 -DBIN_USER1,編譯 USER2 的時候傳入 -DBIN_USER2,這樣在程式裡面就可以知道自己是 USER1 還是 USER2 了:
#ifdef BIN_USER1
#endif
#ifdef BIN_USER2
#endif
傳入 -DBIN_USER1 或 -DBIN_USER2 這個寫在 Makefile 就可以了。
#ifdef BIN_USER1
#endif
#ifdef BIN_USER2
#endif
傳入 -DBIN_USER1 或 -DBIN_USER2 這個寫在 Makefile 就可以了。
-
- Posts: 41
- Joined: Tue May 05, 2015 4:48 pm
- Contact:
Re: 有api可得知是否使用了2nd boot否?
Postby alexsunmiu » Sun Jun 07, 2015 10:27 pm
alexchang wrote:我也有這個問題,我後來是在編譯 USER1 的時候傳入 -DBIN_USER1,編譯 USER2 的時候傳入 -DBIN_USER2,這樣在程式裡面就可以知道自己是 USER1 還是 USER2 了:
#ifdef BIN_USER1
#endif
#ifdef BIN_USER2
#endif
傳入 -DBIN_USER1 或 -DBIN_USER2 這個寫在 Makefile 就可以了。
好主意,thx。
another ESP8266 cloud service. https://espush.cn/
Who is online
Users browsing this forum: No registered users and 117 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.