From e5ecf1affc7c9ecb0707f1a80ff990514843ee38 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Wed, 22 Jan 2025 23:05:03 -0300 Subject: [PATCH] Fixing type issues --- lib/LinkCableMultiboot.hpp | 2 +- lib/LinkGPIO.hpp | 2 +- lib/LinkWirelessMultiboot.hpp | 6 +++--- lib/LinkWirelessOpenSDK.hpp | 2 +- lib/c_bindings/C_LinkCableMultiboot.h | 2 +- lib/c_bindings/C_LinkWirelessMultiboot.h | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/LinkCableMultiboot.hpp b/lib/LinkCableMultiboot.hpp index 59315a6..1a7928a 100644 --- a/lib/LinkCableMultiboot.hpp +++ b/lib/LinkCableMultiboot.hpp @@ -560,7 +560,7 @@ class LinkCableMultiboot { /** * @brief Returns the completion percentage. */ - [[nodiscard]] u32 getPercentage() { + [[nodiscard]] u8 getPercentage() { if (state == STOPPED || fixedData.size == 0) return 0; diff --git a/lib/LinkGPIO.hpp b/lib/LinkGPIO.hpp index 1b8d68d..8fdfcd4 100644 --- a/lib/LinkGPIO.hpp +++ b/lib/LinkGPIO.hpp @@ -40,7 +40,7 @@ class LinkGPIO { using u32 = Link::u32; using u16 = Link::u16; using u8 = Link::u8; - using vu16 = Link::u16; + using vu16 = Link::vu16; static constexpr int RCNT_GENERAL_PURPOSE = 1 << 15; static constexpr int SIOCNT_GENERAL_PURPOSE = 0; diff --git a/lib/LinkWirelessMultiboot.hpp b/lib/LinkWirelessMultiboot.hpp index be7affd..ae7db81 100644 --- a/lib/LinkWirelessMultiboot.hpp +++ b/lib/LinkWirelessMultiboot.hpp @@ -124,8 +124,8 @@ class LinkWirelessMultiboot { struct MultibootProgress { State state = STOPPED; - u32 connectedClients = 0; - u32 percentage = 0; + u8 connectedClients = 0; + u8 percentage = 0; volatile bool* ready = nullptr; }; @@ -423,7 +423,7 @@ class LinkWirelessMultiboot { LinkRawWireless::ReceiveDataResponse response; LINK_WIRELESS_MULTIBOOT_TRY_SUB(sendAndExpectData(sendBuffer, response)) - u32 newPercentage = multiTransfer.processResponse(response); + u8 newPercentage = multiTransfer.processResponse(response); if (newPercentage != progress.percentage) { progress.percentage = newPercentage; _LWMLOG_("-> " + std::to_string(newPercentage)); diff --git a/lib/LinkWirelessOpenSDK.hpp b/lib/LinkWirelessOpenSDK.hpp index 596a1c6..745f744 100644 --- a/lib/LinkWirelessOpenSDK.hpp +++ b/lib/LinkWirelessOpenSDK.hpp @@ -637,7 +637,7 @@ class LinkWirelessOpenSDK { * @param response The received response from the adapter. * @return The completion percentage (0~100). */ - u32 processResponse(LinkRawWireless::ReceiveDataResponse response) { + u8 processResponse(LinkRawWireless::ReceiveDataResponse response) { if (finished) return 100; diff --git a/lib/c_bindings/C_LinkCableMultiboot.h b/lib/c_bindings/C_LinkCableMultiboot.h index cd81f83..f92fedf 100644 --- a/lib/c_bindings/C_LinkCableMultiboot.h +++ b/lib/c_bindings/C_LinkCableMultiboot.h @@ -80,7 +80,7 @@ void C_LinkCableMultiboot_Async_getResult( u8 C_LinkCableMultiboot_Async_playerCount( C_LinkCableMultiboot_AsyncHandle handle); -u32 C_LinkCableMultiboot_Async_getPercentage( +u8 C_LinkCableMultiboot_Async_getPercentage( C_LinkCableMultiboot_AsyncHandle handle); bool C_LinkCableMultiboot_Async_isReady( diff --git a/lib/c_bindings/C_LinkWirelessMultiboot.h b/lib/c_bindings/C_LinkWirelessMultiboot.h index 7cba58b..903f6fe 100644 --- a/lib/c_bindings/C_LinkWirelessMultiboot.h +++ b/lib/c_bindings/C_LinkWirelessMultiboot.h @@ -36,8 +36,8 @@ typedef enum { typedef struct { C_LinkWirelessMultiboot_State state; - u32 connectedClients; - u32 percentage; + u8 connectedClients; + u8 percentage; volatile bool* ready; } C_LinkWirelessMultiboot_Progress;