mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-27 01:58:09 -07:00
Merge branch 'UNLEASHED' into 420
This commit is contained in:
+7
-7
@@ -17,13 +17,13 @@ env.Append(
|
||||
"lib/print",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/one_wire/one_wire_host_timing.h"),
|
||||
File("#/lib/one_wire/one_wire_host.h"),
|
||||
File("#/lib/one_wire/one_wire_slave.h"),
|
||||
File("#/lib/one_wire/one_wire_device.h"),
|
||||
File("#/lib/one_wire/ibutton/ibutton_worker.h"),
|
||||
File("#/lib/one_wire/maxim_crc.h"),
|
||||
File("#/lib/u8g2/u8g2.h"),
|
||||
File("one_wire/one_wire_host_timing.h"),
|
||||
File("one_wire/one_wire_host.h"),
|
||||
File("one_wire/one_wire_slave.h"),
|
||||
File("one_wire/one_wire_device.h"),
|
||||
File("one_wire/ibutton/ibutton_worker.h"),
|
||||
File("one_wire/maxim_crc.h"),
|
||||
File("u8g2/u8g2.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ env.Append(
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
*env.GlobRecursive("*_ll_*.h", "#/lib/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc/", exclude="*usb.h"),
|
||||
File("#/lib/STM32CubeWB/Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h"),
|
||||
File("#/lib/STM32CubeWB/Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h"),
|
||||
File("STM32CubeWB/Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h"),
|
||||
File("STM32CubeWB/Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ env.Append(
|
||||
"#/lib/drivers",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/drivers/nrf24.h"),
|
||||
File("nrf24.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -12,6 +12,13 @@ void nrf24_init() {
|
||||
furi_hal_gpio_write(nrf24_CE_PIN, false);
|
||||
}
|
||||
|
||||
void nrf24_deinit() {
|
||||
furi_hal_spi_release(nrf24_HANDLE);
|
||||
furi_hal_spi_bus_handle_deinit(nrf24_HANDLE);
|
||||
furi_hal_gpio_write(nrf24_CE_PIN, false);
|
||||
furi_hal_gpio_init(nrf24_CE_PIN, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
}
|
||||
|
||||
void nrf24_spi_trx(
|
||||
FuriHalSpiBusHandle* handle,
|
||||
uint8_t* tx,
|
||||
|
||||
@@ -116,6 +116,11 @@ uint8_t nrf24_set_tx_mode(FuriHalSpiBusHandle* handle);
|
||||
*/
|
||||
void nrf24_init();
|
||||
|
||||
/** Must call this when we end using nrf24 device
|
||||
*
|
||||
*/
|
||||
void nrf24_deinit();
|
||||
|
||||
/** Send flush rx command
|
||||
*
|
||||
* @param handle - pointer to FuriHalSpiHandle
|
||||
|
||||
@@ -5,7 +5,7 @@ env.Append(
|
||||
"#/lib/flipper_application",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/flipper_application/flipper_application.h"),
|
||||
File("flipper_application.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ env.Append(
|
||||
"#/lib/flipper_format",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/flipper_format/flipper_format.h"),
|
||||
File("#/lib/flipper_format/flipper_format_i.h"),
|
||||
File("flipper_format.h"),
|
||||
File("flipper_format_i.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ env.Append(
|
||||
"#/lib/infrared/worker",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/infrared/worker/infrared_transmit.h"),
|
||||
File("#/lib/infrared/worker/infrared_worker.h"),
|
||||
File("#/lib/infrared/encoder_decoder/infrared.h"),
|
||||
File("encoder_decoder/infrared.h"),
|
||||
File("worker/infrared_worker.h"),
|
||||
File("worker/infrared_transmit.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ env.Append(
|
||||
"#/lib/lfrfid",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/lfrfid/lfrfid_worker.h"),
|
||||
File("#/lib/lfrfid/lfrfid_raw_worker.h"),
|
||||
File("#/lib/lfrfid/lfrfid_raw_file.h"),
|
||||
File("#/lib/lfrfid/lfrfid_dict_file.h"),
|
||||
File("#/lib/lfrfid/tools/bit_lib.h"),
|
||||
File("#/lib/lfrfid/protocols/lfrfid_protocols.h"),
|
||||
File("lfrfid_worker.h"),
|
||||
File("lfrfid_raw_worker.h"),
|
||||
File("lfrfid_raw_file.h"),
|
||||
File("lfrfid_dict_file.h"),
|
||||
File("tools/bit_lib.h"),
|
||||
File("protocols/lfrfid_protocols.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ env.Append(
|
||||
CPPDEFINES=[
|
||||
("USB_PMASIZE", "0x400"),
|
||||
],
|
||||
SDK_HEADERS=env.GlobRecursive(
|
||||
"*.h",
|
||||
Dir("libusb_stm32/inc"),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@ env.Append(
|
||||
"#/lib/mbedtls",
|
||||
"#/lib/mbedtls/include",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("mbedtls/include/mbedtls/des.h"),
|
||||
File("mbedtls/include/mbedtls/sha1.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ env.Append(
|
||||
"PB_ENABLE_MALLOC",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/micro-ecc/uECC.h"),
|
||||
File("micro-ecc/uECC.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ for wrapped_fn in wrapped_fn_list:
|
||||
|
||||
env.Append(
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/print/wrappers.h"),
|
||||
File("wrappers.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
+14
-14
@@ -5,20 +5,20 @@ env.Append(
|
||||
"#/lib/subghz",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/subghz/environment.h"),
|
||||
File("#/lib/subghz/receiver.h"),
|
||||
File("#/lib/subghz/subghz_worker.h"),
|
||||
File("#/lib/subghz/subghz_tx_rx_worker.h"),
|
||||
File("#/lib/subghz/transmitter.h"),
|
||||
File("#/lib/subghz/registry.h"),
|
||||
File("#/lib/subghz/protocols/protocol_items.h"),
|
||||
File("#/lib/subghz/protocols/raw.h"),
|
||||
File("#/lib/subghz/blocks/const.h"),
|
||||
File("#/lib/subghz/blocks/decoder.h"),
|
||||
File("#/lib/subghz/blocks/encoder.h"),
|
||||
File("#/lib/subghz/blocks/generic.h"),
|
||||
File("#/lib/subghz/blocks/math.h"),
|
||||
File("#/lib/subghz/subghz_setting.h"),
|
||||
File("environment.h"),
|
||||
File("receiver.h"),
|
||||
File("subghz_worker.h"),
|
||||
File("subghz_tx_rx_worker.h"),
|
||||
File("transmitter.h"),
|
||||
File("registry.h"),
|
||||
File("protocols/protocol_items.h"),
|
||||
File("protocols/raw.h"),
|
||||
File("blocks/const.h"),
|
||||
File("blocks/decoder.h"),
|
||||
File("blocks/encoder.h"),
|
||||
File("blocks/generic.h"),
|
||||
File("blocks/math.h"),
|
||||
File("subghz_setting.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -462,10 +462,7 @@ bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat*
|
||||
FURI_LOG_E(TAG, "Wrong number of bits in key");
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
|
||||
uint8_t seed_data[sizeof(uint32_t)] = {0};
|
||||
for(size_t i = 0; i < sizeof(uint32_t); i++) {
|
||||
seed_data[sizeof(uint32_t) - i - 1] = (instance->generic.seed >> i * 8) & 0xFF;
|
||||
@@ -476,6 +473,11 @@ bool subghz_protocol_decoder_faac_slh_deserialize(void* context, FlipperFormat*
|
||||
}
|
||||
instance->generic.seed = seed_data[0] << 24 | seed_data[1] << 16 | seed_data[2] << 8 |
|
||||
seed_data[3];
|
||||
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
res = true;
|
||||
} while(false);
|
||||
|
||||
|
||||
@@ -371,15 +371,6 @@ bool subghz_protocol_encoder_keeloq_deserialize(void* context, FlipperFormat* fl
|
||||
break;
|
||||
}
|
||||
|
||||
// Read manufacturer from file
|
||||
if(flipper_format_read_string(
|
||||
flipper_format, "Manufacture", instance->manufacture_from_file)) {
|
||||
instance->manufacture_name = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
mfname = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
} else {
|
||||
FURI_LOG_D(TAG, "ENCODER: Missing Manufacture");
|
||||
}
|
||||
|
||||
uint8_t seed_data[sizeof(uint32_t)] = {0};
|
||||
for(size_t i = 0; i < sizeof(uint32_t); i++) {
|
||||
seed_data[sizeof(uint32_t) - i - 1] = (instance->generic.seed >> i * 8) & 0xFF;
|
||||
@@ -390,6 +381,20 @@ bool subghz_protocol_encoder_keeloq_deserialize(void* context, FlipperFormat* fl
|
||||
instance->generic.seed = seed_data[0] << 24 | seed_data[1] << 16 | seed_data[2] << 8 |
|
||||
seed_data[3];
|
||||
|
||||
// Read manufacturer from file
|
||||
if(flipper_format_read_string(
|
||||
flipper_format, "Manufacture", instance->manufacture_from_file)) {
|
||||
instance->manufacture_name = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
mfname = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
} else {
|
||||
FURI_LOG_D(TAG, "ENCODER: Missing Manufacture");
|
||||
}
|
||||
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
|
||||
subghz_protocol_keeloq_check_remote_controller(
|
||||
&instance->generic, instance->keystore, &instance->manufacture_name);
|
||||
|
||||
@@ -979,9 +984,22 @@ bool subghz_protocol_decoder_keeloq_serialize(
|
||||
subghz_protocol_keeloq_check_remote_controller(
|
||||
&instance->generic, instance->keystore, &instance->manufacture_name);
|
||||
|
||||
if(strcmp(instance->manufacture_name, "BFT") == 0) {
|
||||
uint8_t seed_data[sizeof(uint32_t)] = {0};
|
||||
for(size_t i = 0; i < sizeof(uint32_t); i++) {
|
||||
seed_data[sizeof(uint32_t) - i - 1] = (instance->generic.seed >> i * 8) & 0xFF;
|
||||
}
|
||||
if(res && !flipper_format_write_hex(flipper_format, "Seed", seed_data, sizeof(uint32_t))) {
|
||||
FURI_LOG_E(TAG, "DECODER Serialize: Unable to add Seed");
|
||||
res = false;
|
||||
}
|
||||
instance->generic.seed = seed_data[0] << 24 | seed_data[1] << 16 | seed_data[2] << 8 |
|
||||
seed_data[3];
|
||||
}
|
||||
|
||||
if(res && !flipper_format_write_string_cstr(
|
||||
flipper_format, "Manufacture", instance->manufacture_name)) {
|
||||
FURI_LOG_E(TAG, "Unable to add manufacture name");
|
||||
FURI_LOG_E(TAG, "DECODER Serialize: Unable to add manufacture name");
|
||||
res = false;
|
||||
}
|
||||
return res;
|
||||
@@ -1001,19 +1019,6 @@ bool subghz_protocol_decoder_keeloq_deserialize(void* context, FlipperFormat* fl
|
||||
FURI_LOG_E(TAG, "Wrong number of bits in key");
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
|
||||
// Read manufacturer from file
|
||||
if(flipper_format_read_string(
|
||||
flipper_format, "Manufacture", instance->manufacture_from_file)) {
|
||||
instance->manufacture_name = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
mfname = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
} else {
|
||||
FURI_LOG_D(TAG, "DECODER: Missing Manufacture");
|
||||
}
|
||||
|
||||
uint8_t seed_data[sizeof(uint32_t)] = {0};
|
||||
for(size_t i = 0; i < sizeof(uint32_t); i++) {
|
||||
@@ -1024,6 +1029,21 @@ bool subghz_protocol_decoder_keeloq_deserialize(void* context, FlipperFormat* fl
|
||||
}
|
||||
instance->generic.seed = seed_data[0] << 24 | seed_data[1] << 16 | seed_data[2] << 8 |
|
||||
seed_data[3];
|
||||
|
||||
// Read manufacturer from file
|
||||
if(flipper_format_read_string(
|
||||
flipper_format, "Manufacture", instance->manufacture_from_file)) {
|
||||
instance->manufacture_name = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
mfname = furi_string_get_cstr(instance->manufacture_from_file);
|
||||
} else {
|
||||
FURI_LOG_D(TAG, "DECODER: Missing Manufacture");
|
||||
}
|
||||
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
break;
|
||||
}
|
||||
|
||||
res = true;
|
||||
} while(false);
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ void* subghz_protocol_encoder_nice_flor_s_alloc(SubGhzEnvironment* environment)
|
||||
instance->nice_flor_s_rainbow_table_file_name =
|
||||
subghz_environment_get_nice_flor_s_rainbow_table_file_name(environment);
|
||||
if(instance->nice_flor_s_rainbow_table_file_name) {
|
||||
FURI_LOG_I(
|
||||
FURI_LOG_D(
|
||||
TAG, "Loading rainbow table from %s", instance->nice_flor_s_rainbow_table_file_name);
|
||||
}
|
||||
instance->encoder.repeat = 10;
|
||||
@@ -343,7 +343,7 @@ void* subghz_protocol_decoder_nice_flor_s_alloc(SubGhzEnvironment* environment)
|
||||
instance->nice_flor_s_rainbow_table_file_name =
|
||||
subghz_environment_get_nice_flor_s_rainbow_table_file_name(environment);
|
||||
if(instance->nice_flor_s_rainbow_table_file_name) {
|
||||
FURI_LOG_I(
|
||||
FURI_LOG_D(
|
||||
TAG, "Loading rainbow table from %s", instance->nice_flor_s_rainbow_table_file_name);
|
||||
}
|
||||
return instance;
|
||||
|
||||
+17
-17
@@ -8,23 +8,23 @@ env.Append(
|
||||
"#/lib/toolbox",
|
||||
],
|
||||
SDK_HEADERS=[
|
||||
File("#/lib/toolbox/manchester_decoder.h"),
|
||||
File("#/lib/toolbox/manchester_encoder.h"),
|
||||
File("#/lib/toolbox/path.h"),
|
||||
File("#/lib/toolbox/random_name.h"),
|
||||
File("#/lib/toolbox/hmac_sha256.h"),
|
||||
File("#/lib/toolbox/crc32_calc.h"),
|
||||
File("#/lib/toolbox/dir_walk.h"),
|
||||
File("#/lib/toolbox/md5.h"),
|
||||
File("#/lib/toolbox/args.h"),
|
||||
File("#/lib/toolbox/saved_struct.h"),
|
||||
File("#/lib/toolbox/version.h"),
|
||||
File("#/lib/toolbox/tar/tar_archive.h"),
|
||||
File("#/lib/toolbox/stream/stream.h"),
|
||||
File("#/lib/toolbox/stream/file_stream.h"),
|
||||
File("#/lib/toolbox/stream/string_stream.h"),
|
||||
File("#/lib/toolbox/stream/buffered_file_stream.h"),
|
||||
File("#/lib/toolbox/protocols/protocol_dict.h"),
|
||||
File("manchester_decoder.h"),
|
||||
File("manchester_encoder.h"),
|
||||
File("path.h"),
|
||||
File("random_name.h"),
|
||||
File("hmac_sha256.h"),
|
||||
File("crc32_calc.h"),
|
||||
File("dir_walk.h"),
|
||||
File("md5.h"),
|
||||
File("args.h"),
|
||||
File("saved_struct.h"),
|
||||
File("version.h"),
|
||||
File("tar/tar_archive.h"),
|
||||
File("stream/stream.h"),
|
||||
File("stream/file_stream.h"),
|
||||
File("stream/string_stream.h"),
|
||||
File("stream/buffered_file_stream.h"),
|
||||
File("protocols/protocol_dict.h"),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user