[FL-1146] GD0 self-test

This commit is contained in:
あく
2021-05-08 22:24:05 +03:00
committed by GitHub
parent 2844743370
commit a975fb6dc5
7 changed files with 102 additions and 31 deletions

View File

@@ -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) {