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 ## 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 - 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 - 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 - 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: case ConnectionActive:
return TT_STRINGIFY(ConnectionActive); return TT_STRINGIFY(ConnectionActive);
case OffPending: case OffPending:
return TT_STRINGIFY(OnPending); return TT_STRINGIFY(OffPending);
case Off: case Off:
return TT_STRINGIFY(Off); return TT_STRINGIFY(Off);
} }

View File

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

View File

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

View File

@ -10,14 +10,14 @@ extern "C" {
typedef void* DisplayDriverHandle; typedef void* DisplayDriverHandle;
enum ColorFormat { typedef enum {
COLOR_FORMAT_MONOCHROME, // 1 bpp COLOR_FORMAT_MONOCHROME, // 1 bpp
COLOR_FORMAT_BGR565, COLOR_FORMAT_BGR565,
COLOR_FORMAT_BGR565_SWAPPED, COLOR_FORMAT_BGR565_SWAPPED,
COLOR_FORMAT_RGB565, COLOR_FORMAT_RGB565,
COLOR_FORMAT_RGB565_SWAPPED, COLOR_FORMAT_RGB565_SWAPPED,
COLOR_FORMAT_RGB888 COLOR_FORMAT_RGB888
}; } ColorFormat;
/** /**
* Check if the display driver interface is supported for this device. * 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. /** GPIO pin mode used by the HAL.
* @warning The order must match tt::hal::gpio::Mode * @warning The order must match tt::hal::gpio::Mode
*/ */
enum GpioMode { typedef enum {
/** Pin is disabled (high-impedance). */ /** Pin is disabled (high-impedance). */
GpioModeDisable = 0, GpioModeDisable = 0,
/** Pin configured as input only. */ /** Pin configured as input only. */
@ -28,7 +28,7 @@ enum GpioMode {
GpioModeInputOutput, GpioModeInputOutput,
/** Pin configured for both input and output (open-drain). */ /** Pin configured for both input and output (open-drain). */
GpioModeInputOutputOpenDrain GpioModeInputOutputOpenDrain
}; } GpioMode;
/** Configure a single GPIO pin. /** Configure a single GPIO pin.
* @param[in] pin GPIO number to configure. * @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 */ /** A handle that represents a lock instance. A lock could be a Mutex or similar construct */
typedef void* LockHandle; typedef void* LockHandle;
enum TtMutexType { typedef enum {
MutexTypeNormal, MutexTypeNormal,
MutexTypeRecursive MutexTypeRecursive
}; } TtMutexType;
/** /**
* Allocate a new mutex instance * Allocate a new mutex instance
* @param[in] type specify if the mutex is either a normal one, or whether it can recursively (re)lock * @param[in] type specify if the mutex is either a normal one, or whether it can recursively (re)lock
* @return the allocated lock handle * @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. * 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 */ /** Important: These values must map to tt::service::wifi::RadioState values exactly */
typedef enum { typedef enum {
WIFI_RADIO_STATE_ON_PENDING, WifiRadioStateOnPending,
WIFI_RADIO_STATE_ON, WifiRadioStateOn,
WIFI_RADIO_STATE_CONNECTION_PENDING, WifiRadioStateConnectionPending,
WIFI_RADIO_STATE_CONNECTION_ACTIVE, WifiRadioStateConnectionActive,
WIFI_RADIO_STATE_OFF_PENDING, WifiRadioStateOffPending,
WIFI_RADIO_STATE_OFF, WifiRadioStateOff,
} WifiRadioState; } WifiRadioState;
/** @return the state of the WiFi radio */ /** @return the state of the WiFi radio */