From 390eb97c2e750be2c3bbad6b959d0dbf86f3470c Mon Sep 17 00:00:00 2001
From: Davide Mor <davide.mor@skywarder.eu>
Date: Thu, 14 Mar 2024 09:38:25 +0100
Subject: [PATCH] [CI] Fixed pipeline

---
 .../interfaces-impl/hwmapping.h               |  5 ---
 .../interfaces-impl/hwmapping.h               | 45 -------------------
 src/entrypoints/compute-unit-v2-testsuite.cpp | 14 ++++--
 3 files changed, 10 insertions(+), 54 deletions(-)

diff --git a/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h b/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h
index 36935b6af..9db2610b4 100644
--- a/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h
+++ b/src/bsps/stm32f429zi_con_rig/interfaces-impl/hwmapping.h
@@ -56,11 +56,6 @@ using arm      = Gpio<GPIOE_BASE, 2>;
 
 namespace radio
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi1;
-}
-
 using cs   = Gpio<GPIOF_BASE, 6>;
 using dio0 = Gpio<GPIOB_BASE, 1>;
 using dio1 = Gpio<GPIOD_BASE, 12>;
diff --git a/src/bsps/stm32f767zi_rig_v2/interfaces-impl/hwmapping.h b/src/bsps/stm32f767zi_rig_v2/interfaces-impl/hwmapping.h
index 2289f7c44..eec700e5e 100644
--- a/src/bsps/stm32f767zi_rig_v2/interfaces-impl/hwmapping.h
+++ b/src/bsps/stm32f767zi_rig_v2/interfaces-impl/hwmapping.h
@@ -161,84 +161,44 @@ namespace sensors
 // Flavio, why?
 namespace H3LIS
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi4;
-}
-
 using cs = Gpio<GPIOB_BASE, 2>;
 }  // namespace H3LIS
 
 // Flavio, why?
 namespace LPS22
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi4;
-}
-
 using cs = Gpio<GPIOB_BASE, 11>;
 }  // namespace LPS22
 
 // Flavio, why?
 namespace LSM6
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi4;
-}
-
 using cs = Gpio<GPIOD_BASE, 13>;
 }  // namespace LSM6
 
 // Flavio, why?
 namespace LIS2MDL
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi4;
-}
-
 using cs = Gpio<GPIOA_BASE, 4>;
 }  // namespace LIS2MDL
 
 namespace ADS131_1
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi1;
-}
-
 using cs = Gpio<GPIOC_BASE, 5>;
 }  // namespace ADS131_1
 
 namespace ADS131_2
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi3;
-}
-
 using cs = Gpio<GPIOD_BASE, 4>;
 }  // namespace ADS131_2
 
 namespace MAX31856_1
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi3;
-}
-
 using cs = Gpio<GPIOG_BASE, 10>;
 }  // namespace MAX31856_1
 
 namespace MAX31856_2
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi1;
-}
-
 using cs = Gpio<GPIOD_BASE, 7>;
 }  // namespace MAX31856_2
 
@@ -246,11 +206,6 @@ using cs = Gpio<GPIOD_BASE, 7>;
 
 namespace radio
 {
-namespace spi
-{
-using namespace miosix::interfaces::spi6;
-}
-
 using cs   = Gpio<GPIOB_BASE, 7>;
 using txEn = Gpio<GPIOG_BASE, 11>;
 using rxEn = Gpio<GPIOD_BASE, 5>;
diff --git a/src/entrypoints/compute-unit-v2-testsuite.cpp b/src/entrypoints/compute-unit-v2-testsuite.cpp
index 424240b46..6e2a57b54 100644
--- a/src/entrypoints/compute-unit-v2-testsuite.cpp
+++ b/src/entrypoints/compute-unit-v2-testsuite.cpp
@@ -286,7 +286,7 @@ void sd_test()
             size_t result = fwrite(&value, sizeof(value), 1, f);
             if (result != 1)
             {
-                printf("Failed to write word %d\n", i);
+                printf("Failed to write word %zu\n", i);
 
                 // We had a problem
                 ok = false;
@@ -296,7 +296,10 @@ void sd_test()
             // Update value with xorshift
             value = (value << 8) ^ (value >> 8);
         }
+    }
 
+    if (f != NULL)
+    {
         fclose(f);
     }
 
@@ -320,7 +323,7 @@ void sd_test()
             size_t result   = fread(&actual, sizeof(actual), 1, f);
             if (result != 1)
             {
-                printf("Failed to write word %d\n", i);
+                printf("Failed to write word %zu\n", i);
                 ok = false;
                 break;
             }
@@ -328,7 +331,7 @@ void sd_test()
             if (actual != value)
             {
                 printf(
-                    "Failed to validate word %d, expected: %lu, actual: %lu\n",
+                    "Failed to validate word %zu, expected: %u, actual: %u\n",
                     i, value, actual);
                 ok = false;
                 break;
@@ -337,7 +340,10 @@ void sd_test()
             // Update value with xorshift
             value = (value << 8) ^ (value >> 8);
         }
+    }
 
+    if (f != NULL)
+    {
         fclose(f);
     }
 
@@ -516,7 +522,7 @@ void pin_semi_test()
 
     for (size_t i = 0; i < PIN_DEFS.size(); i++)
     {
-        auto &a = PIN_DEFS[i];
+        PinDef &a = PIN_DEFS[i];
 
         // Pause waiting for keys
         while (getchar() != '\n')
-- 
GitLab