CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
ViewStack.cpp File Reference

View-stack implementation with recursive mutex. More...

#include "cdc_ui/ViewStack.h"
#include "cdc_core/EventBus.h"
#include "cdc_hal/IDisplay.h"
#include "cdc_log.h"
#include <cstring>

Go to the source code of this file.

Namespaces

namespace  cdc
namespace  cdc::ui
 Centralized key-code constants for cdc_views.

Functions

static bool cdc::ui::isListView (const IView *view)
 Checks whether a view is a ListView by runtime name.

Variables

static const char * TAG = "ViewStack"

Detailed Description

View-stack implementation with recursive mutex.

The ViewStack is touched from multiple FreeRTOS contexts (UI task, USB CTAP-HID task, BLE callback task) so the underlying storage needs a synchronization primitive. The public API is reentrant: view callbacks fired from inside dispatchKey/dispatchLongPress/dispatchTick legitimately call back into push/pop/showModal/hideModal on the same task. A FreeRTOS recursive mutex is therefore required - a plain mutex would self-deadlock the UI task as soon as the first key is dispatched.

Definition in file ViewStack.cpp.

Variable Documentation

◆ TAG

const char* TAG = "ViewStack"
static

Definition at line 20 of file ViewStack.cpp.