Skip to content

Redirect error prints to Serial #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ jobs:
- fqbn: arduino:mbed:envie_m7
platforms: |
- name: arduino:mbed
libraries: |
- name: Arduino_DebugUtils
sketch-paths: |
- examples/OTA_Qspi_Flash
- examples/OTA_SD_Portenta
- examples/OTA_Usage_Portenta
- fqbn: arduino:mbed_nicla:nicla_vision
platforms: |
- name: arduino:mbed_nicla
libraries: |
- name: Arduino_DebugUtils
sketch-paths: |
- examples/OTA_Qspi_Flash
- examples/OTA_Usage_Portenta
Expand All @@ -59,8 +63,7 @@ jobs:
libraries: |
# Install the library from the local path.
- source-path: ./
# Additional library dependencies can be listed here.
# See: https://github.com/arduino/compile-sketches#libraries
${{ matrix.board.libraries }}
sketch-paths: |
${{ matrix.board.sketch-paths }}
enable-deltas-report: true
Expand Down
2 changes: 0 additions & 2 deletions src/Arduino_Portenta_OTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ bool Arduino_Portenta_OTA::isOtaCapable()

Arduino_Portenta_OTA::Error Arduino_Portenta_OTA::begin()
{
Serial1.begin(115200);

if (!isOtaCapable())
return Error::NoCapableBootloader;

Expand Down
1 change: 1 addition & 0 deletions src/Arduino_Portenta_OTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <MBRBlockDevice.h>
#include <FATFileSystem.h>
#include <LittleFileSystem.h>
#include <Arduino_DebugUtils.h>

/******************************************************************************
* DEFINE
Expand Down
8 changes: 3 additions & 5 deletions src/Arduino_Portenta_OTA_QSPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bool Arduino_Portenta_OTA_QSPI::init()
_bd_raw_qspi = new QSPIFBlockDevice(PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000);
#endif
if (_bd_raw_qspi->init() != QSPIF_BD_ERROR_OK) {
Serial1.println("Error: QSPI init failure.");
Debug.print(DBG_ERROR, F("Error: QSPI init failure."));
return false;
}

Expand All @@ -62,8 +62,7 @@ bool Arduino_Portenta_OTA_QSPI::init()
int const err_mount = _fs_qspi->mount(_bd_raw_qspi);
if (err_mount)
{
Serial1.print("Error while mounting the filesystem. Err = ");
Serial1.println(err_mount);
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err_mount);
return false;
}
return true;
Expand All @@ -75,8 +74,7 @@ bool Arduino_Portenta_OTA_QSPI::init()
_fs_qspi = new mbed::FATFileSystem("fs");
int const err_mount = _fs_qspi->mount(_bd_qspi);
if (err_mount) {
Serial1.print("Error while mounting the filesystem. Err = ");
Serial1.println(err_mount);
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err_mount);
return false;
}
return true;
Expand Down
6 changes: 2 additions & 4 deletions src/Arduino_Portenta_OTA_SD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ bool Arduino_Portenta_OTA_SD::init()
_fs_sd = new mbed::FATFileSystem("fs");
int const err = _fs_sd->mount(&_block_device);
if (err) {
Serial1.print("Error while mounting the filesystem. Err = ");
Serial1.println(err);
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err);
return false;
}
return true;
Expand All @@ -75,8 +74,7 @@ bool Arduino_Portenta_OTA_SD::init()
int const err = _fs_sd->mount(_bd);
if (err)
{
Serial1.print("Error while mounting the filesystem. Err = ");
Serial1.println(err);
Debug.print(DBG_ERROR, F("Error while mounting the filesystem. Err = %d"), err);
return false;
}
return true;
Expand Down