Ken Van Hoeylandt 9a11e6f47b
Implement UI scaling and more (#501)
**New Features**
 * Runtime font accessors and new symbol fonts for text, launcher, statusbar, and shared icons.
 * Added font height base setting to device.properties
 * Text fonts now have 3 sizes: small, default, large

**Improvements**
 * Renamed `UiScale` to `UiDensity`
 * Statusbar, toolbar and many UI components now compute heights and spacing from fonts/density.
 * SSD1306 initialization sequence refined for more stable startup.
 * Multiple image assets replaced by symbol-font rendering.
 * Many layout improvements related to density, font scaling and icon scaling
 * Updated folder name capitalization for newer style
2026-02-15 01:41:47 +01:00

55 lines
1.1 KiB
C

#pragma once
#include "time.h"
#include <stdint.h>
#ifdef ESP_PLATFORM
#include <rom/ets_sys.h>
#else
#include <unistd.h>
#endif
#include <tactility/freertos/freertos.h>
#include <tactility/check.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Delay the current task for the specified amount of ticks
* @warning Does not work in ISR context
*/
static inline void delay_ticks(TickType_t ticks) {
check(xPortInIsrContext() == pdFALSE);
if (ticks == 0U) {
taskYIELD();
} else {
vTaskDelay(ticks);
}
}
/**
* Delay the current task for the specified amount of milliseconds
* @warning Does not work in ISR context
*/
static inline void delay_millis(uint32_t milliSeconds) {
delay_ticks(millis_to_ticks(milliSeconds));
}
/**
* Stall the currently active CPU core for the specified amount of microseconds.
* This does not allow other tasks to run on the stalled CPU core.
*/
static inline void delay_micros(uint32_t microseconds) {
#ifdef ESP_PLATFORM
ets_delay_us(microseconds);
#else
usleep(microseconds);
#endif
}
#ifdef __cplusplus
}
#endif