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
8 changed files with 18 additions and 20 deletions
+2 -2
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();
+2 -2
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;
+2 -2
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.
+2 -2
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.
+3 -3
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.
+6 -6
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 */