diff options
author | あく <alleteam@gmail.com> | 2021-08-08 21:03:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 21:03:25 +0300 |
commit | 0a97d6913c1a48156e3e2d8f339e027a003f948f (patch) | |
tree | d02cd7895df05654c4e106a28055333fd976228a /applications/cli | |
parent | 7907cb232bda5af7c30c79c67ab353b2cefe57c8 (diff) |
Rename api-hal to furi-hal (#629)
Diffstat (limited to 'applications/cli')
-rw-r--r-- | applications/cli/cli.c | 24 | ||||
-rw-r--r-- | applications/cli/cli_commands.c | 34 | ||||
-rwxr-xr-x | applications/cli/cli_i.h | 2 |
3 files changed, 30 insertions, 30 deletions
diff --git a/applications/cli/cli.c b/applications/cli/cli.c index e8567087..ab5451dc 100644 --- a/applications/cli/cli.c +++ b/applications/cli/cli.c @@ -1,7 +1,7 @@ #include "cli_i.h" #include "cli_commands.h" -#include <api-hal-version.h> +#include <furi-hal-version.h> #include <loader/loader.h> Cli* cli_alloc() { @@ -30,33 +30,33 @@ void cli_free(Cli* cli) { } void cli_putc(char c) { - api_hal_vcp_tx((uint8_t*)&c, 1); + furi_hal_vcp_tx((uint8_t*)&c, 1); } char cli_getc(Cli* cli) { furi_assert(cli); char c; - if(api_hal_vcp_rx((uint8_t*)&c, 1) == 0) { + if(furi_hal_vcp_rx((uint8_t*)&c, 1) == 0) { cli_reset(cli); } return c; } void cli_stdout_callback(void* _cookie, const char* data, size_t size) { - api_hal_vcp_tx((const uint8_t*)data, size); + furi_hal_vcp_tx((const uint8_t*)data, size); } void cli_write(Cli* cli, uint8_t* buffer, size_t size) { - return api_hal_vcp_tx(buffer, size); + return furi_hal_vcp_tx(buffer, size); } size_t cli_read(Cli* cli, uint8_t* buffer, size_t size) { - return api_hal_vcp_rx(buffer, size); + return furi_hal_vcp_rx(buffer, size); } bool cli_cmd_interrupt_received(Cli* cli) { char c = '\0'; - if(api_hal_vcp_rx_with_timeout((uint8_t*)&c, 1, 0) == 1) { + if(furi_hal_vcp_rx_with_timeout((uint8_t*)&c, 1, 0) == 1) { return c == CliSymbolAsciiETX; } else { return false; @@ -92,7 +92,7 @@ void cli_motd() { "Read Manual https://docs.flipperzero.one\r\n" "\r\n"); - const Version* firmware_version = api_hal_version_get_firmware_version(); + const Version* firmware_version = furi_hal_version_get_firmware_version(); if(firmware_version) { printf( "Firmware version: %s %s (%s built on %s)\r\n", @@ -143,7 +143,7 @@ static void cli_normalize_line(Cli* cli) { static void cli_execute_command(Cli* cli, CliCommand* command, string_t args) { if(!(command->flags & CliCommandFlagInsomniaSafe)) { - api_hal_power_insomnia_enter(); + furi_hal_power_insomnia_enter(); } // Ensure that we running alone @@ -164,7 +164,7 @@ static void cli_execute_command(Cli* cli, CliCommand* command, string_t args) { } if(!(command->flags & CliCommandFlagInsomniaSafe)) { - api_hal_power_insomnia_exit(); + furi_hal_power_insomnia_exit(); } } @@ -305,9 +305,9 @@ void cli_process_input(Cli* cli) { } else if(c == CliSymbolAsciiEOT) { cli_reset(cli); } else if(c == CliSymbolAsciiEsc) { - r = api_hal_vcp_rx((uint8_t*)&c, 1); + r = furi_hal_vcp_rx((uint8_t*)&c, 1); if(r && c == '[') { - api_hal_vcp_rx((uint8_t*)&c, 1); + furi_hal_vcp_rx((uint8_t*)&c, 1); cli_handle_escape(cli, c); } else { cli_putc(CliSymbolAsciiBell); diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index d23a8c59..5d1afc12 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -1,6 +1,6 @@ #include "cli_commands.h" -#include <api-hal.h> -#include <api-hal-gpio.h> +#include <furi-hal.h> +#include <furi-hal-gpio.h> #include <rtc.h> #include <task-control-block.h> #include <time.h> @@ -14,33 +14,33 @@ */ void cli_command_device_info(Cli* cli, string_t args, void* context) { // Model name - printf("hardware_model : %s\r\n", api_hal_version_get_model_name()); - const char* name = api_hal_version_get_name_ptr(); + printf("hardware_model : %s\r\n", furi_hal_version_get_model_name()); + const char* name = furi_hal_version_get_name_ptr(); if(name) { printf("hardware_name : %s\r\n", name); } // Unique ID printf("hardware_uid : "); - const uint8_t* uid = api_hal_version_uid(); - for(size_t i = 0; i < api_hal_version_uid_size(); i++) { + const uint8_t* uid = furi_hal_version_uid(); + for(size_t i = 0; i < furi_hal_version_uid_size(); i++) { printf("%02X", uid[i]); } printf("\r\n"); // Board Revision - printf("hardware_ver : %d\r\n", api_hal_version_get_hw_version()); - printf("hardware_target : %d\r\n", api_hal_version_get_hw_target()); - printf("hardware_body : %d\r\n", api_hal_version_get_hw_body()); - printf("hardware_connect : %d\r\n", api_hal_version_get_hw_connect()); - printf("hardware_timestamp : %lu\r\n", api_hal_version_get_hw_timestamp()); + printf("hardware_ver : %d\r\n", furi_hal_version_get_hw_version()); + printf("hardware_target : %d\r\n", furi_hal_version_get_hw_target()); + printf("hardware_body : %d\r\n", furi_hal_version_get_hw_body()); + printf("hardware_connect : %d\r\n", furi_hal_version_get_hw_connect()); + printf("hardware_timestamp : %lu\r\n", furi_hal_version_get_hw_timestamp()); // Color and Region - printf("hardware_color : %d\r\n", api_hal_version_get_hw_color()); - printf("hardware_region : %d\r\n", api_hal_version_get_hw_region()); + printf("hardware_color : %d\r\n", furi_hal_version_get_hw_color()); + printf("hardware_region : %d\r\n", furi_hal_version_get_hw_region()); // Bootloader Version - const Version* boot_version = api_hal_version_get_boot_version(); + const Version* boot_version = furi_hal_version_get_boot_version(); if(boot_version) { printf("boot_version : %s\r\n", version_get_version(boot_version)); printf("boot_commit : %s\r\n", version_get_githash(boot_version)); @@ -49,7 +49,7 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { } // Firmware version - const Version* firmware_version = api_hal_version_get_firmware_version(); + const Version* firmware_version = furi_hal_version_get_firmware_version(); if(firmware_version) { printf("firmware_version : %s\r\n", version_get_version(firmware_version)); printf("firmware_commit : %s\r\n", version_get_githash(firmware_version)); @@ -58,7 +58,7 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { } WirelessFwInfo_t pWirelessInfo; - if(api_hal_bt_is_alive() && SHCI_GetWirelessFwInfo(&pWirelessInfo) == SHCI_Success) { + if(furi_hal_bt_is_alive() && SHCI_GetWirelessFwInfo(&pWirelessInfo) == SHCI_Success) { printf("radio_alive : true\r\n"); // FUS Info printf("radio_fus_major : %d\r\n", pWirelessInfo.FusVersionMajor); @@ -80,7 +80,7 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { printf("radio_stack_flash : %dK\r\n", pWirelessInfo.MemorySizeFlash * 4); // Mac address printf("radio_ble_mac : "); - const uint8_t* ble_mac = api_hal_version_get_ble_mac(); + const uint8_t* ble_mac = furi_hal_version_get_ble_mac(); for(size_t i = 0; i < 6; i++) { printf("%02X", ble_mac[i]); } diff --git a/applications/cli/cli_i.h b/applications/cli/cli_i.h index e60fa450..b0ab6384 100755 --- a/applications/cli/cli_i.h +++ b/applications/cli/cli_i.h @@ -3,7 +3,7 @@ #include "cli.h" #include <furi.h> -#include <api-hal.h> +#include <furi-hal.h> #include <m-dict.h> #include <m-bptree.h> |