[FL-1009, FL-1118] Better initialization sequence and V8 hardware support (#406)
* Interrupt manager: add memory barriers. * ISRs: remove TIM17 dead code. * API HAL Delay: rename initialization routine and move to API-HAL * Main: move FURI initialization to the start. * API HAL GPIO: drop CC1101 shenanigans, COMP inversion for new boards. * IButton: migrate Cyfral and Metakom to RFID comp routine, make it compatible with new boards. * RFID: Better keyboard handling and shutdown routines
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#include <api-hal-gpio.h>
|
||||
#include <api-hal-spi.h>
|
||||
#include <api-hal-resources.h>
|
||||
#include <api-hal-delay.h>
|
||||
#include <api-hal-version.h>
|
||||
|
||||
// init GPIO
|
||||
void hal_gpio_init(
|
||||
@@ -23,9 +21,16 @@ void hal_gpio_init(
|
||||
extern COMP_HandleTypeDef hcomp1;
|
||||
|
||||
bool get_rfid_in_level() {
|
||||
#ifdef INVERT_RFID_IN
|
||||
return (HAL_COMP_GetOutputLevel(&hcomp1) == COMP_OUTPUT_LEVEL_LOW);
|
||||
#else
|
||||
return (HAL_COMP_GetOutputLevel(&hcomp1) == COMP_OUTPUT_LEVEL_HIGH);
|
||||
#endif
|
||||
bool value = false;
|
||||
if (api_hal_version_get_hw_version() > 7) {
|
||||
value = (HAL_COMP_GetOutputLevel(&hcomp1) == COMP_OUTPUT_LEVEL_LOW);
|
||||
} else {
|
||||
value = (HAL_COMP_GetOutputLevel(&hcomp1) == COMP_OUTPUT_LEVEL_HIGH);
|
||||
}
|
||||
|
||||
#ifdef INVERT_RFID_IN
|
||||
return !value;
|
||||
#else
|
||||
return value;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user