1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

feat(core): add RGB LED syscalls

[no changelog]
This commit is contained in:
tychovrahe 2024-11-14 13:12:36 +01:00 committed by TychoVrahe
parent d9d4fc0187
commit 2da2826020
4 changed files with 30 additions and 0 deletions

View File

@ -63,6 +63,10 @@
#include <io/sdcard.h>
#endif
#ifdef USE_RGB_LED
#include <io/rgb_led.h>
#endif
#ifdef SYSTEM_VIEW
#include <sys/systemview.h>
#endif

View File

@ -51,6 +51,10 @@
#include <sec/optiga.h>
#endif
#ifdef USE_RGB_LED
#include <io/rgb_led.h>
#endif
#ifdef USE_SD_CARD
#include <io/sdcard.h>
#endif
@ -412,6 +416,13 @@ __attribute((no_stack_protector)) void syscall_handler(uint32_t *args,
} break;
#endif
#ifdef USE_RGB_LED
case SYSCALL_RGB_LED_SET_COLOR: {
uint32_t color = args[0];
rgb_led_set_color(color);
} break;
#endif
#ifdef USE_HAPTIC
case SYSCALL_HAPTIC_SET_ENABLED: {
bool enabled = (args[0] != 0);

View File

@ -92,6 +92,8 @@ typedef enum {
SYSCALL_TOUCH_GET_EVENT,
SYSCALL_RGB_LED_SET_COLOR,
SYSCALL_HAPTIC_SET_ENABLED,
SYSCALL_HAPTIC_GET_ENABLED,
SYSCALL_HAPTIC_TEST,

View File

@ -385,6 +385,19 @@ uint32_t touch_get_event(void) {
#endif
// =============================================================================
// rgb_led.h
// =============================================================================
#ifdef USE_RGB_LED
#include <io/rgb_led.h>
void rgb_led_set_color(uint32_t color) {
syscall_invoke1(color, SYSCALL_RGB_LED_SET_COLOR);
}
#endif
// =============================================================================
// haptic.h
// =============================================================================