Skip to content

Commit 5d86c0c

Browse files
committed
Use Arduino_DebugUtils to print errors
1 parent a8fee68 commit 5d86c0c

4 files changed

+6
-11
lines changed

src/Arduino_Portenta_OTA.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ bool Arduino_Portenta_OTA::isOtaCapable()
6464

6565
Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::begin()
6666
{
67-
Serial1.begin(115200);
68-
6967
if (!isOtaCapable())
7068
return Error::NoCapableBootloader;
7169

src/Arduino_Portenta_OTA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <MBRBlockDevice.h>
3636
#include <FATFileSystem.h>
3737
#include <LittleFileSystem.h>
38+
#include <Arduino_DebugUtils.h>
3839

3940
/******************************************************************************
4041
* DEFINE

src/Arduino_Portenta_OTA_QSPI.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bool Arduino_Portenta_OTA_QSPI::init()
5252
_bd_raw_qspi = new QSPIFBlockDevice(PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000);
5353
#endif
5454
if (_bd_raw_qspi->init() != QSPIF_BD_ERROR_OK) {
55-
Serial1.println("Error: QSPI init failure.");
55+
Debug.print(DBG_ERROR, F("Error: QSPI init failure."));
5656
return false;
5757
}
5858

@@ -62,8 +62,7 @@ bool Arduino_Portenta_OTA_QSPI::init()
6262
int const err_mount = _fs_qspi->mount(_bd_raw_qspi);
6363
if (err_mount)
6464
{
65-
Serial1.print("Error while mounting the filesystem. Err = ");
66-
Serial1.println(err_mount);
65+
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err_mount);
6766
return false;
6867
}
6968
return true;
@@ -75,8 +74,7 @@ bool Arduino_Portenta_OTA_QSPI::init()
7574
_fs_qspi = new mbed::FATFileSystem("fs");
7675
int const err_mount = _fs_qspi->mount(_bd_qspi);
7776
if (err_mount) {
78-
Serial1.print("Error while mounting the filesystem. Err = ");
79-
Serial1.println(err_mount);
77+
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err_mount);
8078
return false;
8179
}
8280
return true;

src/Arduino_Portenta_OTA_SD.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ bool Arduino_Portenta_OTA_SD::init()
6161
_fs_sd = new mbed::FATFileSystem("fs");
6262
int const err = _fs_sd->mount(&_block_device);
6363
if (err) {
64-
Serial1.print("Error while mounting the filesystem. Err = ");
65-
Serial1.println(err);
64+
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err);
6665
return false;
6766
}
6867
return true;
@@ -75,8 +74,7 @@ bool Arduino_Portenta_OTA_SD::init()
7574
int const err = _fs_sd->mount(_bd);
7675
if (err)
7776
{
78-
Serial1.print("Error while mounting the filesystem. Err = ");
79-
Serial1.println(err);
77+
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err);
8078
return false;
8179
}
8280
return true;

0 commit comments

Comments
 (0)