[FL-1146] GD0 self-test
This commit is contained in:
@@ -114,15 +114,15 @@ bool subghz_static_input(InputEvent* event, void* context) {
|
||||
uint8_t bit = i % 8;
|
||||
bool value = (key[byte] >> (7 - bit)) & 1;
|
||||
// Payload send
|
||||
hal_gpio_write(&cc1101_g0_gpio, false);
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
delay_us(value ? SUBGHZ_PT_ONE : SUBGHZ_PT_ZERO);
|
||||
hal_gpio_write(&cc1101_g0_gpio, true);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
delay_us(value ? SUBGHZ_PT_ZERO : SUBGHZ_PT_ONE);
|
||||
}
|
||||
// Last bit
|
||||
hal_gpio_write(&cc1101_g0_gpio, false);
|
||||
hal_gpio_write(&gpio_cc1101_g0, false);
|
||||
delay_us(SUBGHZ_PT_ONE);
|
||||
hal_gpio_write(&cc1101_g0_gpio, true);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
// Guard time
|
||||
delay_us(10600);
|
||||
}
|
||||
@@ -144,8 +144,8 @@ void subghz_static_enter(void* context) {
|
||||
api_hal_subghz_reset();
|
||||
api_hal_subghz_load_preset(ApiHalSubGhzPresetOokAsync);
|
||||
|
||||
hal_gpio_init(&cc1101_g0_gpio, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write(&cc1101_g0_gpio, true);
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
|
||||
with_view_model(
|
||||
subghz_static->view, (SubghzStaticModel * model) {
|
||||
|
||||
Reference in New Issue
Block a user