Skip to content

Commit ece1346

Browse files
fixed compilation warnings c33
1 parent 5c42821 commit ece1346

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

examples/PortentaH7Logger/PortentaH7Logger.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ constexpr auto baudrate { 115200 };
2727

2828
#if defined(ARDUINO_PORTENTA_H7_M7)
2929
#define USB_MOUNTED_LED LED_BLUE
30-
#elif defined(ARDUINO_PORTENTA_C33)
31-
#endif
30+
3231

3332

3433
InternalStorage internalStorage = InternalStorage();
@@ -179,3 +178,4 @@ void loop() {
179178
runPeriodically(moveDataToQSPI, 1000, &lastMove);
180179
runPeriodically(backupToUSB, 10000, &lastBackup);
181180
}
181+
#endif

src/InternalStorage.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bool InternalStorage::begin(){
3232
this -> userDataFileSystem = new LittleFileSystem(this->partitionName);
3333
}
3434
int err = this -> userDataFileSystem -> mount(userData);
35-
if(err == 0) return 1;
35+
return err == 0 ? true : false;
3636
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
3737
this -> blockDevice = QSPIFBlockDevice::get_default_instance();
3838
this -> userData = new mbed::MBRBlockDevice(this->blockDevice, this->partitionNumber);
@@ -95,6 +95,8 @@ bool InternalStorage::format(FileSystems fs){
9595
return this -> userDataFileSystem -> reformat(this-> userData) == 0 ? true : false;
9696
#endif
9797
}
98+
99+
return false;
98100
}
99101

100102
#if defined(ARDUINO_PORTENTA_C33)

src/Types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <iostream>
1010
#include <vector>
1111

12-
static bool copyFolder(const char* source, const char* destination) {
12+
[[gnu::unused]] static bool copyFolder(const char* source, const char* destination) {
1313
DIR* dir = opendir(source);
1414
if (dir == nullptr) {
1515
printf("Failed to open source directory\n");
@@ -75,7 +75,7 @@ static bool copyFolder(const char* source, const char* destination) {
7575
return true;
7676
}
7777

78-
static std::string replaceLastPathComponent(const std::string& path, const std::string& newComponent) {
78+
[[gnu::unused]] static std::string replaceLastPathComponent(const std::string& path, const std::string& newComponent) {
7979
size_t lastSlashIndex = path.find_last_of('/');
8080
if (lastSlashIndex != std::string::npos) {
8181
std::string newPath = path.substr(0, lastSlashIndex + 1) + newComponent;
@@ -85,7 +85,7 @@ static std::string replaceLastPathComponent(const std::string& path, const std::
8585
}
8686

8787
// Helper function to get the last path component
88-
static std::string getLastPathComponent(const std::string& path) {
88+
[[gnu::unused]] static std::string getLastPathComponent(const std::string& path) {
8989
size_t lastSlashIndex = path.find_last_of('/');
9090
if (lastSlashIndex != std::string::npos) {
9191
return path.substr(lastSlashIndex + 1);
@@ -94,7 +94,7 @@ static std::string getLastPathComponent(const std::string& path) {
9494
}
9595

9696
// Helper function to replace the first path component with a new component
97-
static std::string replaceFirstPathComponent(const std::string& path, const std::string& destinationPath) {
97+
[[gnu::unused]] static std::string replaceFirstPathComponent(const std::string& path, const std::string& destinationPath) {
9898
std::string fileName = getLastPathComponent(path);
9999
std::string newPath = destinationPath + "/" + fileName;
100100
return newPath;

0 commit comments

Comments
 (0)