flipperzero-firmware/firmware/targets/furi_hal_include/furi_hal_delay.h
Georgii Surkov 917be9c6d3
[FL-2430] Automatic Desktop Locking (#1101)
* Add Auto Lock Time setting
* Update .gitignore
* Add value_index toolbox module
* Auto locking basic implementation
* Better AutoLock implementation, edge cases and cleanup
* Fix NULL pointer crash
* Turn off backlight shortly in locked mode
* Re-enable auto lock after pin lock
* Correctly handle start when pin locked
* Use timer to hide locked hint
* Use a single state variable instead of multiple bools
* Do not call update callback recursively
* Allow input when the Unlocked hint is shown
* Add a delay to backlight switch off while locking
* Better user input handling
* Switch backlight off after pin timeout
* Correct grammar in notification settings

Co-authored-by: あく <alleteam@gmail.com>
2022-04-14 15:20:41 +03:00

57 lines
1.0 KiB
C

/**
* @file furi_hal_delay.h
* Delay HAL API
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/** Init Delay subsystem */
void furi_hal_delay_init();
/** Get instructions per microsecond count */
uint32_t furi_hal_delay_instructions_per_microsecond();
/** Increase tick counter.
* Should be called from SysTick ISR
*/
void furi_hal_tick(void);
/** Get current tick counter
*
* System uptime, may overflow.
*
* @return Current ticks in milliseconds
*/
uint32_t furi_hal_get_tick(void);
/** Convert milliseconds to ticks
*
* @param[in] milliseconds time in milliseconds
* @return time in ticks
*/
uint32_t furi_hal_ms_to_ticks(float milliseconds);
/** Delay in milliseconds
* @warning Cannot be used from ISR
*
* @param[in] milliseconds milliseconds to wait
*/
void furi_hal_delay_ms(float milliseconds);
/** Delay in microseconds
*
* @param[in] microseconds microseconds to wait
*/
void furi_hal_delay_us(float microseconds);
#ifdef __cplusplus
}
#endif