Fixes for enums in TactilityC (#404)

This commit is contained in:
Ken Van Hoeylandt 2025-11-01 09:38:32 +01:00 committed by GitHub
parent 569cce38fa
commit e2ec39304c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 18 additions and 20 deletions

View File

@ -2,8 +2,6 @@
## Before release
- Issue with `enum DeviceType` when compiling from C (check all TactilityC enums!)
- Automate release process more
- Elecrow Basic & Advance 3.5" memory issue: not enough memory for App Hub
- App Hub crashes if you close it while an app is being installed
- Fix glitches when installing app via App Hub with 4.3" Waveshare

View File

@ -14,7 +14,7 @@ const char* radioStateToString(RadioState state) {
case ConnectionActive:
return TT_STRINGIFY(ConnectionActive);
case OffPending:
return TT_STRINGIFY(OnPending);
return TT_STRINGIFY(OffPending);
case Off:
return TT_STRINGIFY(Off);
}

View File

@ -5,12 +5,12 @@ extern "C" {
#endif
/** Affects LVGL widget style */
enum UiScale {
typedef enum {
/** Ideal for very small non-touch screen devices (e.g. Waveshare S3 LCD 1.3") */
UiScaleSmallest,
/** Nothing was changed in the LVGL UI/UX */
UiScaleDefault
};
} UiScale;
/** @return the UI scaling setting for this device. */
UiScale tt_hal_configuration_get_ui_scale();

View File

@ -7,7 +7,7 @@
extern "C" {
#endif
enum DeviceType {
typedef enum {
DEVICE_TYPE_I2C,
DEVICE_TYPE_DISPLAY,
DEVICE_TYPE_TOUCH,
@ -15,7 +15,7 @@ enum DeviceType {
DEVICE_TYPE_KEYBOARD,
DEVICE_TYPE_POWER,
DEVICE_TYPE_GPS
};
} DeviceType;
typedef uint32_t DeviceId;

View File

@ -10,14 +10,14 @@ extern "C" {
typedef void* DisplayDriverHandle;
enum ColorFormat {
typedef enum {
COLOR_FORMAT_MONOCHROME, // 1 bpp
COLOR_FORMAT_BGR565,
COLOR_FORMAT_BGR565_SWAPPED,
COLOR_FORMAT_RGB565,
COLOR_FORMAT_RGB565_SWAPPED,
COLOR_FORMAT_RGB888
};
} ColorFormat;
/**
* Check if the display driver interface is supported for this device.

View File

@ -15,7 +15,7 @@ typedef unsigned int GpioPin;
/** GPIO pin mode used by the HAL.
* @warning The order must match tt::hal::gpio::Mode
*/
enum GpioMode {
typedef enum {
/** Pin is disabled (high-impedance). */
GpioModeDisable = 0,
/** Pin configured as input only. */
@ -28,7 +28,7 @@ enum GpioMode {
GpioModeInputOutput,
/** Pin configured for both input and output (open-drain). */
GpioModeInputOutputOpenDrain
};
} GpioMode;
/** Configure a single GPIO pin.
* @param[in] pin GPIO number to configure.

View File

@ -10,17 +10,17 @@ extern "C" {
/** A handle that represents a lock instance. A lock could be a Mutex or similar construct */
typedef void* LockHandle;
enum TtMutexType {
typedef enum {
MutexTypeNormal,
MutexTypeRecursive
};
} TtMutexType;
/**
* Allocate a new mutex instance
* @param[in] type specify if the mutex is either a normal one, or whether it can recursively (re)lock
* @return the allocated lock handle
*/
LockHandle tt_lock_alloc_mutex(enum TtMutexType type);
LockHandle tt_lock_alloc_mutex(TtMutexType type);
/**
* Allocate a lock for a file or folder.

View File

@ -12,12 +12,12 @@ extern "C" {
/** Important: These values must map to tt::service::wifi::RadioState values exactly */
typedef enum {
WIFI_RADIO_STATE_ON_PENDING,
WIFI_RADIO_STATE_ON,
WIFI_RADIO_STATE_CONNECTION_PENDING,
WIFI_RADIO_STATE_CONNECTION_ACTIVE,
WIFI_RADIO_STATE_OFF_PENDING,
WIFI_RADIO_STATE_OFF,
WifiRadioStateOnPending,
WifiRadioStateOn,
WifiRadioStateConnectionPending,
WifiRadioStateConnectionActive,
WifiRadioStateOffPending,
WifiRadioStateOff,
} WifiRadioState;
/** @return the state of the WiFi radio */