File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,14 @@ bool Arduino_Portenta_OTA::isOtaCapable()
6565Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::begin ()
6666{
6767 Serial1.begin (115200 );
68- return (init () == false ) ? Error::OtaStorageInit : Error::None;
68+
69+ if (!isOtaCapable ())
70+ return Error::NoCapableBootloader;
71+
72+ if (!init ())
73+ return Error::OtaStorageInit;
74+
75+ return Error::None;
6976}
7077
7178Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::update ()
Original file line number Diff line number Diff line change @@ -67,12 +67,13 @@ class Arduino_Portenta_OTA
6767 enum class Error : int
6868 {
6969 None = 0 ,
70- NoOtaStorage = -1 ,
71- OtaStorageInit = -2 ,
72- OtaStorageOpen = -3 ,
73- OtaHeaderLength = -4 ,
74- OtaHeaderCrc = -5 ,
75- OtaHeaterMagicNumber = -6 ,
70+ NoCapableBootloader = -1 ,
71+ NoOtaStorage = -2 ,
72+ OtaStorageInit = -3 ,
73+ OtaStorageOpen = -4 ,
74+ OtaHeaderLength = -5 ,
75+ OtaHeaderCrc = -6 ,
76+ OtaHeaterMagicNumber = -7 ,
7677 };
7778
7879 Arduino_Portenta_OTA (StorageTypePortenta const storage_type, uint32_t const data_offset);
You can’t perform that action at this time.
0 commit comments