mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
fix naming
This commit is contained in:
@@ -389,9 +389,9 @@ void subghz_txrx_gen_serial_gangqi(uint64_t* result_key) {
|
||||
uint8_t const_and_button = (uint8_t)(0xD0 | 0xD);
|
||||
uint8_t serial_high = (uint8_t)(serial >> 8);
|
||||
uint8_t serial_low = (uint8_t)(serial & 0xFF);
|
||||
uint8_t crc = (uint8_t)(0xC8 - serial_high - serial_low - const_and_button);
|
||||
uint8_t bytesum = (uint8_t)(0xC8 - serial_high - serial_low - const_and_button);
|
||||
|
||||
// Add crc sum to the end
|
||||
// Add bytesum to the end
|
||||
// serial | const_and_button
|
||||
*result_key = (serial << 18) | (const_and_button << 10) | (crc << 2);
|
||||
*result_key = (serial << 18) | (const_and_button << 10) | (bytesum << 2);
|
||||
}
|
||||
|
||||
@@ -169,10 +169,10 @@ static void subghz_protocol_encoder_hollarm_get_upload(SubGhzProtocolEncoderHoll
|
||||
|
||||
uint64_t new_key = (instance->generic.data >> 12) << 12 | (instance->generic.btn << 8);
|
||||
|
||||
uint8_t crc = ((new_key >> 32) & 0xFF) + ((new_key >> 24) & 0xFF) + ((new_key >> 16) & 0xFF) +
|
||||
((new_key >> 8) & 0xFF);
|
||||
uint8_t bytesum = ((new_key >> 32) & 0xFF) + ((new_key >> 24) & 0xFF) +
|
||||
((new_key >> 16) & 0xFF) + ((new_key >> 8) & 0xFF);
|
||||
|
||||
instance->generic.data = (new_key | crc);
|
||||
instance->generic.data = (new_key | bytesum);
|
||||
|
||||
size_t index = 0;
|
||||
|
||||
@@ -233,7 +233,7 @@ static void subghz_protocol_hollarm_remote_controller(SubGhzBlockGeneric* instan
|
||||
// F0B9342401 = 01 8bit Sum
|
||||
// F0B9342805 = 05 8bit Sum
|
||||
|
||||
// Serial (moved 2bit to right) | Btn | 8b CRC (previous 4 bytes sum)
|
||||
// Serial (moved 2bit to right) | Btn | 8b previous 4 bytes sum
|
||||
// 00001111000010111001001101000010 0010 11111111 btn = (0x2)
|
||||
// 00001111000010111001001101000010 0001 11111110 btn = (0x1)
|
||||
// 00001111000010111001001101000010 0100 00000001 btn = (0x4)
|
||||
@@ -447,23 +447,23 @@ void subghz_protocol_decoder_hollarm_get_string(void* context, FuriString* outpu
|
||||
|
||||
// Parse serial
|
||||
subghz_protocol_hollarm_remote_controller(&instance->generic);
|
||||
// Get CRC
|
||||
uint8_t crc = ((instance->generic.data >> 32) & 0xFF) +
|
||||
((instance->generic.data >> 24) & 0xFF) +
|
||||
((instance->generic.data >> 16) & 0xFF) + ((instance->generic.data >> 8) & 0xFF);
|
||||
// Get byte sum
|
||||
uint8_t bytesum =
|
||||
((instance->generic.data >> 32) & 0xFF) + ((instance->generic.data >> 24) & 0xFF) +
|
||||
((instance->generic.data >> 16) & 0xFF) + ((instance->generic.data >> 8) & 0xFF);
|
||||
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s %db\r\n"
|
||||
"Key: 0x%02lX%08lX\r\n"
|
||||
"Serial: 0x%06lX CRC: %02X\r\n"
|
||||
"Serial: 0x%06lX Sum: %02X\r\n"
|
||||
"Btn: 0x%01X - %s\r\n",
|
||||
instance->generic.protocol_name,
|
||||
instance->generic.data_count_bit,
|
||||
(uint32_t)(instance->generic.data >> 32),
|
||||
(uint32_t)instance->generic.data,
|
||||
instance->generic.serial,
|
||||
crc,
|
||||
bytesum,
|
||||
instance->generic.btn,
|
||||
subghz_protocol_hollarm_get_button_name(instance->generic.btn));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user