mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-28 01:58:11 -07:00
Merge branch 'DarkFlippers:dev' into 420
This commit is contained in:
@@ -137,7 +137,11 @@ void subghz_protocol_encoder_keeloq_free(void* context) {
|
|||||||
* @param btn Button number, 4 bit
|
* @param btn Button number, 4 bit
|
||||||
*/
|
*/
|
||||||
static bool subghz_protocol_keeloq_gen_data(SubGhzProtocolEncoderKeeloq* instance, uint8_t btn) {
|
static bool subghz_protocol_keeloq_gen_data(SubGhzProtocolEncoderKeeloq* instance, uint8_t btn) {
|
||||||
instance->generic.cnt++;
|
if(instance->generic.cnt < 0xFFFF) {
|
||||||
|
instance->generic.cnt++;
|
||||||
|
} else if(instance->generic.cnt >= 0xFFFF) {
|
||||||
|
instance->generic.cnt = 0;
|
||||||
|
}
|
||||||
uint32_t fix = btn << 28 | instance->generic.serial;
|
uint32_t fix = btn << 28 | instance->generic.serial;
|
||||||
uint32_t decrypt = btn << 28 |
|
uint32_t decrypt = btn << 28 |
|
||||||
(instance->generic.serial & 0x3FF)
|
(instance->generic.serial & 0x3FF)
|
||||||
|
|||||||
@@ -138,7 +138,11 @@ void subghz_protocol_encoder_star_line_free(void* context) {
|
|||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
subghz_protocol_star_line_gen_data(SubGhzProtocolEncoderStarLine* instance, uint8_t btn) {
|
subghz_protocol_star_line_gen_data(SubGhzProtocolEncoderStarLine* instance, uint8_t btn) {
|
||||||
instance->generic.cnt++;
|
if(instance->generic.cnt < 0xFFFF) {
|
||||||
|
instance->generic.cnt++;
|
||||||
|
} else if(instance->generic.cnt >= 0xFFFF) {
|
||||||
|
instance->generic.cnt = 0;
|
||||||
|
}
|
||||||
uint32_t fix = btn << 24 | instance->generic.serial;
|
uint32_t fix = btn << 24 | instance->generic.serial;
|
||||||
uint32_t decrypt = btn << 24 | (instance->generic.serial & 0xFF) << 16 | instance->generic.cnt;
|
uint32_t decrypt = btn << 24 | (instance->generic.serial & 0xFF) << 16 | instance->generic.cnt;
|
||||||
uint32_t hop = 0;
|
uint32_t hop = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user