The haptic feedback wrapper implementation. More...
#include "system/vibe/vibe.h"#include "system/settings/settings.h"#include "system/settings/setting_values.h"#include "clock/hour_latch.h"Functions | |
| void | vibe_pulse (VibePulse pulse) |
| Fire a pulse unless in quiet time. | |
| void | vibe_custom (const uint32_t *durations, uint32_t num_segments) |
| Buzz a custom on and off rhythm unless in quiet time. The durations are milliseconds that alternate buzz then pause then buzz and so on, starting on a buzz. Lets a caller play a little tune that the three canned pulses cannot. | |
| void | vibe_choice (uint8_t choice) |
| Fire the pattern named by a VibeChoice (VIBE_NONE stays silent). The caller resolves the choice from wherever it likes, so the lib never has to know which setting it came from. | |
| void | vibe_bt_transition (bool connected) |
| The default bluetooth-transition buzz: fire the pattern the user picked in settings for a connect or disconnect. A face installs this as system_store's vibe policy so the store itself never has to know about settings or buzzing. | |
| static time_t | current_hour_start (void) |
| When the current local hour began. | |
| void | vibe_hourly (const struct tm *tick, uint8_t choice) |
| Buzz once at the top of each hour. A face calls this from its time callback on every tick, and it buzzes on the first tick of each hour's minute 0. | |
Variables | |
| static HourLatch | s_hour_latch = HOUR_LATCH_EMPTY |
| the hour the hourly buzz last fired for | |
| static bool | s_hourly_seeded |
| whether the first call has remembered its hour | |
The haptic feedback wrapper implementation.
|
static |
When the current local hour began.
It reads the clock once and breaks that same reading apart. Pairing a fresh time(NULL) with an older tick's minutes and seconds would give one hour two starts whenever a second turns over between them.