SubGhz: add protocol MegaCode (#1204)

* SubGhz: add protocol MegaCode
* SubGhz: check for guard time injection at the end of buffer
* SubGhz: rollback samples counting in trasmitter
* SubGhz: fix subghz_file_encoder_worker incorrect pulse sequence
* Input: tune debounce interval
* SubGhz: fix spelling in subghz_file_encoder_worker_add_level_duration

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2022-05-08 21:50:20 +04:00
committed by GitHub
parent 23cff2a7d2
commit f04d0eea96
11 changed files with 556 additions and 25 deletions

View File

@@ -10,7 +10,7 @@ extern "C" {
#endif
/* Input Related Constants */
#define INPUT_DEBOUNCE_TICKS 20
#define INPUT_DEBOUNCE_TICKS 30
/* Input Keys */
typedef enum {

View File

@@ -799,6 +799,9 @@ static void furi_hal_subghz_async_tx_refill(uint32_t* buffer, size_t samples) {
} else {
furi_hal_subghz_async_tx.duty_low += API_HAL_SUBGHZ_ASYNC_TX_GUARD_TIME;
}
// This code must be invoked only once: when encoder starts with low level.
// Otherwise whole thing will crash.
furi_check(samples > 0);
}
uint32_t duration = level_duration_get_duration(ld);