Rename api-hal to furi-hal (#629)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "subghz_cli.h"
|
||||
|
||||
#include <furi.h>
|
||||
#include <api-hal.h>
|
||||
#include <furi-hal.h>
|
||||
#include <stream_buffer.h>
|
||||
#include <lib/subghz/protocols/subghz_protocol.h>
|
||||
|
||||
@@ -31,7 +31,7 @@ void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) {
|
||||
cli_print_usage("subghz_tx_carrier", "<Frequency in HZ>", string_get_cstr(args));
|
||||
return;
|
||||
}
|
||||
if(!api_hal_subghz_is_frequency_valid(frequency)) {
|
||||
if(!furi_hal_subghz_is_frequency_valid(frequency)) {
|
||||
printf(
|
||||
"Frequency must be in " SUBGHZ_FREQUENCY_RANGE_STR " range, not %lu\r\n",
|
||||
frequency);
|
||||
@@ -39,14 +39,14 @@ void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
api_hal_subghz_reset();
|
||||
api_hal_subghz_load_preset(ApiHalSubGhzPresetOokAsync);
|
||||
frequency = api_hal_subghz_set_frequency_and_path(frequency);
|
||||
furi_hal_subghz_reset();
|
||||
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOokAsync);
|
||||
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
|
||||
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write(&gpio_cc1101_g0, true);
|
||||
|
||||
api_hal_subghz_tx();
|
||||
furi_hal_subghz_tx();
|
||||
|
||||
printf("Transmitting at frequency %lu Hz\r\n", frequency);
|
||||
printf("Press CTRL+C to stop\r\n");
|
||||
@@ -54,8 +54,8 @@ void subghz_cli_command_tx_carrier(Cli* cli, string_t args, void* context) {
|
||||
osDelay(250);
|
||||
}
|
||||
|
||||
api_hal_subghz_set_path(ApiHalSubGhzPathIsolate);
|
||||
api_hal_subghz_sleep();
|
||||
furi_hal_subghz_set_path(FuriHalSubGhzPathIsolate);
|
||||
furi_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) {
|
||||
@@ -68,7 +68,7 @@ void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) {
|
||||
cli_print_usage("subghz_tx_carrier", "<Frequency in HZ>", string_get_cstr(args));
|
||||
return;
|
||||
}
|
||||
if(!api_hal_subghz_is_frequency_valid(frequency)) {
|
||||
if(!furi_hal_subghz_is_frequency_valid(frequency)) {
|
||||
printf(
|
||||
"Frequency must be in " SUBGHZ_FREQUENCY_RANGE_STR " range, not %lu\r\n",
|
||||
frequency);
|
||||
@@ -76,22 +76,22 @@ void subghz_cli_command_rx_carrier(Cli* cli, string_t args, void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
api_hal_subghz_reset();
|
||||
api_hal_subghz_load_preset(ApiHalSubGhzPresetOokAsync);
|
||||
frequency = api_hal_subghz_set_frequency_and_path(frequency);
|
||||
furi_hal_subghz_reset();
|
||||
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOokAsync);
|
||||
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
|
||||
printf("Receiving at frequency %lu Hz\r\n", frequency);
|
||||
printf("Press CTRL+C to stop\r\n");
|
||||
|
||||
api_hal_subghz_rx();
|
||||
furi_hal_subghz_rx();
|
||||
|
||||
while(!cli_cmd_interrupt_received(cli)) {
|
||||
osDelay(250);
|
||||
printf("RSSI: %03.1fdbm\r", api_hal_subghz_get_rssi());
|
||||
printf("RSSI: %03.1fdbm\r", furi_hal_subghz_get_rssi());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
api_hal_subghz_set_path(ApiHalSubGhzPathIsolate);
|
||||
api_hal_subghz_sleep();
|
||||
furi_hal_subghz_set_path(FuriHalSubGhzPathIsolate);
|
||||
furi_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
#define SUBGHZ_PT_SHORT 376
|
||||
@@ -118,7 +118,7 @@ void subghz_cli_command_tx(Cli* cli, string_t args, void* context) {
|
||||
string_get_cstr(args));
|
||||
return;
|
||||
}
|
||||
if(!api_hal_subghz_is_frequency_valid(frequency)) {
|
||||
if(!furi_hal_subghz_is_frequency_valid(frequency)) {
|
||||
printf(
|
||||
"Frequency must be in " SUBGHZ_FREQUENCY_RANGE_STR " range, not %lu\r\n",
|
||||
frequency);
|
||||
@@ -151,16 +151,16 @@ void subghz_cli_command_tx(Cli* cli, string_t args, void* context) {
|
||||
key,
|
||||
repeat);
|
||||
|
||||
api_hal_subghz_reset();
|
||||
api_hal_subghz_load_preset(ApiHalSubGhzPresetOokAsync);
|
||||
frequency = api_hal_subghz_set_frequency_and_path(frequency);
|
||||
furi_hal_subghz_reset();
|
||||
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOokAsync);
|
||||
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
|
||||
|
||||
api_hal_subghz_start_async_tx(subghz_test_data, subghz_test_data_size, repeat);
|
||||
api_hal_subghz_wait_async_tx();
|
||||
api_hal_subghz_stop_async_tx();
|
||||
furi_hal_subghz_start_async_tx(subghz_test_data, subghz_test_data_size, repeat);
|
||||
furi_hal_subghz_wait_async_tx();
|
||||
furi_hal_subghz_stop_async_tx();
|
||||
|
||||
free(subghz_test_data);
|
||||
api_hal_subghz_sleep();
|
||||
furi_hal_subghz_sleep();
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
@@ -200,7 +200,7 @@ void subghz_cli_command_rx(Cli* cli, string_t args, void* context) {
|
||||
cli_print_usage("subghz_rx", "<Frequency in HZ>", string_get_cstr(args));
|
||||
return;
|
||||
}
|
||||
if(!api_hal_subghz_is_frequency_valid(frequency)) {
|
||||
if(!furi_hal_subghz_is_frequency_valid(frequency)) {
|
||||
printf(
|
||||
"Frequency must be in " SUBGHZ_FREQUENCY_RANGE_STR " range, not %lu\r\n",
|
||||
frequency);
|
||||
@@ -219,14 +219,14 @@ void subghz_cli_command_rx(Cli* cli, string_t args, void* context) {
|
||||
subghz_protocol_enable_dump_text(protocol, subghz_cli_command_rx_text_callback, instance);
|
||||
|
||||
// Configure radio
|
||||
api_hal_subghz_reset();
|
||||
api_hal_subghz_load_preset(ApiHalSubGhzPresetOokAsync);
|
||||
frequency = api_hal_subghz_set_frequency_and_path(frequency);
|
||||
furi_hal_subghz_reset();
|
||||
furi_hal_subghz_load_preset(FuriHalSubGhzPresetOokAsync);
|
||||
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
|
||||
hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
|
||||
|
||||
// Prepare and start RX
|
||||
api_hal_subghz_set_async_rx_callback(subghz_cli_command_rx_callback, instance);
|
||||
api_hal_subghz_start_async_rx();
|
||||
furi_hal_subghz_set_async_rx_callback(subghz_cli_command_rx_callback, instance);
|
||||
furi_hal_subghz_start_async_rx();
|
||||
|
||||
// Wait for packets to arrive
|
||||
printf("Listening at %lu. Press CTRL+C to stop\r\n", frequency);
|
||||
@@ -247,8 +247,8 @@ void subghz_cli_command_rx(Cli* cli, string_t args, void* context) {
|
||||
}
|
||||
|
||||
// Shutdown radio
|
||||
api_hal_subghz_stop_async_rx();
|
||||
api_hal_subghz_sleep();
|
||||
furi_hal_subghz_stop_async_rx();
|
||||
furi_hal_subghz_sleep();
|
||||
|
||||
printf("\r\nPackets recieved %u\r\n", instance->packet_count);
|
||||
|
||||
|
Reference in New Issue
Block a user