mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-18 02:41:36 +03:00
Update came_atomo.c
This commit is contained in:
parent
e3395ae36e
commit
1b332c0323
@ -146,16 +146,11 @@ static void subghz_protocol_encoder_came_atomo_get_upload(SubGhzProtocolEncoderC
|
|||||||
|
|
||||||
uint64_t invert = instance->generic.data ^ 0xFFFFFFFFFFFFFFFF;
|
uint64_t invert = instance->generic.data ^ 0xFFFFFFFFFFFFFFFF;
|
||||||
invert >>= 4;
|
invert >>= 4;
|
||||||
invert = (uint64_t)0x1 << 60 | invert;
|
invert = (uint64_t)0x1 << 62 | invert;
|
||||||
hi = invert >> 32;
|
hi = invert >> 32;
|
||||||
lo = invert & 0xFFFFFFFF;
|
lo = invert & 0xFFFFFFFF;
|
||||||
FURI_LOG_I(TAG, "inverted to upload: %02X %02X %02X %02X %02X %02X %02X %02X\n", (hi >> 24), ((hi >> 16) & 0xFF), ((hi >> 8) & 0xFF), (hi & 0xFF),
|
FURI_LOG_I(TAG, "inverted to upload: %02X %02X %02X %02X %02X %02X %02X %02X\n", (hi >> 24), ((hi >> 16) & 0xFF), ((hi >> 8) & 0xFF), (hi & 0xFF),
|
||||||
(lo >> 24), ((lo >> 16) & 0xFF), ((lo >> 8) & 0xFF), (lo & 0xFF));
|
(lo >> 24), ((lo >> 16) & 0xFF), ((lo >> 8) & 0xFF), (lo & 0xFF));
|
||||||
//Send start bits Atomo
|
|
||||||
instance->encoder.upload[index++] =
|
|
||||||
level_duration_make(true, (uint32_t)subghz_protocol_came_atomo_const.te_long);
|
|
||||||
instance->encoder.upload[index++] =
|
|
||||||
level_duration_make(false, (uint32_t)subghz_protocol_came_atomo_const.te_short);
|
|
||||||
|
|
||||||
for(uint8_t i = instance->generic.data_count_bit; i > 0; i--) {
|
for(uint8_t i = instance->generic.data_count_bit; i > 0; i--) {
|
||||||
if(!manchester_encoder_advance(&enc_state, !bit_read(invert, i - 1), &result)) {
|
if(!manchester_encoder_advance(&enc_state, !bit_read(invert, i - 1), &result)) {
|
||||||
@ -173,7 +168,7 @@ static void subghz_protocol_encoder_came_atomo_get_upload(SubGhzProtocolEncoderC
|
|||||||
}
|
}
|
||||||
//pause
|
//pause
|
||||||
instance->encoder.upload[index++] =
|
instance->encoder.upload[index++] =
|
||||||
level_duration_make(false, (uint32_t)subghz_protocol_came_atomo_const.te_long * 57);
|
level_duration_make(false, (uint32_t)subghz_protocol_came_atomo_const.te_short * 113);
|
||||||
|
|
||||||
instance->encoder.size_upload = index;
|
instance->encoder.size_upload = index;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user