File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,18 @@ Arduino_Portenta_OTA::~Arduino_Portenta_OTA()
5050 * PUBLIC MEMBER FUNCTIONS
5151 ******************************************************************************/
5252
53+ bool Arduino_Portenta_OTA::isOtaCapable ()
54+ {
55+ #define BOOTLOADER_ADDR (0x8000000 )
56+ uint32_t bootloader_data_offset = 0x1F000 ;
57+ uint8_t * bootloader_data = (uint8_t *)(BOOTLOADER_ADDR + bootloader_data_offset);
58+ uint8_t currentBootloaderVersion = bootloader_data[1 ];
59+ if (currentBootloaderVersion < 22 )
60+ return false ;
61+ else
62+ return true ;
63+ }
64+
5365Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::begin ()
5466{
5567 Serial1.begin (115200 );
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ class Arduino_Portenta_OTA
7979 virtual ~Arduino_Portenta_OTA ();
8080
8181
82+ bool isOtaCapable ();
8283 Error begin ();
8384 Error update ();
8485 void reset ();
You can’t perform that action at this time.
0 commit comments