diff --git a/app_api_interface.h b/app_api_interface.h new file mode 100644 index 00000000000..a8b0634d619 --- /dev/null +++ b/app_api_interface.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +/* + * Resolver interface with private application's symbols. + * Implementation is contained in app_api_table.c + */ +#ifdef __cplusplus +extern "C" const ElfApiInterface* const application_api_interface; +#else +extern const ElfApiInterface* const application_api_interface; +#endif \ No newline at end of file diff --git a/app_api_table.cpp b/app_api_table.cpp new file mode 100644 index 00000000000..6c389540afa --- /dev/null +++ b/app_api_table.cpp @@ -0,0 +1,19 @@ +#include +#include +#include "app_api_interface.h" +#include "app_api_table_i.h" + +static_assert(!has_hash_collisions(app_api_table), "Detected API method hash collision!"); + +constexpr HashtableApiInterface applicaton_hashtable_api_interface{ + { + .api_version_major = 0, + .api_version_minor = 0, + .resolver_callback = &elf_resolve_from_hashtable, + }, + .table_cbegin = app_api_table.cbegin(), + .table_cend = app_api_table.cend(), +}; + +extern "C" const ElfApiInterface* const application_api_interface = + &applicaton_hashtable_api_interface; diff --git a/app_api_table_i.h b/app_api_table_i.h new file mode 100644 index 00000000000..b1c29ed7105 --- /dev/null +++ b/app_api_table_i.h @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include +#include "services/crypto/crypto_facade.h" +#include "ui/scene_director.h" +#include "services/config/config.h" +#include "cli/cli_helpers.h" +#include "workers/bt_type_code/bt_type_code.h" + +static constexpr auto app_api_table = sort(create_array_t( + API_METHOD(memset_s, errno_t, (void*, rsize_t, int, rsize_t)), + API_METHOD(totp_scene_director_activate_scene, void, (PluginState* const, Scene)), + API_METHOD(totp_scene_director_force_redraw, void, (PluginState* const)), + API_METHOD(totp_config_file_update_timezone_offset, bool, (const PluginState*)), + API_METHOD(totp_config_file_reset, void, (PluginState* const)), + API_METHOD( + totp_config_get_token_iterator_context, + TokenInfoIteratorContext*, + (const PluginState*)), + API_METHOD(totp_config_file_backup, char*, (const PluginState*)), + API_METHOD( + totp_config_file_update_encryption, + bool, + (PluginState*, uint8_t, const uint8_t*, uint8_t)), + API_METHOD(totp_config_file_update_automation_method, bool, (const PluginState*)), + API_METHOD(totp_config_file_update_notification_method, bool, (const PluginState*)), + API_METHOD(totp_token_info_iterator_get_total_count, size_t, (const TokenInfoIteratorContext*)), + API_METHOD( + totp_token_info_iterator_get_current_token_index, + size_t, + (const TokenInfoIteratorContext*)), + API_METHOD(totp_token_info_iterator_go_to, bool, (TokenInfoIteratorContext*, size_t)), + API_METHOD( + totp_token_info_iterator_get_current_token, + const TokenInfo*, + (const TokenInfoIteratorContext*)), + API_METHOD( + totp_token_info_iterator_add_new_token, + TotpIteratorUpdateTokenResult, + (TokenInfoIteratorContext*, TOTP_ITERATOR_UPDATE_TOKEN_ACTION, const void*)), + API_METHOD( + totp_token_info_iterator_update_current_token, + TotpIteratorUpdateTokenResult, + (TokenInfoIteratorContext*, TOTP_ITERATOR_UPDATE_TOKEN_ACTION, const void*)), + API_METHOD( + totp_token_info_iterator_move_current_token_info, + bool, + (TokenInfoIteratorContext*, size_t)), + API_METHOD( + totp_token_info_iterator_remove_current_token_info, + bool, + (TokenInfoIteratorContext*)), + API_METHOD(token_info_get_algo_as_cstr, const char*, (const TokenInfo*)), + API_METHOD(token_info_set_algo_from_str, bool, (TokenInfo*, const FuriString*)), + API_METHOD(token_info_set_digits_from_int, bool, (TokenInfo*, uint8_t)), + API_METHOD(token_info_set_duration_from_int, bool, (TokenInfo*, uint8_t)), + API_METHOD(token_info_set_automation_feature_from_str, bool, (TokenInfo*, const FuriString*)), + API_METHOD( + token_info_set_secret, + bool, + (TokenInfo*, const char*, size_t, PlainTokenSecretEncoding, const CryptoSettings*)), + API_METHOD(totp_crypto_check_key_slot, bool, (uint8_t)), + API_METHOD(totp_bt_type_code_worker_free, void, (TotpBtTypeCodeWorkerContext*)))); \ No newline at end of file diff --git a/application.fam b/application.fam index 1ce79678fb9..46600ed72d0 100644 --- a/application.fam +++ b/application.fam @@ -4,24 +4,17 @@ App( apptype=FlipperAppType.EXTERNAL, entry_point="totp_app", cdefines=["APP_TOTP"], - requires=[ - "gui", - "cli", - "dialogs", - "storage", - "input", - "notification", - "bt" - ], + requires=["gui", "cli", "dialogs", "storage", "input", "notification", "bt"], stack_size=2 * 1024, order=20, - fap_version="4.11", + fap_version="5.00", fap_author="Alexander Kopachov (@akopachov)", fap_description="Software-based TOTP authenticator for Flipper Zero device", fap_weburl="https://github.com/akopachov/flipper-zero_authenticator", fap_category="Tools", fap_icon_assets="images", fap_icon="totp_10px.png", + fap_file_assets="assets", fap_private_libs=[ Lib( name="base32", @@ -38,9 +31,6 @@ App( Lib( name="roll_value", ), - Lib( - name="fonts", - ), Lib( name="wolfssl", sources=[ @@ -49,11 +39,133 @@ App( "wolfcrypt/src/hash.c", "wolfcrypt/src/sha.c", "wolfcrypt/src/sha256.c", - "wolfcrypt/src/sha512.c" + "wolfcrypt/src/sha512.c", ], cflags=["-Wno-error"], cdefines=["HAVE_CONFIG_H"], - cincludes=["config/wolfssl"] + cincludes=["config/wolfssl"], ), ], ) + +App( + appid="totp_cli_timezone_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_timezone_plugin_ep", + requires=["totp"], + sources=["cli/plugins/timezone/timezone.c", "cli/cli_shared_methods.c"], +) + +App( + appid="totp_cli_version_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_version_plugin_ep", + requires=["totp"], + sources=["cli/plugins/version/version.c"], +) + +App( + appid="totp_cli_help_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_help_plugin_ep", + requires=["totp"], + sources=["cli/plugins/help/help.c"], +) + +App( + appid="totp_cli_list_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_list_plugin_ep", + requires=["totp"], + sources=[ + "cli/plugins/list/list.c", + "cli/cli_shared_methods.c", + "cli/plugins/list/formatters/table/list_output_formatter_table.c", + "cli/plugins/list/formatters/tsv/list_output_formatter_tsv.c", + ], +) + +App( + appid="totp_cli_details_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_details_plugin_ep", + requires=["totp"], + sources=[ + "cli/plugins/details/details.c", + "cli/cli_shared_methods.c", + "cli/plugins/details/formatters/table/details_output_formatter_table.c", + "cli/plugins/details/formatters/tsv/details_output_formatter_tsv.c", + ], +) + +App( + appid="totp_cli_add_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_add_plugin_ep", + requires=["totp"], + sources=[ + "cli/plugins/modify/add/add.c", + "cli/plugins/modify/common.c", + "cli/cli_shared_methods.c", + ], +) + +App( + appid="totp_cli_update_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_update_plugin_ep", + requires=["totp"], + sources=[ + "cli/plugins/modify/update/update.c", + "cli/plugins/modify/common.c", + "cli/cli_shared_methods.c", + ], +) + +App( + appid="totp_cli_delete_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_delete_plugin_ep", + requires=["totp"], + sources=["cli/plugins/delete/delete.c", "cli/cli_shared_methods.c"], +) + +App( + appid="totp_cli_move_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_move_plugin_ep", + requires=["totp"], + sources=["cli/plugins/move/move.c", "cli/cli_shared_methods.c"], +) + +App( + appid="totp_cli_reset_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_reset_plugin_ep", + requires=["totp"], + sources=["cli/plugins/reset/reset.c", "cli/cli_shared_methods.c"], +) + +App( + appid="totp_cli_pin_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_pin_plugin_ep", + requires=["totp"], + sources=["cli/plugins/pin/pin.c", "cli/cli_shared_methods.c"], +) + +App( + appid="totp_cli_automation_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_automation_plugin_ep", + requires=["totp"], + sources=["cli/plugins/automation/automation.c", "cli/cli_shared_methods.c"], +) + +App( + appid="totp_cli_notification_plugin", + apptype=FlipperAppType.PLUGIN, + entry_point="totp_cli_notification_plugin_ep", + requires=["totp"], + sources=["cli/plugins/notification/notification.c", "cli/cli_shared_methods.c"], +) diff --git a/assets/cli/cli_help.txt b/assets/cli/cli_help.txt new file mode 100644 index 00000000000..2cd941b234a --- /dev/null +++ b/assets/cli/cli_help.txt @@ -0,0 +1,55 @@ +Usage: + totp (help | h | ?) + totp version + totp (list | ls) + totp (lsattr | cat) + totp (add | mk | new) [-a ] [-e ] [-d ] [-l ] [-u] [-b ]... + totp (update) [-a ] [-e ] [-n ] [-d ] [-l ] [-u] [-s] [-b ]... + totp (delete | rm) [-f] + totp (move | mv) + totp pin (set | remove) [-c ] + totp notify [...] + totp (timezone | tz) [] + totp reset + totp automation [-k ] [...] + +Commands: + help, h, ? Show command usage help + version Get application version + list, ls List all available tokens + lsattr, cat Displays token details + add, mk, new Add new token + update Update existing token + delete, rm Delete existing token + move, mv Move token + pin Set\change\remove PIN + notify Get or set notification method + timezone, tz Get or set current timezone + reset Reset application to default settings + automation Get or set automation settings + +Arguments: + name Token name + index Token index in the list + new_index New token index in the list + notification Notification method to be set. Must be one of: none, sound, vibro + timezone Timezone offset in hours to be set + automation Automation method to be set. Must be one of: none, usb, bt + +Options: + -a Token hashing algorithm. Must be one of: sha1, sha256, sha512, steam [default: sha1] + -d Number of digits to generate, one of: 5, 6, 8 [default: 6] + -e Token secret encoding, one of base32, base64 [default: base32] + -l Token lifetime duration in seconds, between: 15 and 255 [default: 30] + -u Show console user input as-is without masking + -b Token automation features to be enabled. Must be one of: none, enter, tab [default: none] + # none - No features + # enter - Type key at the end of token input automation + # tab - Type key at the end of token input automation + # slower - Type slower + -n Token name + -s Update token secret + -f Force command to do not ask user for interactive confirmation + -c New crypto key slot. Must be between 12 and 100 + -k Automation keyboard layout. Must be one of: QWERTY, AZERTY, QWERTZ + \ No newline at end of file diff --git a/assets/fonts/00.font b/assets/fonts/00.font new file mode 100644 index 00000000000..ae72d66ca22 Binary files /dev/null and b/assets/fonts/00.font differ diff --git a/assets/fonts/01.font b/assets/fonts/01.font new file mode 100644 index 00000000000..3186c56cfd4 Binary files /dev/null and b/assets/fonts/01.font differ diff --git a/assets/fonts/02.font b/assets/fonts/02.font new file mode 100644 index 00000000000..0da182ca3c2 Binary files /dev/null and b/assets/fonts/02.font differ diff --git a/assets/fonts/03.font b/assets/fonts/03.font new file mode 100644 index 00000000000..d3e29560c5f Binary files /dev/null and b/assets/fonts/03.font differ diff --git a/assets/fonts/04.font b/assets/fonts/04.font new file mode 100644 index 00000000000..779bd4bc6ac Binary files /dev/null and b/assets/fonts/04.font differ diff --git a/assets/fonts/05.font b/assets/fonts/05.font new file mode 100644 index 00000000000..ed5bed401f1 Binary files /dev/null and b/assets/fonts/05.font differ diff --git a/assets/fonts/06.font b/assets/fonts/06.font new file mode 100644 index 00000000000..2fdc77951e0 Binary files /dev/null and b/assets/fonts/06.font differ diff --git a/assets/fonts/07.font b/assets/fonts/07.font new file mode 100644 index 00000000000..60ff8a6c98e Binary files /dev/null and b/assets/fonts/07.font differ diff --git a/assets/fonts/08.font b/assets/fonts/08.font new file mode 100644 index 00000000000..d5599873166 Binary files /dev/null and b/assets/fonts/08.font differ diff --git a/assets/fonts/09.font b/assets/fonts/09.font new file mode 100644 index 00000000000..5c19753209b Binary files /dev/null and b/assets/fonts/09.font differ diff --git a/cli/cli.c b/cli/cli.c index 4e17abfba93..8ebaa08a607 100644 --- a/cli/cli.c +++ b/cli/cli.c @@ -1,24 +1,28 @@ -// Original idea: https://github.com/br0ziliy - #include "cli.h" #include +#include +#include +#include #include "cli_helpers.h" -#include "commands/list/list.h" -#include "commands/add/add.h" -#include "commands/update/update.h" -#include "commands/delete/delete.h" -#include "commands/timezone/timezone.h" -#include "commands/help/help.h" -#include "commands/move/move.h" -#include "commands/pin/pin.h" -#include "commands/notification/notification.h" -#include "commands/reset/reset.h" -#include "commands/automation/automation.h" -#include "commands/details/details.h" -#include "commands/version/version.h" +#include "plugins/timezone/meta.h" +#include "plugins/list/meta.h" +#include "plugins/modify/add/meta.h" +#include "plugins/modify/update/meta.h" +#include "plugins/delete/meta.h" +#include "plugins/help/meta.h" +#include "plugins/move/meta.h" +#include "plugins/pin/meta.h" +#include "plugins/notification/meta.h" +#include "plugins/reset/meta.h" +#include "plugins/automation/meta.h" +#include "plugins/details/meta.h" +#include "plugins/version/meta.h" +#include "cli_plugin_interface.h" +#include "../app_api_interface.h" struct TotpCliContext { PluginState* plugin_state; + CompositeApiResolver* plugin_api_resolver; }; static void totp_cli_print_unknown_command(const FuriString* unknown_command) { @@ -28,59 +32,119 @@ static void totp_cli_print_unknown_command(const FuriString* unknown_command) { furi_string_get_cstr(unknown_command)); } +static void run_external_cli_plugin_handler( + const char* handler_name, + TotpCliContext* cli_context, + FuriString* args, + Cli* cli) { + Storage* storage = furi_record_open(RECORD_STORAGE); + FlipperApplication* plugin_app = flipper_application_alloc( + storage, composite_api_resolver_get(cli_context->plugin_api_resolver)); + do { + FuriString* full_handler_path = + furi_string_alloc_printf(EXT_PATH("apps_data/totp/plugins/%s.fal"), handler_name); + FlipperApplicationPreloadStatus preload_res = + flipper_application_preload(plugin_app, furi_string_get_cstr(full_handler_path)); + furi_string_free(full_handler_path); + + if(preload_res != FlipperApplicationPreloadStatusSuccess) { + TOTP_CLI_PRINTF_ERROR("Failed to preload plugin. Code: %d\r\n", preload_res); + break; + } + + if(!flipper_application_is_plugin(plugin_app)) { + TOTP_CLI_PRINTF_ERROR("Plugin file is not a library\r\n"); + break; + } + + FlipperApplicationLoadStatus load_status = flipper_application_map_to_memory(plugin_app); + if(load_status != FlipperApplicationLoadStatusSuccess) { + TOTP_CLI_PRINTF_ERROR("Failed to load plugin file. Code %d\r\n", load_status); + break; + } + + const FlipperAppPluginDescriptor* app_descriptor = + flipper_application_plugin_get_descriptor(plugin_app); + + if(strcmp(app_descriptor->appid, PLUGIN_APP_ID) != 0) { + TOTP_CLI_PRINTF_ERROR("Plugin doesn't seems to be a valid TOTP CLI plugin\r\n"); + break; + } + + if(app_descriptor->ep_api_version != PLUGIN_API_VERSION) { + TOTP_CLI_PRINTF_ERROR( + "Plugin version %" PRIu32 " is not compatible with your app version\r\n", + app_descriptor->ep_api_version); + break; + } + + const CliPlugin* plugin = app_descriptor->entry_point; + + plugin->handle(cli_context->plugin_state, args, cli); + } while(false); + flipper_application_free(plugin_app); + + furi_record_close(RECORD_STORAGE); +} + static void totp_cli_handler(Cli* cli, FuriString* args, void* context) { TotpCliContext* cli_context = context; - PluginState* plugin_state = cli_context->plugin_state; FuriString* cmd = furi_string_alloc(); args_read_string_and_trim(args, cmd); + const char* external_plugin_name = NULL; + if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_HELP) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_HELP_ALT) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_HELP_ALT2) == 0 || furi_string_empty(cmd)) { - totp_cli_command_help_handle(); + external_plugin_name = TOTP_CLI_PLUGIN_HELP_FILE_NAME; } else if( furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_ADD) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_ADD_ALT) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_ADD_ALT2) == 0) { - totp_cli_command_add_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_ADD_FILE_NAME; } else if( furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_LIST) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_LIST_ALT) == 0) { - totp_cli_command_list_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_LIST_FILE_NAME; } else if( furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_DELETE) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_DELETE_ALT) == 0) { - totp_cli_command_delete_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_DELETE_FILE_NAME; } else if( furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_TIMEZONE) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_TIMEZONE_ALT) == 0) { - totp_cli_command_timezone_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_TIMEZONE_FILE_NAME; } else if( furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_MOVE) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_MOVE_ALT) == 0) { - totp_cli_command_move_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_MOVE_FILE_NAME; } else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_PIN) == 0) { - totp_cli_command_pin_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_PIN_FILE_NAME; } else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_NOTIFICATION) == 0) { - totp_cli_command_notification_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_NOTIFICATION_FILE_NAME; } else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_AUTOMATION) == 0) { - totp_cli_command_automation_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_AUTOMATION_FILE_NAME; } else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_RESET) == 0) { - totp_cli_command_reset_handle(plugin_state, cli); + external_plugin_name = TOTP_CLI_PLUGIN_RESET_FILE_NAME; } else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_UPDATE) == 0) { - totp_cli_command_update_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_UPDATE_FILE_NAME; } else if( furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_DETAILS) == 0 || furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_DETAILS_ALT) == 0) { - totp_cli_command_details_handle(plugin_state, args, cli); + external_plugin_name = TOTP_CLI_PLUGIN_DETAILS_FILE_NAME; } else if(furi_string_cmp_str(cmd, TOTP_CLI_COMMAND_VERSION) == 0) { - totp_cli_command_version_handle(); + external_plugin_name = TOTP_CLI_PLUGIN_VERSION_FILE_NAME; } else { totp_cli_print_unknown_command(cmd); } + if(external_plugin_name != NULL) { + run_external_cli_plugin_handler(external_plugin_name, cli_context, args, cli); + } + furi_string_free(cmd); } @@ -89,6 +153,11 @@ TotpCliContext* totp_cli_register_command_handler(PluginState* plugin_state) { TotpCliContext* context = malloc(sizeof(TotpCliContext)); furi_check(context != NULL); context->plugin_state = plugin_state; + + context->plugin_api_resolver = composite_api_resolver_alloc(); + composite_api_resolver_add(context->plugin_api_resolver, firmware_api_interface); + composite_api_resolver_add(context->plugin_api_resolver, application_api_interface); + cli_add_command( cli, TOTP_CLI_COMMAND_NAME, CliCommandFlagParallelSafe, totp_cli_handler, context); furi_record_close(RECORD_CLI); @@ -98,6 +167,9 @@ TotpCliContext* totp_cli_register_command_handler(PluginState* plugin_state) { void totp_cli_unregister_command_handler(TotpCliContext* context) { Cli* cli = furi_record_open(RECORD_CLI); cli_delete_command(cli, TOTP_CLI_COMMAND_NAME); + + composite_api_resolver_free(context->plugin_api_resolver); + furi_record_close(RECORD_CLI); free(context); } \ No newline at end of file diff --git a/cli/cli_helpers.h b/cli/cli_helpers.h index 9c40bff13ff..830e7c20fa8 100644 --- a/cli/cli_helpers.h +++ b/cli/cli_helpers.h @@ -1,23 +1,17 @@ #pragma once -#include -#include "../types/plugin_state.h" +#include -#define TOTP_CLI_COMMAND_NAME "totp" +#ifdef __cplusplus +extern "C" { +#endif -#define DOCOPT_ARGUMENT(arg) "<" arg ">" -#define DOCOPT_MULTIPLE(arg) arg "..." -#define DOCOPT_OPTIONAL(param) "[" param "]" -#define DOCOPT_REQUIRED(param) "(" param ")" -#define DOCOPT_OPTION(option, value) option " " value -#define DOCOPT_SWITCH(option) option -#define DOCOPT_OPTIONS "[options]" -#define DOCOPT_DEFAULT(val) "[default: " val "]" +#define TOTP_CLI_COMMAND_NAME "totp" -extern const char* TOTP_CLI_COLOR_ERROR; -extern const char* TOTP_CLI_COLOR_WARNING; -extern const char* TOTP_CLI_COLOR_SUCCESS; -extern const char* TOTP_CLI_COLOR_INFO; +#define TOTP_CLI_COLOR_ERROR "91m" +#define TOTP_CLI_COLOR_WARNING "93m" +#define TOTP_CLI_COLOR_SUCCESS "92m" +#define TOTP_CLI_COLOR_INFO "96m" #define TOTP_CLI_PRINTF(format, ...) printf(format, ##__VA_ARGS__) @@ -42,75 +36,30 @@ extern const char* TOTP_CLI_COLOR_INFO; totp_scene_director_activate_scene(plugin_state, __previous_scene); \ totp_scene_director_force_redraw(plugin_state) -/** - * @brief Checks whether user is authenticated and entered correct PIN. - * If user is not authenticated it prompts user to enter correct PIN to authenticate. - * @param plugin_state application state - * @param cli pointer to the firmware CLI subsystem - * @return \c true if user is already authenticated or successfully authenticated; \c false otherwise - */ -bool totp_cli_ensure_authenticated(const PluginState* plugin_state, Cli* cli); - -/** - * @brief Forces application to be instantly closed - * @param event_queue main app queue - */ -void totp_cli_force_close_app(FuriMessageQueue* event_queue); - -/** - * @brief Reads line of characters from console - * @param cli pointer to the firmware CLI subsystem - * @param out_str pointer to an output string to put read line to - * @param mask_user_input whether to mask input characters in console or not - * @return \c true if line successfully read and confirmed; \c false otherwise - */ -bool totp_cli_read_line(Cli* cli, FuriString* out_str, bool mask_user_input); - -/** - * @brief Extracts \c uint8_t value and trims arguments string - * @param args arguments string - * @param[out] value parsed value - * @return \c true if value successfully read and parsed as \c uint8_t ; \c false otherwise - */ -bool args_read_uint8_and_trim(FuriString* args, uint8_t* value); - -/** - * @brief Free \c FuriString instance in a secure manner by clearing it first - * @param str instance to free - */ -void furi_string_secure_free(FuriString* str); - -/** - * @brief Deletes last printed line in console - */ -void totp_cli_delete_last_line(); - -/** - * @brief Deletes current printed line in console - */ -void totp_cli_delete_current_line(); - -/** - * @brief Deletes last printed char in console - */ -void totp_cli_delete_last_char(); - -/** - * @brief Prints error message about invalid command arguments - */ -void totp_cli_print_invalid_arguments(); - -/** - * @brief Prints error message about config file update error - */ -void totp_cli_print_error_updating_config_file(); - -/** - * @brief Prints error message about config file loading error - */ -void totp_cli_print_error_loading_token_info(); - -/** - * @brief Prints message to let user know that command is processing now - */ -void totp_cli_print_processing(); \ No newline at end of file +#define TOTP_CLI_PRINT_INVALID_ARGUMENTS() \ + TOTP_CLI_PRINTF_ERROR( \ + "Invalid command arguments. use \"help\" command to get list of available commands") + +#define TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE() \ + TOTP_CLI_PRINTF_ERROR("An error has occurred during updating config file\r\n") + +#define TOTP_CLI_PRINT_ERROR_LOADING_TOKEN_INFO() \ + TOTP_CLI_PRINTF_ERROR("An error has occurred during loading token information\r\n") + +#define TOTP_CLI_PRINT_PROCESSING() TOTP_CLI_PRINTF("Processing, please wait...\r\n") + +#define TOTP_CLI_DELETE_LAST_CHAR() \ + TOTP_CLI_PRINTF("\b \b"); \ + fflush(stdout) + +#define TOTP_CLI_DELETE_CURRENT_LINE() \ + TOTP_CLI_PRINTF("\33[2K\r"); \ + fflush(stdout) + +#define TOTP_CLI_DELETE_LAST_LINE() \ + TOTP_CLI_PRINTF("\033[A\33[2K\r"); \ + fflush(stdout) + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/cli/cli_plugin_interface.h b/cli/cli_plugin_interface.h new file mode 100644 index 00000000000..6036019771e --- /dev/null +++ b/cli/cli_plugin_interface.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include +#include "../types/plugin_state.h" + +#define PLUGIN_APP_ID "totp_cli" +#define PLUGIN_API_VERSION 1 + +typedef struct { + const char* name; + void (*handle)(PluginState*, FuriString*, Cli*); +} CliPlugin; diff --git a/cli/cli_helpers.c b/cli/cli_shared_methods.c similarity index 71% rename from cli/cli_helpers.c rename to cli/cli_shared_methods.c index 22691723720..0a76298be51 100644 --- a/cli/cli_helpers.c +++ b/cli/cli_shared_methods.c @@ -1,13 +1,9 @@ -#include "cli_helpers.h" +#include "cli_shared_methods.h" #include #include +#include "cli_helpers.h" #include "../types/plugin_event.h" -const char* TOTP_CLI_COLOR_ERROR = "91m"; -const char* TOTP_CLI_COLOR_WARNING = "93m"; -const char* TOTP_CLI_COLOR_SUCCESS = "92m"; -const char* TOTP_CLI_COLOR_INFO = "96m"; - bool totp_cli_ensure_authenticated(const PluginState* plugin_state, Cli* cli) { if(plugin_state->current_scene == TotpSceneAuthentication) { TOTP_CLI_PRINTF("Pleases enter PIN on your flipper device\r\n"); @@ -18,7 +14,7 @@ bool totp_cli_ensure_authenticated(const PluginState* plugin_state, Cli* cli) { furi_delay_ms(100); } - totp_cli_delete_last_line(); + TOTP_CLI_DELETE_LAST_LINE(); if(plugin_state->current_scene == TotpSceneAuthentication || //-V560 plugin_state->current_scene == TotpSceneNone) { //-V560 @@ -60,7 +56,7 @@ bool totp_cli_read_line(Cli* cli, FuriString* out_str, bool mask_user_input) { } else if(c == CliSymbolAsciiBackspace || c == CliSymbolAsciiDel) { size_t out_str_size = furi_string_size(out_str); if(out_str_size > 0) { - totp_cli_delete_last_char(); + TOTP_CLI_DELETE_LAST_CHAR(); furi_string_left(out_str, out_str_size - 1); } } else if(c == CliSymbolAsciiCR) { @@ -90,34 +86,10 @@ void furi_string_secure_free(FuriString* str) { furi_string_free(str); } -void totp_cli_print_invalid_arguments() { - TOTP_CLI_PRINTF_ERROR( - "Invalid command arguments. use \"help\" command to get list of available commands"); -} - -void totp_cli_print_error_updating_config_file() { - TOTP_CLI_PRINTF_ERROR("An error has occurred during updating config file\r\n"); -} - -void totp_cli_print_error_loading_token_info() { - TOTP_CLI_PRINTF_ERROR("An error has occurred during loading token information\r\n"); +void totp_cli_printf_missed_argument_value(char* arg) { + TOTP_CLI_PRINTF_ERROR("Missed or incorrect value for argument \"%s\"\r\n", arg); } -void totp_cli_print_processing() { - TOTP_CLI_PRINTF("Processing, please wait...\r\n"); -} - -void totp_cli_delete_last_char() { - TOTP_CLI_PRINTF("\b \b"); - fflush(stdout); -} - -void totp_cli_delete_current_line() { - TOTP_CLI_PRINTF("\33[2K\r"); - fflush(stdout); -} - -void totp_cli_delete_last_line() { - TOTP_CLI_PRINTF("\033[A\33[2K\r"); - fflush(stdout); -} +void totp_cli_printf_unknown_argument(const FuriString* arg) { + TOTP_CLI_PRINTF("Unknown argument \"%s\"\r\n", furi_string_get_cstr(arg)); +} \ No newline at end of file diff --git a/cli/cli_shared_methods.h b/cli/cli_shared_methods.h new file mode 100644 index 00000000000..3c706ce0f13 --- /dev/null +++ b/cli/cli_shared_methods.h @@ -0,0 +1,62 @@ +#pragma once + +#include +#include "../types/plugin_state.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Checks whether user is authenticated and entered correct PIN. + * If user is not authenticated it prompts user to enter correct PIN to authenticate. + * @param plugin_state application state + * @param cli pointer to the firmware CLI subsystem + * @return \c true if user is already authenticated or successfully authenticated; \c false otherwise + */ +bool totp_cli_ensure_authenticated(const PluginState* plugin_state, Cli* cli); + +/** + * @brief Forces application to be instantly closed + * @param event_queue main app queue + */ +void totp_cli_force_close_app(FuriMessageQueue* event_queue); + +/** + * @brief Reads line of characters from console + * @param cli pointer to the firmware CLI subsystem + * @param out_str pointer to an output string to put read line to + * @param mask_user_input whether to mask input characters in console or not + * @return \c true if line successfully read and confirmed; \c false otherwise + */ +bool totp_cli_read_line(Cli* cli, FuriString* out_str, bool mask_user_input); + +/** + * @brief Extracts \c uint8_t value and trims arguments string + * @param args arguments string + * @param[out] value parsed value + * @return \c true if value successfully read and parsed as \c uint8_t ; \c false otherwise + */ +bool args_read_uint8_and_trim(FuriString* args, uint8_t* value); + +/** + * @brief Free \c FuriString instance in a secure manner by clearing it first + * @param str instance to free + */ +void furi_string_secure_free(FuriString* str); + +/** + * @brief Prints information about unknown argument + * @param arg + */ +void totp_cli_printf_unknown_argument(const FuriString* arg); + +/** + * @brief Prints information about missed required argument + * @param arg + */ +void totp_cli_printf_missed_argument_value(char* arg); + +#ifdef __cplusplus +} +#endif diff --git a/cli/commands/add/add.c b/cli/commands/add/add.c deleted file mode 100644 index 5e5435eecde..00000000000 --- a/cli/commands/add/add.c +++ /dev/null @@ -1,192 +0,0 @@ -#include "add.h" -#include -#include -#include "../../../types/token_info.h" -#include "../../../services/config/config.h" -#include "../../../services/convert/convert.h" -#include "../../cli_helpers.h" -#include "../../../ui/scene_director.h" -#include "../../common_command_arguments.h" - -struct TotpAddContext { - FuriString* args; - Cli* cli; - const CryptoSettings* crypto_settings; -}; - -enum TotpIteratorUpdateTokenResultsEx { - TotpIteratorUpdateTokenResultInvalidSecret = 1, - TotpIteratorUpdateTokenResultCancelled = 2, - TotpIteratorUpdateTokenResultInvalidArguments = 3 -}; - -static TotpIteratorUpdateTokenResult - add_token_handler(TokenInfo* token_info, const void* context) { - const struct TotpAddContext* context_t = context; - - // Reading token name - if(!args_read_probably_quoted_string_and_trim(context_t->args, token_info->name)) { - return TotpIteratorUpdateTokenResultInvalidArguments; - } - - FuriString* temp_str = furi_string_alloc(); - - // Read optional arguments - bool mask_user_input = true; - PlainTokenSecretEncoding token_secret_encoding = PlainTokenSecretEncodingBase32; - while(args_read_string_and_trim(context_t->args, temp_str)) { - bool parsed = false; - if(!totp_cli_try_read_algo(token_info, temp_str, context_t->args, &parsed) && - !totp_cli_try_read_digits(token_info, temp_str, context_t->args, &parsed) && - !totp_cli_try_read_duration(token_info, temp_str, context_t->args, &parsed) && - !totp_cli_try_read_unsecure_flag(temp_str, &parsed, &mask_user_input) && - !totp_cli_try_read_automation_features(token_info, temp_str, context_t->args, &parsed) && - !totp_cli_try_read_plain_token_secret_encoding( - temp_str, context_t->args, &parsed, &token_secret_encoding)) { - totp_cli_printf_unknown_argument(temp_str); - } - - if(!parsed) { - furi_string_free(temp_str); - return TotpIteratorUpdateTokenResultInvalidArguments; - } - } - - // Reading token secret - furi_string_reset(temp_str); - TOTP_CLI_PRINTF("Enter token secret and confirm with [ENTER]:\r\n"); - if(!totp_cli_read_line(context_t->cli, temp_str, mask_user_input)) { - totp_cli_delete_last_line(); - furi_string_secure_free(temp_str); - return TotpIteratorUpdateTokenResultCancelled; - } - - totp_cli_delete_last_line(); - - bool secret_set = token_info_set_secret( - token_info, - furi_string_get_cstr(temp_str), - furi_string_size(temp_str), - token_secret_encoding, - context_t->crypto_settings); - - furi_string_secure_free(temp_str); - - if(!secret_set) { - return TotpIteratorUpdateTokenResultInvalidSecret; - } - - return TotpIteratorUpdateTokenResultSuccess; -} - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_add_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_ADD ", " TOTP_CLI_COMMAND_ADD_ALT - ", " TOTP_CLI_COMMAND_ADD_ALT2 " Add new token\r\n"); -} - -void totp_cli_command_add_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME - " " DOCOPT_REQUIRED(TOTP_CLI_COMMAND_ADD " | " TOTP_CLI_COMMAND_ADD_ALT " | " TOTP_CLI_COMMAND_ADD_ALT2) " " DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_NAME) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_ALGO_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_ALGO))) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_SECRET_ENCODING_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_SECRET_ENCODING))) " " DOCOPT_OPTIONAL( - DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_DIGITS_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_DIGITS))) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_DURATION_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_DURATION))) " " DOCOPT_OPTIONAL(DOCOPT_SWITCH(TOTP_CLI_COMMAND_ARG_UNSECURE_PREFIX)) " " DOCOPT_MULTIPLE(DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_AUTOMATION_FEATURE_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_AUTOMATION_FEATURE)))) "\r\n"); -} - -void totp_cli_command_add_docopt_arguments() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_ARG_NAME " Token name\r\n"); -} - -void totp_cli_command_add_docopt_options() { - TOTP_CLI_PRINTF(" " DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_ALGO_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_ALGO)) " Token hashing algorithm. Must be one of: " TOKEN_HASH_ALGO_SHA1_NAME - ", " TOKEN_HASH_ALGO_SHA256_NAME - ", " TOKEN_HASH_ALGO_SHA512_NAME - ", " TOKEN_HASH_ALGO_STEAM_NAME - " " DOCOPT_DEFAULT(TOKEN_HASH_ALGO_SHA1_NAME) "\r\n"); - TOTP_CLI_PRINTF( - " " DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_DIGITS_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_DIGITS)) " Number of digits to generate, one of: %" PRIu8 - ", %" PRIu8 ", %" PRIu8 - " " DOCOPT_DEFAULT("%" PRIu8) "\r\n", - TokenDigitsCountFive, - TokenDigitsCountSix, - TokenDigitsCountEight, - TokenDigitsCountSix); - - TOTP_CLI_PRINTF(" " DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_SECRET_ENCODING_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_SECRET_ENCODING)) " Token secret encoding, one of " PLAIN_TOKEN_ENCODING_BASE32_NAME - ", " PLAIN_TOKEN_ENCODING_BASE64_NAME - " " DOCOPT_DEFAULT( - PLAIN_TOKEN_ENCODING_BASE32_NAME) "\r\n"); - - TOTP_CLI_PRINTF( - " " DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_DURATION_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_DURATION)) " Token lifetime duration in seconds, between: %" PRIu8 - " and %" PRIu8 - " " DOCOPT_DEFAULT("%" PRIu8) "\r\n", - TokenDurationMin, - TokenDurationMax, - TokenDurationDefault); - TOTP_CLI_PRINTF(" " DOCOPT_SWITCH( - TOTP_CLI_COMMAND_ARG_UNSECURE_PREFIX) " Show console user input as-is without masking\r\n"); - TOTP_CLI_PRINTF(" " DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_AUTOMATION_FEATURE_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_AUTOMATION_FEATURE)) " Token automation features to be enabled. Must be one of: " TOKEN_AUTOMATION_FEATURE_NONE_NAME - ", " TOKEN_AUTOMATION_FEATURE_ENTER_AT_THE_END_NAME - ", " TOKEN_AUTOMATION_FEATURE_TAB_AT_THE_END_NAME - " " DOCOPT_DEFAULT( - TOKEN_AUTOMATION_FEATURE_NONE_NAME) "\r\n"); - TOTP_CLI_PRINTF(" # " TOKEN_AUTOMATION_FEATURE_NONE_NAME " - No features\r\n"); - TOTP_CLI_PRINTF(" # " TOKEN_AUTOMATION_FEATURE_ENTER_AT_THE_END_NAME - " - Type key at the end of token input automation\r\n"); - TOTP_CLI_PRINTF(" # " TOKEN_AUTOMATION_FEATURE_TAB_AT_THE_END_NAME - " - Type key at the end of token input automation\r\n"); - TOTP_CLI_PRINTF(" # " TOKEN_AUTOMATION_FEATURE_TYPE_SLOWER_NAME - " - Type slower\r\n"); -} -#endif - -void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { - if(!totp_cli_ensure_authenticated(plugin_state, cli)) { - return; - } - - TokenInfoIteratorContext* iterator_context = - totp_config_get_token_iterator_context(plugin_state); - - TOTP_CLI_LOCK_UI(plugin_state); - - struct TotpAddContext add_context = { - .args = args, .cli = cli, .crypto_settings = &plugin_state->crypto_settings}; - TotpIteratorUpdateTokenResult add_result = - totp_token_info_iterator_add_new_token(iterator_context, &add_token_handler, &add_context); - - if(add_result == TotpIteratorUpdateTokenResultSuccess) { - TOTP_CLI_PRINTF_SUCCESS( - "Token \"%s\" has been successfully added\r\n", - furi_string_get_cstr( - totp_token_info_iterator_get_current_token(iterator_context)->name)); - } else if(add_result == TotpIteratorUpdateTokenResultCancelled) { - TOTP_CLI_PRINTF_INFO("Cancelled by user\r\n"); - } else if(add_result == TotpIteratorUpdateTokenResultInvalidArguments) { - totp_cli_print_invalid_arguments(); - } else if(add_result == TotpIteratorUpdateTokenResultInvalidSecret) { - TOTP_CLI_PRINTF_ERROR("Token secret seems to be invalid and can not be parsed\r\n"); - } else if(add_result == TotpIteratorUpdateTokenResultFileUpdateFailed) { - totp_cli_print_error_updating_config_file(); - } - - TOTP_CLI_UNLOCK_UI(plugin_state); -} \ No newline at end of file diff --git a/cli/commands/add/add.h b/cli/commands/add/add.h deleted file mode 100644 index ac2006c1295..00000000000 --- a/cli/commands/add/add.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include -#include "../../../config/app/config.h" -#include "../../../types/plugin_state.h" - -#define TOTP_CLI_COMMAND_ADD "add" -#define TOTP_CLI_COMMAND_ADD_ALT "mk" -#define TOTP_CLI_COMMAND_ADD_ALT2 "new" - -void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_add_docopt_commands(); -void totp_cli_command_add_docopt_usage(); -void totp_cli_command_add_docopt_arguments(); -void totp_cli_command_add_docopt_options(); -#endif \ No newline at end of file diff --git a/cli/commands/automation/automation.h b/cli/commands/automation/automation.h deleted file mode 100644 index 522bfc5600a..00000000000 --- a/cli/commands/automation/automation.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_AUTOMATION "automation" - -void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_automation_docopt_commands(); -void totp_cli_command_automation_docopt_usage(); -void totp_cli_command_automation_docopt_arguments(); -void totp_cli_command_automation_docopt_options(); -#endif \ No newline at end of file diff --git a/cli/commands/delete/delete.h b/cli/commands/delete/delete.h deleted file mode 100644 index 98b15e59557..00000000000 --- a/cli/commands/delete/delete.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_DELETE "delete" -#define TOTP_CLI_COMMAND_DELETE_ALT "rm" - -void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_delete_docopt_commands(); -void totp_cli_command_delete_docopt_usage(); -void totp_cli_command_delete_docopt_arguments(); -void totp_cli_command_delete_docopt_options(); -#endif diff --git a/cli/commands/details/details.h b/cli/commands/details/details.h deleted file mode 100644 index aec1a0184f1..00000000000 --- a/cli/commands/details/details.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_DETAILS "lsattr" -#define TOTP_CLI_COMMAND_DETAILS_ALT "cat" - -void totp_cli_command_details_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_details_docopt_commands(); -void totp_cli_command_details_docopt_usage(); -#endif diff --git a/cli/commands/help/help.c b/cli/commands/help/help.c deleted file mode 100644 index afb21468d74..00000000000 --- a/cli/commands/help/help.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "help.h" -#include "../../cli_helpers.h" -#include "../add/add.h" -#include "../update/update.h" -#include "../delete/delete.h" -#include "../list/list.h" -#include "../timezone/timezone.h" -#include "../move/move.h" -#include "../pin/pin.h" -#include "../notification/notification.h" -#include "../reset/reset.h" -#include "../automation/automation.h" -#include "../details/details.h" -#include "../version/version.h" - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_help_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_HELP ", " TOTP_CLI_COMMAND_HELP_ALT - ", " TOTP_CLI_COMMAND_HELP_ALT2 " Show command usage help\r\n"); -} - -void totp_cli_command_help_docopt_usage() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " DOCOPT_REQUIRED( - TOTP_CLI_COMMAND_HELP " | " TOTP_CLI_COMMAND_HELP_ALT - " | " TOTP_CLI_COMMAND_HELP_ALT2) "\r\n"); -} -#endif - -void totp_cli_command_help_handle() { -#ifdef TOTP_CLI_RICH_HELP_ENABLED - TOTP_CLI_PRINTF("Usage:\r\n"); - totp_cli_command_help_docopt_usage(); - totp_cli_command_version_docopt_usage(); - totp_cli_command_list_docopt_usage(); - totp_cli_command_details_docopt_usage(); - totp_cli_command_add_docopt_usage(); - totp_cli_command_update_docopt_usage(); - totp_cli_command_delete_docopt_usage(); - totp_cli_command_timezone_docopt_usage(); - totp_cli_command_move_docopt_usage(); - totp_cli_command_pin_docopt_usage(); - totp_cli_command_notification_docopt_usage(); - totp_cli_command_reset_docopt_usage(); - totp_cli_command_automation_docopt_usage(); - cli_nl(); - TOTP_CLI_PRINTF("Commands:\r\n"); - totp_cli_command_help_docopt_commands(); - totp_cli_command_version_docopt_commands(); - totp_cli_command_list_docopt_commands(); - totp_cli_command_details_docopt_commands(); - totp_cli_command_add_docopt_commands(); - totp_cli_command_update_docopt_commands(); - totp_cli_command_delete_docopt_commands(); - totp_cli_command_timezone_docopt_commands(); - totp_cli_command_move_docopt_commands(); - totp_cli_command_pin_docopt_commands(); - totp_cli_command_notification_docopt_commands(); - totp_cli_command_reset_docopt_commands(); - totp_cli_command_automation_docopt_commands(); - cli_nl(); - TOTP_CLI_PRINTF("Arguments:\r\n"); - totp_cli_command_add_docopt_arguments(); - totp_cli_command_delete_docopt_arguments(); - totp_cli_command_move_docopt_arguments(); - totp_cli_command_timezone_docopt_arguments(); - totp_cli_command_notification_docopt_arguments(); - totp_cli_command_automation_docopt_arguments(); - cli_nl(); - TOTP_CLI_PRINTF("Options:\r\n"); - totp_cli_command_add_docopt_options(); - totp_cli_command_update_docopt_options(); - totp_cli_command_delete_docopt_options(); - totp_cli_command_pin_docopt_options(); - totp_cli_command_automation_docopt_options(); -#else - TOTP_CLI_PRINTF( - "All the TOTP CLI commands, their arguments, options and usage can be found here https://t.ly/_6pJG"); -#endif -} \ No newline at end of file diff --git a/cli/commands/help/help.h b/cli/commands/help/help.h deleted file mode 100644 index da7c2fd62ae..00000000000 --- a/cli/commands/help/help.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "../../../config/app/config.h" -#include - -#define TOTP_CLI_COMMAND_HELP "help" -#define TOTP_CLI_COMMAND_HELP_ALT "h" -#define TOTP_CLI_COMMAND_HELP_ALT2 "?" - -void totp_cli_command_help_handle(); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_help_docopt_commands(); -void totp_cli_command_help_docopt_usage(); -#endif \ No newline at end of file diff --git a/cli/commands/list/list.h b/cli/commands/list/list.h deleted file mode 100644 index 0527e8c5f36..00000000000 --- a/cli/commands/list/list.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_LIST "list" -#define TOTP_CLI_COMMAND_LIST_ALT "ls" - -void totp_cli_command_list_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_list_docopt_commands(); -void totp_cli_command_list_docopt_usage(); -#endif diff --git a/cli/commands/move/move.h b/cli/commands/move/move.h deleted file mode 100644 index 0dfd90f6bfb..00000000000 --- a/cli/commands/move/move.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_MOVE "move" -#define TOTP_CLI_COMMAND_MOVE_ALT "mv" - -void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_move_docopt_commands(); -void totp_cli_command_move_docopt_usage(); -void totp_cli_command_move_docopt_arguments(); -#endif diff --git a/cli/commands/notification/notification.h b/cli/commands/notification/notification.h deleted file mode 100644 index e4cdb651de4..00000000000 --- a/cli/commands/notification/notification.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_NOTIFICATION "notify" - -void totp_cli_command_notification_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_notification_docopt_commands(); -void totp_cli_command_notification_docopt_usage(); -void totp_cli_command_notification_docopt_arguments(); -#endif \ No newline at end of file diff --git a/cli/commands/pin/pin.h b/cli/commands/pin/pin.h deleted file mode 100644 index 7083535650d..00000000000 --- a/cli/commands/pin/pin.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_PIN "pin" - -void totp_cli_command_pin_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_pin_docopt_commands(); -void totp_cli_command_pin_docopt_usage(); -void totp_cli_command_pin_docopt_options(); -#endif diff --git a/cli/commands/reset/reset.h b/cli/commands/reset/reset.h deleted file mode 100644 index 7f48aa10b64..00000000000 --- a/cli/commands/reset/reset.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_RESET "reset" - -void totp_cli_command_reset_handle(PluginState* plugin_state, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_reset_docopt_commands(); -void totp_cli_command_reset_docopt_usage(); -#endif diff --git a/cli/commands/timezone/timezone.h b/cli/commands/timezone/timezone.h deleted file mode 100644 index 1a697f0671d..00000000000 --- a/cli/commands/timezone/timezone.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_TIMEZONE "timezone" -#define TOTP_CLI_COMMAND_TIMEZONE_ALT "tz" - -void totp_cli_command_timezone_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_timezone_docopt_commands(); -void totp_cli_command_timezone_docopt_usage(); -void totp_cli_command_timezone_docopt_arguments(); -#endif diff --git a/cli/commands/update/update.h b/cli/commands/update/update.h deleted file mode 100644 index 6100f4b3886..00000000000 --- a/cli/commands/update/update.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include "../../../types/plugin_state.h" -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_UPDATE "update" - -void totp_cli_command_update_handle(PluginState* plugin_state, FuriString* args, Cli* cli); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_update_docopt_commands(); -void totp_cli_command_update_docopt_usage(); -void totp_cli_command_update_docopt_options(); -#endif \ No newline at end of file diff --git a/cli/commands/version/version.c b/cli/commands/version/version.c deleted file mode 100644 index a4e101db118..00000000000 --- a/cli/commands/version/version.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "version.h" -#include "../../cli_helpers.h" -#include "../../../version.h" - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_version_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_VERSION " Get application version\r\n"); -} -void totp_cli_command_version_docopt_usage() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " TOTP_CLI_COMMAND_VERSION "\r\n"); -} -#endif - -void totp_cli_command_version_handle() { - TOTP_CLI_PRINTF( - "%" PRIu8 ".%" PRIu8 ".%" PRIu8 "\r\n", - TOTP_APP_VERSION_MAJOR, - TOTP_APP_VERSION_MINOR, - TOTP_APP_VERSION_PATCH); -} \ No newline at end of file diff --git a/cli/commands/version/version.h b/cli/commands/version/version.h deleted file mode 100644 index b3a21d9767a..00000000000 --- a/cli/commands/version/version.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "../../../config/app/config.h" - -#define TOTP_CLI_COMMAND_VERSION "version" - -void totp_cli_command_version_handle(); -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_version_docopt_commands(); -void totp_cli_command_version_docopt_usage(); -#endif \ No newline at end of file diff --git a/cli/commands/automation/automation.c b/cli/plugins/automation/automation.c similarity index 74% rename from cli/commands/automation/automation.c rename to cli/plugins/automation/automation.c index 19cf58f8ecf..d706fc24006 100644 --- a/cli/commands/automation/automation.c +++ b/cli/plugins/automation/automation.c @@ -1,8 +1,11 @@ -#include "automation.h" +#include #include +#include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" #include "../../../services/config/config.h" #include "../../../ui/scene_director.h" -#include "../../cli_helpers.h" +#include "../../../config/app/config.h" #define TOTP_CLI_COMMAND_AUTOMATION_ARG_METHOD "automation" #define TOTP_CLI_COMMAND_AUTOMATION_METHOD_NONE "none" @@ -14,41 +17,6 @@ #define TOTP_CLI_COMMAND_AUTOMATION_LAYOUT_AZERTY "AZERTY" #define TOTP_CLI_COMMAND_AUTOMATION_LAYOUT_QWERTZ "QWERTZ" #define TOTP_CLI_COMMAND_AUTOMATION_ARG_KB_LAYOUT_PREFIX "-k" -#define TOTP_CLI_COMMAND_AUTOMATION_ARG_KB_LAYOUT "layout" - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_automation_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_AUTOMATION " Get or set automation settings\r\n"); -} - -void totp_cli_command_automation_docopt_usage() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " TOTP_CLI_COMMAND_AUTOMATION " " DOCOPT_OPTIONAL(DOCOPT_OPTION( - TOTP_CLI_COMMAND_AUTOMATION_ARG_KB_LAYOUT_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_AUTOMATION_ARG_KB_LAYOUT))) " " DOCOPT_OPTIONAL(DOCOPT_MULTIPLE(DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_AUTOMATION_ARG_METHOD))) "\r\n"); -} - -void totp_cli_command_automation_docopt_arguments() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_AUTOMATION_ARG_METHOD - " Automation method to be set. Must be one of: " TOTP_CLI_COMMAND_AUTOMATION_METHOD_NONE - ", " TOTP_CLI_COMMAND_AUTOMATION_METHOD_USB -#ifdef TOTP_BADBT_AUTOMATION_ENABLED - ", " TOTP_CLI_COMMAND_AUTOMATION_METHOD_BT -#endif - "\r\n"); -} - -void totp_cli_command_automation_docopt_options() { - TOTP_CLI_PRINTF(" " DOCOPT_OPTION( - TOTP_CLI_COMMAND_AUTOMATION_ARG_KB_LAYOUT_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_AUTOMATION_ARG_KB_LAYOUT)) " Automation keyboard layout. Must be one of: " TOTP_CLI_COMMAND_AUTOMATION_LAYOUT_QWERTY - ", " TOTP_CLI_COMMAND_AUTOMATION_LAYOUT_AZERTY - ", " TOTP_CLI_COMMAND_AUTOMATION_LAYOUT_QWERTZ - "\r\n"); -} -#endif static void print_method(AutomationMethod method, const char* color) { #ifdef TOTP_BADBT_AUTOMATION_ENABLED @@ -112,7 +80,7 @@ static bool return result; } -void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -150,7 +118,7 @@ void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* a do { if(!args_valid) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); break; } @@ -167,7 +135,7 @@ void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* a TOTP_CLI_PRINTF_SUCCESS(")"); cli_nl(); } else { - totp_cli_print_error_updating_config_file(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); } #ifdef TOTP_BADBT_AUTOMATION_ENABLED @@ -190,4 +158,16 @@ void totp_cli_command_automation_handle(PluginState* plugin_state, FuriString* a } while(false); furi_string_free(temp_str); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Automation", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_automation_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/automation/meta.h b/cli/plugins/automation/meta.h new file mode 100644 index 00000000000..2f7951ef042 --- /dev/null +++ b/cli/plugins/automation/meta.h @@ -0,0 +1,4 @@ +#pragma once + +#define TOTP_CLI_COMMAND_AUTOMATION "automation" +#define TOTP_CLI_PLUGIN_AUTOMATION_FILE_NAME "totp_cli_automation_plugin" \ No newline at end of file diff --git a/cli/commands/delete/delete.c b/cli/plugins/delete/delete.c similarity index 66% rename from cli/commands/delete/delete.c rename to cli/plugins/delete/delete.c index d9cea4803f9..f417c944aab 100644 --- a/cli/commands/delete/delete.c +++ b/cli/plugins/delete/delete.c @@ -1,39 +1,14 @@ -#include "delete.h" - -#include -#include +#include #include -#include "../../../services/config/config.h" #include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" +#include "../../../services/config/config.h" #include "../../../ui/scene_director.h" -#include "../../common_command_arguments.h" #define TOTP_CLI_COMMAND_DELETE_ARG_FORCE_PREFIX "-f" -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_delete_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_DELETE ", " TOTP_CLI_COMMAND_DELETE_ALT - " Delete existing token\r\n"); -} - -void totp_cli_command_delete_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME - " " DOCOPT_REQUIRED(TOTP_CLI_COMMAND_DELETE " | " TOTP_CLI_COMMAND_DELETE_ALT) " " DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_INDEX) " " DOCOPT_OPTIONAL(DOCOPT_SWITCH(TOTP_CLI_COMMAND_DELETE_ARG_FORCE_PREFIX)) "\r\n"); -} - -void totp_cli_command_delete_docopt_arguments() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_ARG_INDEX " Token index in the list\r\n"); -} - -void totp_cli_command_delete_docopt_options() { - TOTP_CLI_PRINTF(" " DOCOPT_SWITCH( - TOTP_CLI_COMMAND_DELETE_ARG_FORCE_PREFIX) " Force command to do not ask user for interactive confirmation\r\n"); -} -#endif - -void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -44,7 +19,7 @@ void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, int token_number; if(!args_read_int_and_trim(args, &token_number) || token_number <= 0 || (size_t)token_number > totp_token_info_iterator_get_total_count(iterator_context)) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); return; } @@ -55,7 +30,7 @@ void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, confirm_needed = false; } else { totp_cli_printf_unknown_argument(temp_str); - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); furi_string_free(temp_str); return; } @@ -88,15 +63,15 @@ void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, } if(confirmed) { - totp_cli_print_processing(); + TOTP_CLI_PRINT_PROCESSING(); if(totp_token_info_iterator_remove_current_token_info(iterator_context)) { - totp_cli_delete_last_line(); + TOTP_CLI_DELETE_LAST_LINE(); TOTP_CLI_PRINTF_SUCCESS( "Token \"%s\" has been successfully deleted\r\n", token_info_name); totp_token_info_iterator_go_to(iterator_context, 0); } else { - totp_cli_delete_last_line(); - totp_cli_print_error_updating_config_file(); + TOTP_CLI_DELETE_LAST_LINE(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); totp_token_info_iterator_go_to(iterator_context, original_token_index); } } else { @@ -105,4 +80,16 @@ void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, } TOTP_CLI_UNLOCK_UI(plugin_state); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Delete", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_delete_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/delete/meta.h b/cli/plugins/delete/meta.h new file mode 100644 index 00000000000..e8b776b9939 --- /dev/null +++ b/cli/plugins/delete/meta.h @@ -0,0 +1,5 @@ +#pragma once + +#define TOTP_CLI_COMMAND_DELETE "delete" +#define TOTP_CLI_COMMAND_DELETE_ALT "rm" +#define TOTP_CLI_PLUGIN_DELETE_FILE_NAME "totp_cli_delete_plugin" \ No newline at end of file diff --git a/cli/commands/details/details.c b/cli/plugins/details/details.c similarity index 87% rename from cli/commands/details/details.c rename to cli/plugins/details/details.c index cc4c9eeff74..7ba2814ed3e 100644 --- a/cli/commands/details/details.c +++ b/cli/plugins/details/details.c @@ -1,12 +1,12 @@ -#include "details.h" -#include +#include #include -#include "../../../types/token_info.h" -#include "../../../services/config/constants.h" #include "../../../services/config/config.h" -#include "../../../ui/scene_director.h" +#include "../../../services/config/constants.h" +#include "../../../types/token_info.h" #include "../../cli_helpers.h" -#include "../../common_command_arguments.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" +#include "../../../ui/scene_director.h" #include "formatters/table/details_output_formatter_table.h" #include "formatters/tsv/details_output_formatter_tsv.h" @@ -72,20 +72,7 @@ static void print_automation_features( } } -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_details_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_DETAILS ", " TOTP_CLI_COMMAND_DETAILS_ALT - " Displays token details\r\n"); -} - -void totp_cli_command_details_docopt_usage() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " DOCOPT_REQUIRED( - TOTP_CLI_COMMAND_DETAILS - " | " TOTP_CLI_COMMAND_DETAILS_ALT) " " DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_INDEX) "\r\n"); -} -#endif - -void totp_cli_command_details_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -95,7 +82,7 @@ void totp_cli_command_details_handle(PluginState* plugin_state, FuriString* args totp_config_get_token_iterator_context(plugin_state); if(!args_read_int_and_trim(args, &token_number) || token_number <= 0 || (size_t)token_number > totp_token_info_iterator_get_total_count(iterator_context)) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); return; } @@ -123,10 +110,22 @@ void totp_cli_command_details_handle(PluginState* plugin_state, FuriString* args print_automation_features(token_info, formatter); (*formatter->footer_formatter)(); } else { - totp_cli_print_error_loading_token_info(); + TOTP_CLI_PRINT_ERROR_LOADING_TOKEN_INFO(); } totp_token_info_iterator_go_to(iterator_context, original_token_index); TOTP_CLI_UNLOCK_UI(plugin_state); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Details", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_details_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/commands/details/formatters/table/details_output_formatter_table.c b/cli/plugins/details/formatters/table/details_output_formatter_table.c similarity index 98% rename from cli/commands/details/formatters/table/details_output_formatter_table.c rename to cli/plugins/details/formatters/table/details_output_formatter_table.c index 44290db6967..d5f832139d0 100644 --- a/cli/commands/details/formatters/table/details_output_formatter_table.c +++ b/cli/plugins/details/formatters/table/details_output_formatter_table.c @@ -1,4 +1,5 @@ #include "details_output_formatter_table.h" +#include #include "../../../../cli_helpers.h" void details_output_formatter_print_header_table() { diff --git a/cli/commands/details/formatters/table/details_output_formatter_table.h b/cli/plugins/details/formatters/table/details_output_formatter_table.h similarity index 100% rename from cli/commands/details/formatters/table/details_output_formatter_table.h rename to cli/plugins/details/formatters/table/details_output_formatter_table.h diff --git a/cli/commands/details/formatters/tsv/details_output_formatter_tsv.c b/cli/plugins/details/formatters/tsv/details_output_formatter_tsv.c similarity index 97% rename from cli/commands/details/formatters/tsv/details_output_formatter_tsv.c rename to cli/plugins/details/formatters/tsv/details_output_formatter_tsv.c index 39e61342c82..7f553552b9e 100644 --- a/cli/commands/details/formatters/tsv/details_output_formatter_tsv.c +++ b/cli/plugins/details/formatters/tsv/details_output_formatter_tsv.c @@ -1,4 +1,5 @@ #include "details_output_formatter_tsv.h" +#include #include "../../../../cli_helpers.h" void details_output_formatter_print_header_tsv() { diff --git a/cli/commands/details/formatters/tsv/details_output_formatter_tsv.h b/cli/plugins/details/formatters/tsv/details_output_formatter_tsv.h similarity index 100% rename from cli/commands/details/formatters/tsv/details_output_formatter_tsv.h rename to cli/plugins/details/formatters/tsv/details_output_formatter_tsv.h diff --git a/cli/plugins/details/meta.h b/cli/plugins/details/meta.h new file mode 100644 index 00000000000..1edf6eb8fc0 --- /dev/null +++ b/cli/plugins/details/meta.h @@ -0,0 +1,5 @@ +#pragma once + +#define TOTP_CLI_COMMAND_DETAILS "lsattr" +#define TOTP_CLI_COMMAND_DETAILS_ALT "cat" +#define TOTP_CLI_PLUGIN_DETAILS_FILE_NAME "totp_cli_details_plugin" \ No newline at end of file diff --git a/cli/plugins/help/help.c b/cli/plugins/help/help.c new file mode 100644 index 00000000000..38ce38c8543 --- /dev/null +++ b/cli/plugins/help/help.c @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include "../../cli_helpers.h" +#include "../../cli_plugin_interface.h" + +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { + UNUSED(args); + UNUSED(cli); + UNUSED(plugin_state); + + Storage* storage = furi_record_open(RECORD_STORAGE); + + Stream* stream = file_stream_alloc(storage); + + if(file_stream_open( + stream, EXT_PATH("apps_assets/totp/cli/cli_help.txt"), FSAM_READ, FSOM_OPEN_EXISTING)) { + uint8_t buffer[32U]; + size_t bytes_read; + while((bytes_read = stream_read(stream, &buffer[0], sizeof(buffer))) > 0) { + cli_write(cli, &buffer[0], bytes_read); + } + } + + file_stream_close(stream); + stream_free(stream); + + furi_record_close(RECORD_STORAGE); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Help", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_help_plugin_ep() { + return &plugin_descriptor; +} \ No newline at end of file diff --git a/cli/plugins/help/meta.h b/cli/plugins/help/meta.h new file mode 100644 index 00000000000..5bb5987528f --- /dev/null +++ b/cli/plugins/help/meta.h @@ -0,0 +1,6 @@ +#pragma once + +#define TOTP_CLI_COMMAND_HELP "help" +#define TOTP_CLI_COMMAND_HELP_ALT "h" +#define TOTP_CLI_COMMAND_HELP_ALT2 "?" +#define TOTP_CLI_PLUGIN_HELP_FILE_NAME "totp_cli_help_plugin" \ No newline at end of file diff --git a/cli/commands/list/formatters/table/list_output_formatter_table.c b/cli/plugins/list/formatters/table/list_output_formatter_table.c similarity index 97% rename from cli/commands/list/formatters/table/list_output_formatter_table.c rename to cli/plugins/list/formatters/table/list_output_formatter_table.c index 8774a6edc46..a72f770a351 100644 --- a/cli/commands/list/formatters/table/list_output_formatter_table.c +++ b/cli/plugins/list/formatters/table/list_output_formatter_table.c @@ -1,4 +1,5 @@ #include "list_output_formatter_table.h" +#include #include "../../../../cli_helpers.h" void list_output_formatter_print_header_table() { diff --git a/cli/commands/list/formatters/table/list_output_formatter_table.h b/cli/plugins/list/formatters/table/list_output_formatter_table.h similarity index 100% rename from cli/commands/list/formatters/table/list_output_formatter_table.h rename to cli/plugins/list/formatters/table/list_output_formatter_table.h diff --git a/cli/commands/list/formatters/tsv/list_output_formatter_tsv.c b/cli/plugins/list/formatters/tsv/list_output_formatter_tsv.c similarity index 96% rename from cli/commands/list/formatters/tsv/list_output_formatter_tsv.c rename to cli/plugins/list/formatters/tsv/list_output_formatter_tsv.c index 2bd4553973d..374231f20df 100644 --- a/cli/commands/list/formatters/tsv/list_output_formatter_tsv.c +++ b/cli/plugins/list/formatters/tsv/list_output_formatter_tsv.c @@ -1,4 +1,5 @@ #include "list_output_formatter_tsv.h" +#include #include "../../../../cli_helpers.h" void list_output_formatter_print_header_tsv() { diff --git a/cli/commands/list/formatters/tsv/list_output_formatter_tsv.h b/cli/plugins/list/formatters/tsv/list_output_formatter_tsv.h similarity index 100% rename from cli/commands/list/formatters/tsv/list_output_formatter_tsv.h rename to cli/plugins/list/formatters/tsv/list_output_formatter_tsv.h diff --git a/cli/commands/list/list.c b/cli/plugins/list/list.c similarity index 81% rename from cli/commands/list/list.c rename to cli/plugins/list/list.c index 1c39f320387..0a8d5b3498a 100644 --- a/cli/commands/list/list.c +++ b/cli/plugins/list/list.c @@ -1,11 +1,13 @@ -#include "list.h" -#include +#include +#include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" + #include #include "../../../types/token_info.h" #include "../../../services/config/constants.h" #include "../../../services/config/config.h" #include "../../../ui/scene_director.h" -#include "../../cli_helpers.h" #include "formatters/table/list_output_formatter_table.h" #include "formatters/tsv/list_output_formatter_tsv.h" @@ -28,19 +30,7 @@ static const TotpCliListFormatter available_formatters[] = { .body_item_formatter = &list_output_formatter_print_body_item_tsv, .footer_formatter = &list_output_formatter_print_footer_tsv}}; -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_list_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_LIST ", " TOTP_CLI_COMMAND_LIST_ALT - " List all available tokens\r\n"); -} - -void totp_cli_command_list_docopt_usage() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " DOCOPT_REQUIRED( - TOTP_CLI_COMMAND_LIST " | " TOTP_CLI_COMMAND_LIST_ALT) "\r\n"); -} -#endif - -void totp_cli_command_list_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -77,4 +67,16 @@ void totp_cli_command_list_handle(PluginState* plugin_state, FuriString* args, C totp_token_info_iterator_go_to(iterator_context, original_index); TOTP_CLI_UNLOCK_UI(plugin_state); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: List", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_list_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/list/meta.h b/cli/plugins/list/meta.h new file mode 100644 index 00000000000..9fa0b080593 --- /dev/null +++ b/cli/plugins/list/meta.h @@ -0,0 +1,5 @@ +#pragma once + +#define TOTP_CLI_COMMAND_LIST "list" +#define TOTP_CLI_COMMAND_LIST_ALT "ls" +#define TOTP_CLI_PLUGIN_LIST_FILE_NAME "totp_cli_list_plugin" \ No newline at end of file diff --git a/cli/plugins/modify/add/add.c b/cli/plugins/modify/add/add.c new file mode 100644 index 00000000000..f0b10a7d56c --- /dev/null +++ b/cli/plugins/modify/add/add.c @@ -0,0 +1,126 @@ +#include +#include +#include "../../../cli_helpers.h" +#include "../../../cli_shared_methods.h" +#include "../../../cli_plugin_interface.h" +#include "../../../../types/token_info.h" +#include "../../../../services/config/config.h" +#include "../../../../services/convert/convert.h" +#include "../../../../ui/scene_director.h" +#include "../common.h" + +struct TotpAddContext { + FuriString* args; + Cli* cli; + const CryptoSettings* crypto_settings; +}; + +enum TotpIteratorUpdateTokenResultsEx { + TotpIteratorUpdateTokenResultInvalidSecret = 1, + TotpIteratorUpdateTokenResultCancelled = 2, + TotpIteratorUpdateTokenResultInvalidArguments = 3 +}; + +static TotpIteratorUpdateTokenResult + add_token_handler(TokenInfo* token_info, const void* context) { + const struct TotpAddContext* context_t = context; + + // Reading token name + if(!args_read_probably_quoted_string_and_trim(context_t->args, token_info->name)) { + return TotpIteratorUpdateTokenResultInvalidArguments; + } + + FuriString* temp_str = furi_string_alloc(); + + // Read optional arguments + bool mask_user_input = true; + PlainTokenSecretEncoding token_secret_encoding = PlainTokenSecretEncodingBase32; + while(args_read_string_and_trim(context_t->args, temp_str)) { + bool parsed = false; + if(!totp_cli_try_read_algo(token_info, temp_str, context_t->args, &parsed) && + !totp_cli_try_read_digits(token_info, temp_str, context_t->args, &parsed) && + !totp_cli_try_read_duration(token_info, temp_str, context_t->args, &parsed) && + !totp_cli_try_read_unsecure_flag(temp_str, &parsed, &mask_user_input) && + !totp_cli_try_read_automation_features(token_info, temp_str, context_t->args, &parsed) && + !totp_cli_try_read_plain_token_secret_encoding( + temp_str, context_t->args, &parsed, &token_secret_encoding)) { + totp_cli_printf_unknown_argument(temp_str); + } + + if(!parsed) { + furi_string_free(temp_str); + return TotpIteratorUpdateTokenResultInvalidArguments; + } + } + + // Reading token secret + furi_string_reset(temp_str); + TOTP_CLI_PRINTF("Enter token secret and confirm with [ENTER]:\r\n"); + if(!totp_cli_read_line(context_t->cli, temp_str, mask_user_input)) { + TOTP_CLI_DELETE_LAST_LINE(); + furi_string_secure_free(temp_str); + return TotpIteratorUpdateTokenResultCancelled; + } + + TOTP_CLI_DELETE_LAST_LINE(); + + bool secret_set = token_info_set_secret( + token_info, + furi_string_get_cstr(temp_str), + furi_string_size(temp_str), + token_secret_encoding, + context_t->crypto_settings); + + furi_string_secure_free(temp_str); + + if(!secret_set) { + return TotpIteratorUpdateTokenResultInvalidSecret; + } + + return TotpIteratorUpdateTokenResultSuccess; +} + +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { + if(!totp_cli_ensure_authenticated(plugin_state, cli)) { + return; + } + + TokenInfoIteratorContext* iterator_context = + totp_config_get_token_iterator_context(plugin_state); + + TOTP_CLI_LOCK_UI(plugin_state); + + struct TotpAddContext add_context = { + .args = args, .cli = cli, .crypto_settings = &plugin_state->crypto_settings}; + TotpIteratorUpdateTokenResult add_result = + totp_token_info_iterator_add_new_token(iterator_context, &add_token_handler, &add_context); + + if(add_result == TotpIteratorUpdateTokenResultSuccess) { + TOTP_CLI_PRINTF_SUCCESS( + "Token \"%s\" has been successfully added\r\n", + furi_string_get_cstr( + totp_token_info_iterator_get_current_token(iterator_context)->name)); + } else if(add_result == TotpIteratorUpdateTokenResultCancelled) { + TOTP_CLI_PRINTF_INFO("Cancelled by user\r\n"); + } else if(add_result == TotpIteratorUpdateTokenResultInvalidArguments) { + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); + } else if(add_result == TotpIteratorUpdateTokenResultInvalidSecret) { + TOTP_CLI_PRINTF_ERROR("Token secret seems to be invalid and can not be parsed\r\n"); + } else if(add_result == TotpIteratorUpdateTokenResultFileUpdateFailed) { + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); + } + + TOTP_CLI_UNLOCK_UI(plugin_state); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Add", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_add_plugin_ep() { + return &plugin_descriptor; +} \ No newline at end of file diff --git a/cli/plugins/modify/add/meta.h b/cli/plugins/modify/add/meta.h new file mode 100644 index 00000000000..e9033bd36e8 --- /dev/null +++ b/cli/plugins/modify/add/meta.h @@ -0,0 +1,6 @@ +#pragma once + +#define TOTP_CLI_COMMAND_ADD "add" +#define TOTP_CLI_COMMAND_ADD_ALT "mk" +#define TOTP_CLI_COMMAND_ADD_ALT2 "new" +#define TOTP_CLI_PLUGIN_ADD_FILE_NAME "totp_cli_add_plugin" \ No newline at end of file diff --git a/cli/common_command_arguments.c b/cli/plugins/modify/common.c similarity index 93% rename from cli/common_command_arguments.c rename to cli/plugins/modify/common.c index c3129a157d4..60d30b2541e 100644 --- a/cli/common_command_arguments.c +++ b/cli/plugins/modify/common.c @@ -1,13 +1,8 @@ -#include "common_command_arguments.h" +#include "common.h" #include - -void totp_cli_printf_missed_argument_value(char* arg) { - TOTP_CLI_PRINTF_ERROR("Missed or incorrect value for argument \"%s\"\r\n", arg); -} - -void totp_cli_printf_unknown_argument(const FuriString* arg) { - TOTP_CLI_PRINTF("Unknown argument \"%s\"\r\n", furi_string_get_cstr(arg)); -} +#include "stdint.h" +#include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" bool totp_cli_try_read_algo(TokenInfo* token_info, FuriString* arg, FuriString* args, bool* parsed) { if(furi_string_cmpi_str(arg, TOTP_CLI_COMMAND_ARG_ALGO_PREFIX) == 0) { diff --git a/cli/common_command_arguments.h b/cli/plugins/modify/common.h similarity index 91% rename from cli/common_command_arguments.h rename to cli/plugins/modify/common.h index 0bf83422595..9938e18a4a2 100644 --- a/cli/common_command_arguments.h +++ b/cli/plugins/modify/common.h @@ -1,7 +1,10 @@ #pragma once #include -#include "../types/token_info.h" -#include "cli_helpers.h" +#include "../../../types/token_info.h" + +#ifdef __cplusplus +extern "C" { +#endif #define TOTP_CLI_COMMAND_ARG_NAME "name" #define TOTP_CLI_COMMAND_ARG_NAME_PREFIX "-n" @@ -18,18 +21,6 @@ #define TOTP_CLI_COMMAND_ARG_SECRET_ENCODING_PREFIX "-e" #define TOTP_CLI_COMMAND_ARG_SECRET_ENCODING "encoding" -/** - * @brief Prints information about unknown argument - * @param arg - */ -void totp_cli_printf_unknown_argument(const FuriString* arg); - -/** - * @brief Prints information about missed required argument - * @param arg - */ -void totp_cli_printf_missed_argument_value(char* arg); - /** * @brief Tries to read token hashing algo * @param token_info token info to set parsed algo to if successfully read and parsed @@ -103,4 +94,8 @@ bool totp_cli_try_read_plain_token_secret_encoding( FuriString* arg, FuriString* args, bool* parsed, - PlainTokenSecretEncoding* secret_encoding); \ No newline at end of file + PlainTokenSecretEncoding* secret_encoding); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/cli/plugins/modify/update/meta.h b/cli/plugins/modify/update/meta.h new file mode 100644 index 00000000000..00303eb8846 --- /dev/null +++ b/cli/plugins/modify/update/meta.h @@ -0,0 +1,4 @@ +#pragma once + +#define TOTP_CLI_COMMAND_UPDATE "update" +#define TOTP_CLI_PLUGIN_UPDATE_FILE_NAME "totp_cli_update_plugin" \ No newline at end of file diff --git a/cli/commands/update/update.c b/cli/plugins/modify/update/update.c similarity index 70% rename from cli/commands/update/update.c rename to cli/plugins/modify/update/update.c index 5c1553d8714..1311c80633a 100644 --- a/cli/commands/update/update.c +++ b/cli/plugins/modify/update/update.c @@ -1,12 +1,13 @@ -#include "update.h" -#include +#include #include -#include "../../../types/token_info.h" -#include "../../../services/config/config.h" -#include "../../../services/convert/convert.h" -#include "../../cli_helpers.h" -#include "../../../ui/scene_director.h" -#include "../../common_command_arguments.h" +#include "../../../cli_helpers.h" +#include "../../../cli_shared_methods.h" +#include "../../../cli_plugin_interface.h" +#include "../../../../types/token_info.h" +#include "../../../../services/config/config.h" +#include "../../../../services/convert/convert.h" +#include "../../../../ui/scene_director.h" +#include "../common.h" #define TOTP_CLI_COMMAND_UPDATE_ARG_SECRET_PREFIX "-s" @@ -85,7 +86,7 @@ static TotpIteratorUpdateTokenResult furi_string_reset(temp_str); TOTP_CLI_PRINTF("Enter token secret and confirm with [ENTER]:\r\n"); bool token_secret_read = totp_cli_read_line(context_t->cli, temp_str, mask_user_input); - totp_cli_delete_last_line(); + TOTP_CLI_DELETE_LAST_LINE(); if(!token_secret_read) { furi_string_secure_free(temp_str); return TotpIteratorUpdateTokenResultCancelled; @@ -107,32 +108,7 @@ static TotpIteratorUpdateTokenResult return TotpIteratorUpdateTokenResultSuccess; } -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_update_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_UPDATE " Update existing token\r\n"); -} - -void totp_cli_command_update_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME - " " DOCOPT_REQUIRED(TOTP_CLI_COMMAND_UPDATE) " " DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_INDEX) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_ALGO_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_ALGO))) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_SECRET_ENCODING_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_SECRET_ENCODING))) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_NAME_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_NAME))) " " DOCOPT_OPTIONAL( - DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_DIGITS_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_DIGITS))) " " DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_DURATION_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_DURATION))) " " DOCOPT_OPTIONAL(DOCOPT_SWITCH(TOTP_CLI_COMMAND_ARG_UNSECURE_PREFIX)) " " DOCOPT_OPTIONAL(DOCOPT_SWITCH(TOTP_CLI_COMMAND_UPDATE_ARG_SECRET_PREFIX)) " " DOCOPT_MULTIPLE(DOCOPT_OPTIONAL(DOCOPT_OPTION(TOTP_CLI_COMMAND_ARG_AUTOMATION_FEATURE_PREFIX, DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_AUTOMATION_FEATURE)))) "\r\n"); -} - -void totp_cli_command_update_docopt_options() { - TOTP_CLI_PRINTF(" " DOCOPT_OPTION( - TOTP_CLI_COMMAND_ARG_NAME_PREFIX, - DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_ARG_NAME)) " Token name\r\n"); - - TOTP_CLI_PRINTF(" " DOCOPT_SWITCH( - TOTP_CLI_COMMAND_UPDATE_ARG_SECRET_PREFIX) " Update token secret\r\n"); -} -#endif - -void totp_cli_command_update_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -143,7 +119,7 @@ void totp_cli_command_update_handle(PluginState* plugin_state, FuriString* args, int token_number; if(!args_read_int_and_trim(args, &token_number) || token_number <= 0 || (size_t)token_number > totp_token_info_iterator_get_total_count(iterator_context)) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); return; } @@ -163,15 +139,27 @@ void totp_cli_command_update_handle(PluginState* plugin_state, FuriString* args, furi_string_get_cstr( totp_token_info_iterator_get_current_token(iterator_context)->name)); } else if(update_result == TotpIteratorUpdateTokenResultInvalidArguments) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); } else if(update_result == TotpIteratorUpdateTokenResultCancelled) { TOTP_CLI_PRINTF_INFO("Cancelled by user\r\n"); } else if(update_result == TotpIteratorUpdateTokenResultInvalidSecret) { TOTP_CLI_PRINTF_ERROR("Token secret seems to be invalid and can not be parsed\r\n"); } else if(update_result == TotpIteratorUpdateTokenResultFileUpdateFailed) { - totp_cli_print_error_updating_config_file(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); } totp_token_info_iterator_go_to(iterator_context, previous_index); TOTP_CLI_UNLOCK_UI(plugin_state); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Update", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_update_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/move/meta.h b/cli/plugins/move/meta.h new file mode 100644 index 00000000000..8e86f20f0ef --- /dev/null +++ b/cli/plugins/move/meta.h @@ -0,0 +1,5 @@ +#pragma once + +#define TOTP_CLI_COMMAND_MOVE "move" +#define TOTP_CLI_COMMAND_MOVE_ALT "mv" +#define TOTP_CLI_PLUGIN_MOVE_FILE_NAME "totp_cli_move_plugin" \ No newline at end of file diff --git a/cli/commands/move/move.c b/cli/plugins/move/move.c similarity index 59% rename from cli/commands/move/move.c rename to cli/plugins/move/move.c index fbf82a3bba1..f2d184b7366 100644 --- a/cli/commands/move/move.c +++ b/cli/plugins/move/move.c @@ -1,35 +1,13 @@ -#include "move.h" - -#include +#include #include +#include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" #include "../../../types/token_info.h" #include "../../../services/config/config.h" -#include "../../cli_helpers.h" #include "../../../ui/scene_director.h" -#include "../../common_command_arguments.h" - -#define TOTP_CLI_COMMAND_MOVE_ARG_NEW_INDEX "new_index" - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_move_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_MOVE ", " TOTP_CLI_COMMAND_MOVE_ALT - " Move token\r\n"); -} - -void totp_cli_command_move_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME - " " DOCOPT_REQUIRED(TOTP_CLI_COMMAND_MOVE " | " TOTP_CLI_COMMAND_MOVE_ALT) " " DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_ARG_INDEX) " " DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_MOVE_ARG_NEW_INDEX) "\r\n"); -} - -void totp_cli_command_move_docopt_arguments() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_MOVE_ARG_NEW_INDEX - " New token index in the list\r\n"); -} -#endif -void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -40,7 +18,7 @@ void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, C size_t total_count = totp_token_info_iterator_get_total_count(iterator_context); if(!args_read_int_and_trim(args, &token_number) || token_number < 1 || (size_t)token_number > total_count) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); return; } @@ -48,7 +26,7 @@ void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, C if(!args_read_int_and_trim(args, &new_token_number) || new_token_number < 1 || (size_t)new_token_number > total_count) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); return; } @@ -65,21 +43,33 @@ void totp_cli_command_move_handle(PluginState* plugin_state, FuriString* args, C size_t original_token_index = totp_token_info_iterator_get_current_token_index(iterator_context); - totp_cli_print_processing(); + TOTP_CLI_PRINT_PROCESSING(); if(totp_token_info_iterator_go_to(iterator_context, token_index) && totp_token_info_iterator_move_current_token_info(iterator_context, new_token_index)) { - totp_cli_delete_last_line(); + TOTP_CLI_DELETE_LAST_LINE(); TOTP_CLI_PRINTF_SUCCESS( "Token \"%s\" has been successfully updated\r\n", furi_string_get_cstr( totp_token_info_iterator_get_current_token(iterator_context)->name)); } else { - totp_cli_delete_last_line(); - totp_cli_print_error_updating_config_file(); + TOTP_CLI_DELETE_LAST_LINE(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); } totp_token_info_iterator_go_to(iterator_context, original_token_index); TOTP_CLI_UNLOCK_UI(plugin_state); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Move", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_move_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/notification/meta.h b/cli/plugins/notification/meta.h new file mode 100644 index 00000000000..fcadf4a1ff7 --- /dev/null +++ b/cli/plugins/notification/meta.h @@ -0,0 +1,4 @@ +#pragma once + +#define TOTP_CLI_COMMAND_NOTIFICATION "notify" +#define TOTP_CLI_PLUGIN_NOTIFICATION_FILE_NAME "totp_cli_notification_plugin" \ No newline at end of file diff --git a/cli/commands/notification/notification.c b/cli/plugins/notification/notification.c similarity index 71% rename from cli/commands/notification/notification.c rename to cli/plugins/notification/notification.c index d1814fb26e7..2800df7d9bc 100644 --- a/cli/commands/notification/notification.c +++ b/cli/plugins/notification/notification.c @@ -1,35 +1,15 @@ -#include "notification.h" +#include #include #include "../../../services/config/config.h" #include "../../../ui/scene_director.h" #include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" -#define TOTP_CLI_COMMAND_NOTIFICATION_ARG_METHOD "notification" #define TOTP_CLI_COMMAND_NOTIFICATION_METHOD_NONE "none" #define TOTP_CLI_COMMAND_NOTIFICATION_METHOD_SOUND "sound" #define TOTP_CLI_COMMAND_NOTIFICATION_METHOD_VIBRO "vibro" -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_notification_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NOTIFICATION - " Get or set notification method\r\n"); -} - -void totp_cli_command_notification_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME " " TOTP_CLI_COMMAND_NOTIFICATION " " DOCOPT_OPTIONAL( - DOCOPT_MULTIPLE(DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_NOTIFICATION_ARG_METHOD))) "\r\n"); -} - -void totp_cli_command_notification_docopt_arguments() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NOTIFICATION_ARG_METHOD - " Notification method to be set. Must be one of: " TOTP_CLI_COMMAND_NOTIFICATION_METHOD_NONE - ", " TOTP_CLI_COMMAND_NOTIFICATION_METHOD_SOUND - ", " TOTP_CLI_COMMAND_NOTIFICATION_METHOD_VIBRO "\r\n"); -} -#endif - static void totp_cli_command_notification_print_method(NotificationMethod method, const char* color) { bool has_previous_method = false; @@ -49,7 +29,7 @@ static void } } -void totp_cli_command_notification_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -76,7 +56,7 @@ void totp_cli_command_notification_handle(PluginState* plugin_state, FuriString* do { if(!args_valid) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); break; } @@ -89,7 +69,7 @@ void totp_cli_command_notification_handle(PluginState* plugin_state, FuriString* totp_cli_command_notification_print_method(new_method, TOTP_CLI_COLOR_SUCCESS); cli_nl(); } else { - totp_cli_print_error_updating_config_file(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); } TOTP_CLI_UNLOCK_UI(plugin_state); @@ -102,4 +82,16 @@ void totp_cli_command_notification_handle(PluginState* plugin_state, FuriString* } while(false); furi_string_free(temp_str); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Notification", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_notification_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/pin/meta.h b/cli/plugins/pin/meta.h new file mode 100644 index 00000000000..16e0dee591b --- /dev/null +++ b/cli/plugins/pin/meta.h @@ -0,0 +1,4 @@ +#pragma once + +#define TOTP_CLI_COMMAND_PIN "pin" +#define TOTP_CLI_PLUGIN_PIN_FILE_NAME "totp_cli_pin_plugin" \ No newline at end of file diff --git a/cli/commands/pin/pin.c b/cli/plugins/pin/pin.c similarity index 77% rename from cli/commands/pin/pin.c rename to cli/plugins/pin/pin.c index d3179095062..8e41bffd3ca 100644 --- a/cli/commands/pin/pin.c +++ b/cli/plugins/pin/pin.c @@ -1,44 +1,18 @@ -#include "pin.h" - -#include +#include #include +#include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" #include "../../../types/token_info.h" #include "../../../types/user_pin_codes.h" #include "../../../services/config/config.h" -#include "../../cli_helpers.h" -#include #include "../../../services/crypto/crypto_facade.h" #include "../../../ui/scene_director.h" +#include "../../../lib/polyfills/memset_s.h" #define TOTP_CLI_COMMAND_PIN_COMMAND_SET "set" #define TOTP_CLI_COMMAND_PIN_COMMAND_REMOVE "remove" #define TOTP_CLI_COMMAND_PIN_ARG_NEW_CRYPTO_KEY_SLOT_PREFIX "-c" -#define TOTP_CLI_COMMAND_PIN_ARG_NEW_CRYPTO_KEY_SLOT "slot" - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_pin_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_PIN " Set\\change\\remove PIN\r\n"); -} - -void totp_cli_command_pin_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME " " TOTP_CLI_COMMAND_PIN - " " DOCOPT_REQUIRED(TOTP_CLI_COMMAND_PIN_COMMAND_SET " | " TOTP_CLI_COMMAND_PIN_COMMAND_REMOVE) " " DOCOPT_OPTIONAL( - DOCOPT_OPTION( - TOTP_CLI_COMMAND_PIN_ARG_NEW_CRYPTO_KEY_SLOT_PREFIX, - DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_PIN_ARG_NEW_CRYPTO_KEY_SLOT))) "\r\n"); -} - -void totp_cli_command_pin_docopt_options() { - TOTP_CLI_PRINTF( - " " DOCOPT_OPTION( - TOTP_CLI_COMMAND_PIN_ARG_NEW_CRYPTO_KEY_SLOT_PREFIX, - DOCOPT_ARGUMENT( - TOTP_CLI_COMMAND_PIN_ARG_NEW_CRYPTO_KEY_SLOT)) " New crypto key slot. Must be between %d and %d\r\n", - ACCEPTABLE_CRYPTO_KEY_SLOT_START, - ACCEPTABLE_CRYPTO_KEY_SLOT_END); -} -#endif static inline uint8_t totp_cli_key_to_pin_code(uint8_t key) { uint8_t code = 0; @@ -82,14 +56,14 @@ static bool totp_cli_read_pin(Cli* cli, uint8_t* pin, uint8_t* pin_length) { } } } else if(c == CliSymbolAsciiETX) { - totp_cli_delete_current_line(); + TOTP_CLI_DELETE_CURRENT_LINE(); TOTP_CLI_PRINTF_INFO("Cancelled by user\r\n"); return false; } else if(c == CliSymbolAsciiBackspace || c == CliSymbolAsciiDel) { if(*pin_length > 0) { *pin_length = *pin_length - 1; pin[*pin_length] = 0; - totp_cli_delete_last_char(); + TOTP_CLI_DELETE_LAST_CHAR(); } } else if(c == CliSymbolAsciiCR) { cli_nl(); @@ -97,11 +71,11 @@ static bool totp_cli_read_pin(Cli* cli, uint8_t* pin, uint8_t* pin_length) { } } - totp_cli_delete_last_line(); + TOTP_CLI_DELETE_LAST_LINE(); return true; } -void totp_cli_command_pin_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { UNUSED(plugin_state); FuriString* temp_str = furi_string_alloc(); @@ -125,14 +99,14 @@ void totp_cli_command_pin_handle(PluginState* plugin_state, FuriString* args, Cl break; } } else { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); arguments_parsed = false; break; } } if(!(do_change || do_remove) || (do_change && do_remove)) { - totp_cli_print_invalid_arguments(); + TOTP_CLI_PRINT_INVALID_ARGUMENTS(); arguments_parsed = false; } @@ -172,7 +146,7 @@ void totp_cli_command_pin_handle(PluginState* plugin_state, FuriString* args, Cl memset_s(&new_pin[0], CRYPTO_IV_LENGTH, 0, CRYPTO_IV_LENGTH); - totp_cli_delete_last_line(); + TOTP_CLI_DELETE_LAST_LINE(); if(update_result) { if(do_change) { @@ -181,7 +155,7 @@ void totp_cli_command_pin_handle(PluginState* plugin_state, FuriString* args, Cl TOTP_CLI_PRINTF_SUCCESS("PIN has been successfully removed\r\n"); } } else { - totp_cli_print_error_updating_config_file(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); } } while(false); @@ -190,4 +164,16 @@ void totp_cli_command_pin_handle(PluginState* plugin_state, FuriString* args, Cl } furi_string_free(temp_str); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: PIN", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_pin_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/reset/meta.h b/cli/plugins/reset/meta.h new file mode 100644 index 00000000000..8fb9584b856 --- /dev/null +++ b/cli/plugins/reset/meta.h @@ -0,0 +1,4 @@ +#pragma once + +#define TOTP_CLI_COMMAND_RESET "reset" +#define TOTP_CLI_PLUGIN_RESET_FILE_NAME "totp_cli_reset_plugin" \ No newline at end of file diff --git a/cli/commands/reset/reset.c b/cli/plugins/reset/reset.c similarity index 68% rename from cli/commands/reset/reset.c rename to cli/plugins/reset/reset.c index a02bc0eb01c..4fc9b2903ce 100644 --- a/cli/commands/reset/reset.c +++ b/cli/plugins/reset/reset.c @@ -1,25 +1,14 @@ -#include "reset.h" - -#include -#include +#include #include "../../cli_helpers.h" +#include "../../cli_shared_methods.h" +#include "../../cli_plugin_interface.h" #include "../../../ui/scene_director.h" #include "../../../services/config/config.h" #define TOTP_CLI_RESET_CONFIRMATION_KEYWORD "YES" -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_reset_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_RESET - " Reset application to default settings\r\n"); -} - -void totp_cli_command_reset_docopt_usage() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " TOTP_CLI_COMMAND_RESET "\r\n"); -} -#endif - -void totp_cli_command_reset_handle(PluginState* plugin_state, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { + UNUSED(args); TOTP_CLI_LOCK_UI(plugin_state); TOTP_CLI_PRINTF_WARNING( "As a result of reset all the settings and tokens will be permanently lost.\r\n"); @@ -39,4 +28,16 @@ void totp_cli_command_reset_handle(PluginState* plugin_state, Cli* cli) { TOTP_CLI_PRINTF_INFO("Action was not confirmed by user\r\n"); TOTP_CLI_UNLOCK_UI(plugin_state); } +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Reset", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_reset_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/timezone/meta.h b/cli/plugins/timezone/meta.h new file mode 100644 index 00000000000..89bf4d1b953 --- /dev/null +++ b/cli/plugins/timezone/meta.h @@ -0,0 +1,5 @@ +#pragma once + +#define TOTP_CLI_COMMAND_TIMEZONE "timezone" +#define TOTP_CLI_COMMAND_TIMEZONE_ALT "tz" +#define TOTP_CLI_PLUGIN_TIMEZONE_FILE_NAME "totp_cli_timezone_plugin" \ No newline at end of file diff --git a/cli/commands/timezone/timezone.c b/cli/plugins/timezone/timezone.c similarity index 53% rename from cli/commands/timezone/timezone.c rename to cli/plugins/timezone/timezone.c index af5db6e6e37..3891bbeee19 100644 --- a/cli/commands/timezone/timezone.c +++ b/cli/plugins/timezone/timezone.c @@ -1,31 +1,14 @@ -#include "timezone.h" #include +#include #include "../../../services/config/config.h" #include "../../../ui/scene_director.h" #include "../../cli_helpers.h" +#include "../../cli_plugin_interface.h" +#include "../../cli_shared_methods.h" -#define TOTP_CLI_COMMAND_TIMEZONE_ARG_TIMEZONE "timezone" - -#ifdef TOTP_CLI_RICH_HELP_ENABLED -void totp_cli_command_timezone_docopt_commands() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_TIMEZONE ", " TOTP_CLI_COMMAND_TIMEZONE_ALT - " Get or set current timezone\r\n"); -} - -void totp_cli_command_timezone_docopt_usage() { - TOTP_CLI_PRINTF( - " " TOTP_CLI_COMMAND_NAME - " " DOCOPT_REQUIRED(TOTP_CLI_COMMAND_TIMEZONE " | " TOTP_CLI_COMMAND_TIMEZONE_ALT) " " DOCOPT_OPTIONAL( - DOCOPT_ARGUMENT(TOTP_CLI_COMMAND_TIMEZONE_ARG_TIMEZONE)) "\r\n"); -} - -void totp_cli_command_timezone_docopt_arguments() { - TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_TIMEZONE_ARG_TIMEZONE - " Timezone offset in hours to be set\r\n"); -} -#endif - -void totp_cli_command_timezone_handle(PluginState* plugin_state, FuriString* args, Cli* cli) { +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { + UNUSED(args); + UNUSED(plugin_state); if(!totp_cli_ensure_authenticated(plugin_state, cli)) { return; } @@ -40,7 +23,7 @@ void totp_cli_command_timezone_handle(PluginState* plugin_state, FuriString* arg if(totp_config_file_update_timezone_offset(plugin_state)) { TOTP_CLI_PRINTF_SUCCESS("Timezone is set to %f\r\n", (double)tz); } else { - totp_cli_print_error_updating_config_file(); + TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE(); } TOTP_CLI_UNLOCK_UI(plugin_state); } else { @@ -51,4 +34,16 @@ void totp_cli_command_timezone_handle(PluginState* plugin_state, FuriString* arg "Current timezone offset is %f\r\n", (double)plugin_state->timezone_offset); } furi_string_free(temp_str); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Timezone", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_timezone_plugin_ep() { + return &plugin_descriptor; } \ No newline at end of file diff --git a/cli/plugins/version/meta.h b/cli/plugins/version/meta.h new file mode 100644 index 00000000000..5920d9be06d --- /dev/null +++ b/cli/plugins/version/meta.h @@ -0,0 +1,4 @@ +#pragma once + +#define TOTP_CLI_COMMAND_VERSION "version" +#define TOTP_CLI_PLUGIN_VERSION_FILE_NAME "totp_cli_version_plugin" \ No newline at end of file diff --git a/cli/plugins/version/version.c b/cli/plugins/version/version.c new file mode 100644 index 00000000000..8952f794514 --- /dev/null +++ b/cli/plugins/version/version.c @@ -0,0 +1,27 @@ +#include +#include "../../cli_helpers.h" +#include "../../cli_plugin_interface.h" +#include "../../../version.h" + +static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { + UNUSED(args); + UNUSED(cli); + UNUSED(plugin_state); + TOTP_CLI_PRINTF( + "%" PRIu8 ".%" PRIu8 ".%" PRIu8 "\r\n", + TOTP_APP_VERSION_MAJOR, + TOTP_APP_VERSION_MINOR, + TOTP_APP_VERSION_PATCH); +} + +static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Version", .handle = &handle}; + +static const FlipperAppPluginDescriptor plugin_descriptor = { + .appid = PLUGIN_APP_ID, + .ep_api_version = PLUGIN_API_VERSION, + .entry_point = &plugin, +}; + +const FlipperAppPluginDescriptor* totp_cli_version_plugin_ep() { + return &plugin_descriptor; +} \ No newline at end of file diff --git a/config/app/config.h b/config/app/config.h index 8c5fc13145f..73cd1e86a64 100644 --- a/config/app/config.h +++ b/config/app/config.h @@ -1,3 +1,15 @@ +// List of compatible firmwares +#define TOTP_FIRMWARE_OFFICIAL_STABLE (1) +#define TOTP_FIRMWARE_OFFICIAL_DEV (2) +#define TOTP_FIRMWARE_XTREME_UL (3) +// End of list + +#if __has_include("ufbt_def.h") +#include "ufbt_def.h" +#endif + +#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL + // Application automatic lock timeout if user IDLE. (ticks) #ifndef TOTP_AUTO_LOCK_IDLE_TIMEOUT_SEC #define TOTP_AUTO_LOCK_IDLE_TIMEOUT_SEC (60) @@ -9,34 +21,15 @@ #endif // Enables\disables backward compatibility with crypto algorithms v1 -#ifndef TOTP_NO_OBSOLETE_CRYPTO_V1_COMPATIBILITY -#define TOTP_OBSOLETE_CRYPTO_V1_COMPATIBILITY_ENABLED -#endif +// #define TOTP_OBSOLETE_CRYPTO_V1_COMPATIBILITY_ENABLED // Enables\disables backward compatibility with crypto algorithms v2 #ifndef TOTP_NO_OBSOLETE_CRYPTO_V2_COMPATIBILITY #define TOTP_OBSOLETE_CRYPTO_V2_COMPATIBILITY_ENABLED #endif -// Enables\disables userfriendly TOTP CLI help text -// If disabled, it will print a link to a wiki page -#ifndef TOTP_CLI_NO_RICH_HELP -#define TOTP_CLI_RICH_HELP_ENABLED -#endif - // Enables\disables "Add new token" UI // If disabled it will print a link to wiki page #ifndef TOTP_UI_NO_ADD_NEW_TOKEN #define TOTP_UI_ADD_NEW_TOKEN_ENABLED #endif - -// List of compatible firmwares -#define TOTP_FIRMWARE_OFFICIAL_STABLE (1) -#define TOTP_FIRMWARE_OFFICIAL_DEV (2) -#define TOTP_FIRMWARE_XTREME_UL (3) -// End of list - -// Target firmware -#ifndef TOTP_TARGET_FIRMWARE -#define TOTP_TARGET_FIRMWARE TOTP_FIRMWARE_XTREME_UL -#endif diff --git a/lib/fonts/712serif/712serif.c b/lib/fonts/712serif/712serif.c deleted file mode 100644 index 7d0b9f1e96e..00000000000 --- a/lib/fonts/712serif/712serif.c +++ /dev/null @@ -1,941 +0,0 @@ -#include "712serif.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for 7:12 Serif 24pt -*/ - -/* Character bitmaps for 7:12 Serif 24pt */ -const uint8_t _712Serif_24ptBitmaps[] = { - /* @0 '-' (14 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @28 '0' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @56 '1' (14 pixels wide) */ - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xFC, - 0x00, - 0xFC, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - - /* @84 '2' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0xC0, - 0x03, - 0xC0, - 0x03, - 0x30, - 0x00, - 0x30, - 0x00, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - - /* @112 '3' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0xC0, - 0x03, - 0xC0, - 0x03, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @140 '4' (14 pixels wide) */ - 0x30, - 0x03, - 0x30, - 0x03, - 0x30, - 0x03, - 0x30, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x00, - 0x03, - 0x00, - 0x03, - 0xC0, - 0x0F, - 0xC0, - 0x0F, - - /* @168 '5' (14 pixels wide) */ - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x03, - 0xFC, - 0x03, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @196 '6' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x03, - 0xFC, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @224 '7' (14 pixels wide) */ - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - - /* @252 '8' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @280 '9' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @308 'B' (14 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0xFF, - 0x0F, - 0xFF, - 0x0F, - - /* @336 'C' (14 pixels wide) */ - 0xF0, - 0x33, - 0xF0, - 0x33, - 0x0C, - 0x3C, - 0x0C, - 0x3C, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x30, - 0x03, - 0x30, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @364 'D' (14 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xFF, - 0x03, - 0xFF, - 0x03, - - /* @392 'F' (14 pixels wide) */ - 0xFF, - 0x3F, - 0xFF, - 0x3F, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0xFC, - 0x03, - 0xFC, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x3F, - 0x00, - 0x3F, - 0x00, - - /* @420 'G' (14 pixels wide) */ - 0xF0, - 0x33, - 0xF0, - 0x33, - 0x0C, - 0x3C, - 0x0C, - 0x3C, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x3F, - 0x03, - 0x3F, - 0x03, - 0x30, - 0x03, - 0x30, - 0x0C, - 0x3C, - 0x0C, - 0x3C, - 0xF0, - 0x33, - 0xF0, - 0x33, - - /* @448 'H' (14 pixels wide) */ - 0x3F, - 0x3F, - 0x3F, - 0x3F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x3F, - 0x3F, - 0x3F, - 0x3F, - - /* @476 'J' (14 pixels wide) */ - 0x00, - 0x3F, - 0x00, - 0x3F, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @504 'K' (14 pixels wide) */ - 0x3F, - 0x3F, - 0x3F, - 0x3F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x3F, - 0x3F, - 0x3F, - 0x3F, - - /* @532 'M' (14 pixels wide) */ - 0x0F, - 0x3C, - 0x0F, - 0x3C, - 0x3C, - 0x0F, - 0x3C, - 0x0F, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x3F, - 0x3F, - 0x3F, - 0x3F, - - /* @560 'N' (14 pixels wide) */ - 0x0F, - 0x3F, - 0x0F, - 0x3F, - 0x3C, - 0x0C, - 0x3C, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0x0C, - 0x0F, - 0x0C, - 0x0F, - 0x3F, - 0x0C, - 0x3F, - 0x0C, - - /* @588 'P' (14 pixels wide) */ - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x3C, - 0x30, - 0x3C, - 0x30, - 0xCC, - 0x0F, - 0xCC, - 0x0F, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x3F, - 0x00, - 0x3F, - 0x00, - - /* @616 'Q' (14 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x03, - 0x30, - 0x03, - 0x30, - 0xF3, - 0x30, - 0xF3, - 0x30, - 0x03, - 0x33, - 0x03, - 0x33, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xF0, - 0x33, - 0xF0, - 0x33, - - /* @644 'R' (14 pixels wide) */ - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0x0C, - 0x30, - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x0C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x3F, - 0x3F, - 0x3F, - 0x3F, - - /* @672 'T' (14 pixels wide) */ - 0xFF, - 0x3F, - 0xFF, - 0x3F, - 0xC3, - 0x30, - 0xC3, - 0x30, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xF0, - 0x03, - 0xF0, - 0x03, - - /* @700 'V' (14 pixels wide) */ - 0x3F, - 0x3F, - 0x3F, - 0x3F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x30, - 0x03, - 0x30, - 0x03, - 0x30, - 0x03, - 0x30, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - - /* @728 'W' (14 pixels wide) */ - 0x3F, - 0x3F, - 0x3F, - 0x3F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0xCC, - 0x0C, - 0x30, - 0x03, - 0x30, - 0x03, - 0x30, - 0x03, - 0x30, - 0x03, - - /* @756 'X' (14 pixels wide) */ - 0x3F, - 0x3F, - 0x3F, - 0x3F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x30, - 0x03, - 0x30, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x30, - 0x03, - 0x30, - 0x03, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x3F, - 0x3F, - 0x3F, - 0x3F, - - /* @784 'Y' (14 pixels wide) */ - 0x3F, - 0x3F, - 0x3F, - 0x3F, - 0x0C, - 0x0C, - 0x0C, - 0x0C, - 0x30, - 0x03, - 0x30, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xF0, - 0x03, - 0xF0, - 0x03, -}; - -/* Character descriptors for 7:12 Serif 24pt */ -/* { [Char width in bits], [Offset into _712Serif_24ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO _712Serif_24ptDescriptors[] = { - {14, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {14, 28}, /* 0 */ - {14, 56}, /* 1 */ - {14, 84}, /* 2 */ - {14, 112}, /* 3 */ - {14, 140}, /* 4 */ - {14, 168}, /* 5 */ - {14, 196}, /* 6 */ - {14, 224}, /* 7 */ - {14, 252}, /* 8 */ - {14, 280}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {14, 308}, /* B */ - {14, 336}, /* C */ - {14, 364}, /* D */ - {0, 0}, /* E */ - {14, 392}, /* F */ - {14, 420}, /* G */ - {14, 448}, /* H */ - {0, 0}, /* I */ - {14, 476}, /* J */ - {14, 504}, /* K */ - {0, 0}, /* L */ - {14, 532}, /* M */ - {14, 560}, /* N */ - {0, 0}, /* O */ - {14, 588}, /* P */ - {14, 616}, /* Q */ - {14, 644}, /* R */ - {0, 0}, /* S */ - {14, 672}, /* T */ - {0, 0}, /* U */ - {14, 700}, /* V */ - {14, 728}, /* W */ - {14, 756}, /* X */ - {14, 784}, /* Y */ -}; - -/* Font information for 7:12 Serif 24pt */ -const FONT_INFO _712Serif_24ptFontInfo = { - "712 Serif", - 14, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - _712Serif_24ptDescriptors, /* Character descriptor array */ - _712Serif_24ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/712serif/712serif.h b/lib/fonts/712serif/712serif.h deleted file mode 100644 index 81959064d62..00000000000 --- a/lib/fonts/712serif/712serif.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font data for 7:12 Serif 24pt */ -extern const FONT_INFO _712Serif_24ptFontInfo; diff --git a/lib/fonts/available_fonts.c b/lib/fonts/available_fonts.c deleted file mode 100644 index dd019a75881..00000000000 --- a/lib/fonts/available_fonts.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "available_fonts.h" -#include "712serif/712serif.h" -#include "bedstead/bedstead.h" -#include "dpcomic/dpcomic.h" -#include "funclimbing/funclimbing.h" -#include "graph35pix/graph35pix.h" -#include "karma_future/karma_future.h" -#include "mode_nine/mode_nine.h" -#include "pixelflag/pixelflag.h" -#include "redhat_mono/redhat_mono.h" -#include "zector/zector.h" - -const FONT_INFO* const available_fonts[AVAILABLE_FONTS_COUNT] = { - &modeNine_15ptFontInfo, - &_712Serif_24ptFontInfo, - &bedstead_17ptFontInfo, - &dPComic_18ptFontInfo, - &funclimbingDemo_18ptFontInfo, - &graph35pix_12ptFontInfo, - &karmaFuture_14ptFontInfo, - &pixelFlag_18ptFontInfo, - &redHatMono_16ptFontInfo, - &zector_18ptFontInfo}; diff --git a/lib/fonts/available_fonts.h b/lib/fonts/available_fonts.h deleted file mode 100644 index fd4b0c1da17..00000000000 --- a/lib/fonts/available_fonts.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "font_info.h" - -#define AVAILABLE_FONTS_COUNT (10) - -extern const FONT_INFO* const available_fonts[AVAILABLE_FONTS_COUNT]; diff --git a/lib/fonts/bedstead/bedstead.c b/lib/fonts/bedstead/bedstead.c deleted file mode 100644 index 6b23a39d479..00000000000 --- a/lib/fonts/bedstead/bedstead.c +++ /dev/null @@ -1,1057 +0,0 @@ -#include "bedstead.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for Bedstead 17pt -*/ - -/* Character bitmaps for Bedstead 17pt */ -const uint8_t bedstead_17ptBitmaps[] = { - /* @0 '-' (13 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @32 '0' (13 pixels wide) */ - 0xE0, - 0x00, - 0xF0, - 0x01, - 0xF8, - 0x03, - 0xBC, - 0x07, - 0x1E, - 0x0F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0x1E, - 0x0F, - 0xBC, - 0x07, - 0xF8, - 0x03, - 0xF0, - 0x01, - 0xE0, - 0x00, - - /* @64 '1' (13 pixels wide) */ - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xF8, - 0x00, - 0xF8, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xF8, - 0x03, - 0xF8, - 0x03, - - /* @96 '2' (13 pixels wide) */ - 0xF0, - 0x07, - 0xFC, - 0x0F, - 0x1E, - 0x1E, - 0x1E, - 0x1C, - 0x0E, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1E, - 0xC0, - 0x0F, - 0xE0, - 0x07, - 0xF0, - 0x00, - 0x7C, - 0x00, - 0x3E, - 0x00, - 0x1E, - 0x00, - 0x0E, - 0x00, - 0xFE, - 0x1F, - 0xFE, - 0x1F, - - /* @128 '3' (13 pixels wide) */ - 0xFE, - 0x1F, - 0xFE, - 0x1F, - 0x00, - 0x1C, - 0x00, - 0x1E, - 0x00, - 0x0F, - 0x00, - 0x0F, - 0x00, - 0x07, - 0xE0, - 0x07, - 0xE0, - 0x0F, - 0x00, - 0x1E, - 0x00, - 0x1C, - 0x0E, - 0x1C, - 0x1E, - 0x1C, - 0x3E, - 0x0E, - 0xFC, - 0x0F, - 0xF8, - 0x07, - - /* @160 '4' (13 pixels wide) */ - 0x80, - 0x03, - 0x80, - 0x03, - 0xE0, - 0x03, - 0xF0, - 0x03, - 0xF8, - 0x03, - 0xBC, - 0x03, - 0x9E, - 0x03, - 0x8F, - 0x03, - 0x87, - 0x03, - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0x80, - 0x03, - 0x80, - 0x03, - 0x80, - 0x03, - 0x80, - 0x03, - 0x80, - 0x03, - - /* @192 '5' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x07, - 0x00, - 0x07, - 0x00, - 0xFF, - 0x07, - 0xFF, - 0x0F, - 0x00, - 0x1E, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0xFE, - 0x0F, - 0xFC, - 0x07, - 0xFC, - 0x07, - - /* @224 '6' (13 pixels wide) */ - 0xE0, - 0x07, - 0xF0, - 0x07, - 0x78, - 0x00, - 0x3C, - 0x00, - 0x1E, - 0x00, - 0x0F, - 0x00, - 0x07, - 0x00, - 0xFF, - 0x07, - 0xFF, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0x1E, - 0x0F, - 0xFE, - 0x0F, - 0xFC, - 0x07, - - /* @256 '7' (13 pixels wide) */ - 0xFE, - 0x1F, - 0xFE, - 0x1F, - 0x00, - 0x1C, - 0x00, - 0x1E, - 0x00, - 0x0F, - 0x80, - 0x07, - 0xC0, - 0x03, - 0xE0, - 0x01, - 0xF0, - 0x00, - 0x78, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - - /* @288 '8' (13 pixels wide) */ - 0xFC, - 0x07, - 0xFE, - 0x0F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0xFE, - 0x0F, - 0xFE, - 0x0F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0x1E, - 0x0F, - 0xFE, - 0x0F, - 0xFC, - 0x07, - - /* @320 '9' (13 pixels wide) */ - 0xFC, - 0x07, - 0xFE, - 0x0F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1C, - 0xFE, - 0x1F, - 0xFC, - 0x1F, - 0x00, - 0x1C, - 0x00, - 0x1E, - 0x00, - 0x0F, - 0x80, - 0x07, - 0xC0, - 0x03, - 0xFC, - 0x01, - 0xFC, - 0x00, - - /* @352 'B' (13 pixels wide) */ - 0xFF, - 0x07, - 0xFF, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1E, - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1E, - 0x07, - 0x0F, - 0xFF, - 0x0F, - 0xFF, - 0x07, - - /* @384 'C' (13 pixels wide) */ - 0xFC, - 0x01, - 0xFE, - 0x07, - 0x0F, - 0x0F, - 0x07, - 0x0F, - 0x07, - 0x0E, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x0F, - 0x8F, - 0x0F, - 0xFE, - 0x07, - 0xFC, - 0x03, - - /* @416 'D' (13 pixels wide) */ - 0xFF, - 0x07, - 0xFF, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1E, - 0x07, - 0x0F, - 0xFF, - 0x0F, - 0xFF, - 0x07, - - /* @448 'F' (13 pixels wide) */ - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - - /* @480 'G' (13 pixels wide) */ - 0xFC, - 0x07, - 0xFE, - 0x0F, - 0x0F, - 0x1F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x87, - 0x1F, - 0x87, - 0x1F, - 0x07, - 0x1C, - 0x0F, - 0x1C, - 0xFE, - 0x1F, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - - /* @512 'H' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - - /* @544 'J' (13 pixels wide) */ - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x00, - 0x1C, - 0x0E, - 0x1C, - 0x1E, - 0x1C, - 0x3E, - 0x1E, - 0xFC, - 0x0F, - 0xF8, - 0x07, - - /* @576 'K' (13 pixels wide) */ - 0x07, - 0x0E, - 0x07, - 0x0F, - 0x87, - 0x07, - 0xC7, - 0x03, - 0xE7, - 0x01, - 0xF7, - 0x00, - 0x7F, - 0x00, - 0x3F, - 0x00, - 0x3F, - 0x00, - 0x7F, - 0x00, - 0xF7, - 0x00, - 0xE7, - 0x01, - 0xC7, - 0x03, - 0x87, - 0x07, - 0x07, - 0x0F, - 0x07, - 0x0E, - - /* @608 'M' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0xBF, - 0x1F, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - - /* @640 'N' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x3F, - 0x1C, - 0x7F, - 0x1C, - 0xFF, - 0x1C, - 0xE7, - 0x1F, - 0xC7, - 0x1F, - 0x87, - 0x1F, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - - /* @672 'P' (13 pixels wide) */ - 0xFF, - 0x07, - 0xFF, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1E, - 0xFF, - 0x0F, - 0xFF, - 0x07, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - - /* @704 'Q' (13 pixels wide) */ - 0xFC, - 0x07, - 0xFE, - 0x0F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1F, - 0xC7, - 0x0F, - 0x8F, - 0x07, - 0xDE, - 0x0F, - 0xFE, - 0x1F, - 0xFC, - 0x1C, - - /* @736 'R' (13 pixels wide) */ - 0xFF, - 0x07, - 0xFF, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1E, - 0xFF, - 0x0F, - 0xFF, - 0x07, - 0xE7, - 0x00, - 0xE7, - 0x01, - 0xC7, - 0x03, - 0x87, - 0x07, - 0x07, - 0x0F, - 0x07, - 0x1E, - 0x07, - 0x1C, - - /* @768 'T' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - - /* @800 'V' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x1F, - 0x1F, - 0xBC, - 0x07, - 0xB8, - 0x03, - 0xB8, - 0x03, - 0xF8, - 0x07, - 0xF0, - 0x03, - 0xE0, - 0x01, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - - /* @832 'W' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0xE7, - 0x1C, - 0xFF, - 0x1F, - 0xFE, - 0x0F, - 0xFE, - 0x0F, - 0xBC, - 0x07, - - /* @864 'X' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0x1E, - 0x0F, - 0xBC, - 0x07, - 0xF8, - 0x03, - 0xF0, - 0x01, - 0xF0, - 0x01, - 0xF8, - 0x03, - 0xBC, - 0x07, - 0x1E, - 0x0F, - 0x0F, - 0x1E, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - - /* @896 'Y' (13 pixels wide) */ - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x0F, - 0x1E, - 0x1E, - 0x0F, - 0xBC, - 0x07, - 0xF8, - 0x03, - 0xF0, - 0x01, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, -}; - -/* Character descriptors for Bedstead 17pt */ -/* { [Char width in bits], [Offset into bedstead_17ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO bedstead_17ptDescriptors[] = { - {13, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {13, 32}, /* 0 */ - {13, 64}, /* 1 */ - {13, 96}, /* 2 */ - {13, 128}, /* 3 */ - {13, 160}, /* 4 */ - {13, 192}, /* 5 */ - {13, 224}, /* 6 */ - {13, 256}, /* 7 */ - {13, 288}, /* 8 */ - {13, 320}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {13, 352}, /* B */ - {13, 384}, /* C */ - {13, 416}, /* D */ - {0, 0}, /* E */ - {13, 448}, /* F */ - {13, 480}, /* G */ - {13, 512}, /* H */ - {0, 0}, /* I */ - {13, 544}, /* J */ - {13, 576}, /* K */ - {0, 0}, /* L */ - {13, 608}, /* M */ - {13, 640}, /* N */ - {0, 0}, /* O */ - {13, 672}, /* P */ - {13, 704}, /* Q */ - {13, 736}, /* R */ - {0, 0}, /* S */ - {13, 768}, /* T */ - {0, 0}, /* U */ - {13, 800}, /* V */ - {13, 832}, /* W */ - {13, 864}, /* X */ - {13, 896}, /* Y */ -}; - -/* Font information for Bedstead 17pt */ -const FONT_INFO bedstead_17ptFontInfo = { - "Bedstead", - 16, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - bedstead_17ptDescriptors, /* Character descriptor array */ - bedstead_17ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/bedstead/bedstead.h b/lib/fonts/bedstead/bedstead.h deleted file mode 100644 index 0f4c1094951..00000000000 --- a/lib/fonts/bedstead/bedstead.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font data for Bedstead 17pt */ -extern const FONT_INFO bedstead_17ptFontInfo; diff --git a/lib/fonts/dpcomic/dpcomic.c b/lib/fonts/dpcomic/dpcomic.c deleted file mode 100644 index 7d215c273ef..00000000000 --- a/lib/fonts/dpcomic/dpcomic.c +++ /dev/null @@ -1,1115 +0,0 @@ -#include "dpcomic.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for DPComic 18pt -*/ - -/* Character bitmaps for DPComic 18pt */ -const uint8_t dPComic_18ptBitmaps[] = { - /* @0 '-' (15 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xE0, - 0x3F, - 0xF8, - 0x0F, - 0xF8, - 0x0F, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @34 '0' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x07, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0xE0, - 0x07, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @68 '1' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x01, - 0xF8, - 0x01, - 0xF8, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @102 '2' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x07, - 0xC0, - 0x07, - 0xE0, - 0x0F, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x07, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x3F, - 0xF8, - 0x0F, - 0xF8, - 0x0F, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @136 '3' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x3F, - 0xC0, - 0x3F, - 0xE0, - 0x3F, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x07, - 0xC0, - 0x07, - 0xC0, - 0x07, - 0x00, - 0x0F, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0xE0, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @170 '4' (15 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0F, - 0xC0, - 0x0F, - 0xC0, - 0x0F, - 0xE0, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0xF8, - 0x0F, - 0xF8, - 0x0F, - 0xF8, - 0x0F, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @204 '5' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x3F, - 0xC0, - 0x3F, - 0xC0, - 0x0F, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x07, - 0xE0, - 0x0F, - 0xE0, - 0x0F, - 0x00, - 0x0E, - 0x00, - 0x0F, - 0x00, - 0x0F, - 0xE0, - 0x07, - 0xF8, - 0x01, - 0xF8, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @238 '6' (15 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x0F, - 0x00, - 0x0F, - 0xC0, - 0x07, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x07, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0F, - 0x38, - 0x0F, - 0xF8, - 0x07, - 0xE0, - 0x01, - 0xE0, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @272 '7' (15 pixels wide) */ - 0x00, - 0x00, - 0xE0, - 0x0F, - 0xE0, - 0x0F, - 0xF8, - 0x0F, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x07, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x00, - 0xF8, - 0x00, - 0xF8, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @306 '8' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x0F, - 0xC0, - 0x0F, - 0xE0, - 0x38, - 0xE0, - 0x3E, - 0xE0, - 0x3E, - 0xC0, - 0x0F, - 0xE0, - 0x07, - 0xE0, - 0x07, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0F, - 0xE0, - 0x07, - 0xE0, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @340 '9' (15 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x07, - 0xC0, - 0x07, - 0xE0, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0xF8, - 0x0F, - 0xF8, - 0x0F, - 0xE0, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0xE0, - 0x01, - 0xF8, - 0x00, - 0xF8, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @374 'B' (15 pixels wide) */ - 0xC0, - 0x0F, - 0xE0, - 0x3F, - 0xE0, - 0x3F, - 0xF8, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0xF8, - 0x0F, - 0xF8, - 0x3F, - 0xF8, - 0x3F, - 0x38, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0xF8, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @408 'C' (15 pixels wide) */ - 0x00, - 0x0F, - 0xC0, - 0x3F, - 0xC0, - 0x3F, - 0xE0, - 0x39, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xF8, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0xF8, - 0x0F, - 0xE0, - 0x07, - 0xE0, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @442 'D' (15 pixels wide) */ - 0xC0, - 0x07, - 0xE0, - 0x0F, - 0xE0, - 0x0F, - 0xF8, - 0x3E, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x0F, - 0x38, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x01, - 0xF8, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @476 'F' (15 pixels wide) */ - 0x80, - 0x1F, - 0xC0, - 0x0F, - 0xC0, - 0x0F, - 0xF0, - 0x01, - 0x70, - 0x00, - 0x70, - 0x00, - 0xF0, - 0x0F, - 0xF0, - 0x03, - 0xF0, - 0x03, - 0x70, - 0x00, - 0x70, - 0x00, - 0x70, - 0x00, - 0x70, - 0x00, - 0x70, - 0x00, - 0x70, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @510 'G' (15 pixels wide) */ - 0x00, - 0x0F, - 0xC0, - 0x3F, - 0xC0, - 0x3F, - 0xE0, - 0x39, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xF8, - 0x00, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0x38, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0xF8, - 0x0F, - 0xE0, - 0x07, - 0xE0, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @544 'H' (15 pixels wide) */ - 0x00, - 0x30, - 0x20, - 0x38, - 0x20, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0xF8, - 0x3F, - 0xF8, - 0x3F, - 0xF8, - 0x3F, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @578 'J' (15 pixels wide) */ - 0x00, - 0x08, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x00, - 0x0E, - 0x18, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0xE0, - 0x01, - 0xE0, - 0x01, - - /* @612 'K' (15 pixels wide) */ - 0x20, - 0x30, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x0F, - 0x38, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x38, - 0x0F, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @646 'M' (15 pixels wide) */ - 0x08, - 0x10, - 0x3E, - 0x1C, - 0x3E, - 0x1C, - 0x7E, - 0x1E, - 0xFE, - 0x1F, - 0xFE, - 0x1F, - 0xCE, - 0x1D, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x0E, - 0x1C, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @680 'N' (15 pixels wide) */ - 0x20, - 0x30, - 0xF8, - 0x38, - 0xF8, - 0x38, - 0xF8, - 0x38, - 0xF8, - 0x39, - 0xF8, - 0x39, - 0xF8, - 0x39, - 0x38, - 0x3F, - 0x38, - 0x3F, - 0x38, - 0x3F, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0x38, - 0x38, - 0x38, - 0x38, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @714 'P' (15 pixels wide) */ - 0xC0, - 0x07, - 0xE0, - 0x0F, - 0xE0, - 0x0F, - 0xF8, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0xF8, - 0x01, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x38, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @748 'Q' (15 pixels wide) */ - 0x00, - 0x0F, - 0xC0, - 0x3F, - 0xC0, - 0x3F, - 0xE0, - 0x39, - 0xE0, - 0x38, - 0xE0, - 0x38, - 0xF8, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x3E, - 0x38, - 0x3E, - 0xF8, - 0x0F, - 0xE0, - 0x3F, - 0xE0, - 0x3F, - 0x00, - 0x38, - 0x00, - 0x38, - - /* @782 'R' (15 pixels wide) */ - 0xC0, - 0x07, - 0xE0, - 0x0F, - 0xE0, - 0x0F, - 0xF8, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0F, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0xF8, - 0x01, - 0x38, - 0x07, - 0x38, - 0x07, - 0x38, - 0x0F, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @816 'T' (15 pixels wide) */ - 0x00, - 0x7E, - 0xE0, - 0x3F, - 0xE0, - 0x3F, - 0xF8, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @850 'V' (15 pixels wide) */ - 0x20, - 0x30, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x07, - 0x38, - 0x07, - 0xE0, - 0x07, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @884 'W' (15 pixels wide) */ - 0x04, - 0x40, - 0x07, - 0x70, - 0x07, - 0x70, - 0x07, - 0x71, - 0xC7, - 0x71, - 0xC7, - 0x71, - 0xC7, - 0x71, - 0xC7, - 0x71, - 0xC7, - 0x71, - 0xC7, - 0x71, - 0xE7, - 0x39, - 0xE7, - 0x39, - 0x3C, - 0x0F, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @918 'X' (15 pixels wide) */ - 0x18, - 0x30, - 0x38, - 0x38, - 0x38, - 0x38, - 0xF8, - 0x3E, - 0xE0, - 0x0F, - 0xE0, - 0x0F, - 0xC0, - 0x07, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x07, - 0x38, - 0x0F, - 0x38, - 0x0F, - 0x38, - 0x3E, - 0x18, - 0x38, - 0x18, - 0x38, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @952 'Y' (15 pixels wide) */ - 0x18, - 0x08, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0x38, - 0x0E, - 0xF8, - 0x0F, - 0xF8, - 0x0F, - 0xE0, - 0x07, - 0xE0, - 0x01, - 0xE0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* Character descriptors for DPComic 18pt */ -/* { [Char width in bits], [Offset into dPComic_18ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO dPComic_18ptDescriptors[] = { - {15, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {15, 34}, /* 0 */ - {15, 68}, /* 1 */ - {15, 102}, /* 2 */ - {15, 136}, /* 3 */ - {15, 170}, /* 4 */ - {15, 204}, /* 5 */ - {15, 238}, /* 6 */ - {15, 272}, /* 7 */ - {15, 306}, /* 8 */ - {15, 340}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {15, 374}, /* B */ - {15, 408}, /* C */ - {15, 442}, /* D */ - {0, 0}, /* E */ - {15, 476}, /* F */ - {15, 510}, /* G */ - {15, 544}, /* H */ - {0, 0}, /* I */ - {15, 578}, /* J */ - {15, 612}, /* K */ - {0, 0}, /* L */ - {15, 646}, /* M */ - {15, 680}, /* N */ - {0, 0}, /* O */ - {15, 714}, /* P */ - {15, 748}, /* Q */ - {15, 782}, /* R */ - {0, 0}, /* S */ - {15, 816}, /* T */ - {0, 0}, /* U */ - {15, 850}, /* V */ - {15, 884}, /* W */ - {15, 918}, /* X */ - {15, 952}, /* Y */ -}; - -/* Font information for DPComic 18pt */ -const FONT_INFO dPComic_18ptFontInfo = { - "DP Comic", - 17, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - dPComic_18ptDescriptors, /* Character descriptor array */ - dPComic_18ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/dpcomic/dpcomic.h b/lib/fonts/dpcomic/dpcomic.h deleted file mode 100644 index bac49b4d64c..00000000000 --- a/lib/fonts/dpcomic/dpcomic.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -extern const FONT_INFO dPComic_18ptFontInfo; \ No newline at end of file diff --git a/lib/fonts/font_info.h b/lib/fonts/font_info.h deleted file mode 100644 index b7bf6a045aa..00000000000 --- a/lib/fonts/font_info.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include - -// This structure describes a single character's display information -typedef struct { - const uint8_t width; // width, in bits (or pixels), of the character - const uint16_t - offset; // offset of the character's bitmap, in bytes, into the the FONT_INFO's data array - -} FONT_CHAR_INFO; - -// Describes a single font -typedef struct { - const char* name; // Font name - const uint8_t height; // height, in pages (8 pixels), of the font's characters - const uint8_t startChar; // the first character in the font (e.g. in charInfo and data) - const uint8_t endChar; // the last character in the font - const uint8_t spacePixels; // number of pixels that a space character takes up - const FONT_CHAR_INFO* charInfo; // pointer to array of char information - const uint8_t* data; // pointer to generated array of character visual representation -} FONT_INFO; \ No newline at end of file diff --git a/lib/fonts/funclimbing/funclimbing.c b/lib/fonts/funclimbing/funclimbing.c deleted file mode 100644 index 4176e1f373e..00000000000 --- a/lib/fonts/funclimbing/funclimbing.c +++ /dev/null @@ -1,1173 +0,0 @@ -#include "funclimbing.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for fun climbing (Demo) 18pt -*/ - -/* Character bitmaps for fun climbing (Demo) 18pt */ -const uint8_t funclimbingDemo_18ptBitmaps[] = { - /* @0 '-' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xE0, - 0x03, - 0xE0, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @36 '0' (16 pixels wide) */ - 0x00, - 0x00, - 0x80, - 0x00, - 0xE0, - 0x03, - 0x20, - 0x02, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x08, - 0x04, - 0x08, - 0x08, - 0x08, - 0x08, - 0x08, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x20, - 0x02, - 0xE0, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @72 '1' (16 pixels wide) */ - 0x00, - 0x02, - 0x00, - 0x03, - 0x80, - 0x03, - 0xC0, - 0x02, - 0x60, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x00, - - /* @108 '2' (16 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x07, - 0x60, - 0x04, - 0x20, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x08, - 0x02, - 0x08, - 0x02, - 0x00, - 0x01, - 0x00, - 0x01, - 0x80, - 0x00, - 0x80, - 0x00, - 0x40, - 0x00, - 0x60, - 0x00, - 0xC0, - 0x03, - 0x00, - 0x1C, - 0x00, - 0x00, - - /* @144 '3' (16 pixels wide) */ - 0x00, - 0x02, - 0x80, - 0x05, - 0x40, - 0x08, - 0x40, - 0x08, - 0x40, - 0x10, - 0x40, - 0x10, - 0x00, - 0x10, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x0C, - 0x00, - 0x06, - 0x00, - 0x03, - 0x80, - 0x0F, - 0x00, - 0x10, - 0x00, - 0x10, - 0x30, - 0x08, - 0xC0, - 0x07, - 0x00, - 0x00, - - /* @180 '4' (16 pixels wide) */ - 0x00, - 0x10, - 0x00, - 0x10, - 0x40, - 0x10, - 0x40, - 0x10, - 0x40, - 0x10, - 0x40, - 0x10, - 0x40, - 0x10, - 0x20, - 0x10, - 0x20, - 0x10, - 0x20, - 0x10, - 0x20, - 0x10, - 0x30, - 0x10, - 0xF0, - 0x1F, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - - /* @216 '5' (16 pixels wide) */ - 0x00, - 0x00, - 0x60, - 0x00, - 0xA0, - 0x03, - 0x20, - 0x04, - 0x20, - 0x00, - 0x30, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0xF0, - 0x00, - 0x80, - 0x03, - 0x00, - 0x04, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x04, - 0x80, - 0x03, - 0xF0, - 0x00, - 0x00, - 0x00, - - /* @252 '6' (16 pixels wide) */ - 0x00, - 0x00, - 0x40, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x18, - 0x03, - 0xC8, - 0x06, - 0x28, - 0x0C, - 0x18, - 0x08, - 0x18, - 0x08, - 0x08, - 0x08, - 0x08, - 0x08, - 0x10, - 0x08, - 0x30, - 0x0C, - 0xC0, - 0x07, - 0x00, - 0x00, - - /* @288 '7' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x0F, - 0xF0, - 0x09, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x06, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x03, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x00, - - /* @324 '8' (16 pixels wide) */ - 0x80, - 0x01, - 0x60, - 0x02, - 0x30, - 0x04, - 0x10, - 0x08, - 0x10, - 0x08, - 0x08, - 0x08, - 0x08, - 0x08, - 0x10, - 0x0C, - 0x10, - 0x04, - 0x60, - 0x03, - 0xC0, - 0x01, - 0x40, - 0x03, - 0x20, - 0x04, - 0x20, - 0x04, - 0x20, - 0x04, - 0x20, - 0x04, - 0xC0, - 0x03, - 0x00, - 0x00, - - /* @360 '9' (16 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x01, - 0x20, - 0x02, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0xE0, - 0x03, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x01, - 0x00, - 0x01, - 0x80, - 0x00, - 0x80, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @396 'B' (16 pixels wide) */ - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0xE8, - 0x0F, - 0x38, - 0x10, - 0x10, - 0x10, - 0x10, - 0x30, - 0x10, - 0x10, - 0x10, - 0x18, - 0xF0, - 0x07, - 0x20, - 0x00, - - /* @432 'C' (16 pixels wide) */ - 0x00, - 0x03, - 0x80, - 0x06, - 0x40, - 0x04, - 0x40, - 0x04, - 0x40, - 0x08, - 0x40, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x40, - 0x00, - 0x40, - 0x08, - 0x40, - 0x08, - 0x40, - 0x08, - 0xC0, - 0x08, - 0x80, - 0x04, - 0x80, - 0x05, - 0x00, - 0x02, - - /* @468 'D' (16 pixels wide) */ - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x80, - 0x07, - 0x40, - 0x04, - 0x20, - 0x04, - 0x20, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x30, - 0x04, - 0x20, - 0x04, - 0x20, - 0x04, - 0x40, - 0x04, - 0x80, - 0x05, - 0x00, - 0x07, - - /* @504 'F' (16 pixels wide) */ - 0x00, - 0x02, - 0x80, - 0x0D, - 0xC0, - 0x08, - 0x40, - 0x10, - 0x60, - 0x10, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0xF8, - 0x01, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x40, - 0x00, - - /* @540 'G' (16 pixels wide) */ - 0x80, - 0x00, - 0x60, - 0x01, - 0x20, - 0x03, - 0x30, - 0x02, - 0x10, - 0x02, - 0x10, - 0x02, - 0x10, - 0x02, - 0x10, - 0x02, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0xD0, - 0x0F, - 0x10, - 0x02, - 0x10, - 0x01, - 0x20, - 0x01, - 0xE0, - 0x00, - 0x40, - 0x00, - - /* @576 'H' (16 pixels wide) */ - 0x00, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x18, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x0F, - 0x90, - 0x09, - 0xD0, - 0x18, - 0x50, - 0x10, - 0x30, - 0x10, - 0x30, - 0x10, - 0x10, - 0x10, - 0x00, - 0x00, - - /* @612 'J' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x10, - 0x04, - 0x20, - 0x04, - 0x20, - 0x02, - 0x20, - 0x02, - 0x60, - 0x03, - 0xC0, - 0x01, - 0x00, - 0x00, - - /* @648 'K' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x08, - 0x10, - 0x0C, - 0x10, - 0x02, - 0xB0, - 0x01, - 0xE0, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0xA0, - 0x00, - 0x20, - 0x01, - 0x20, - 0x02, - 0x20, - 0x0C, - 0x20, - 0x08, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @684 'M' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x10, - 0x10, - 0x30, - 0x18, - 0x30, - 0x18, - 0x50, - 0x34, - 0x50, - 0x24, - 0xC8, - 0x22, - 0x88, - 0x22, - 0x88, - 0x21, - 0x08, - 0x21, - 0x04, - 0x60, - 0x04, - 0x40, - 0x04, - 0x40, - 0x04, - 0x40, - 0x02, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @720 'N' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x02, - 0x01, - 0x86, - 0x07, - 0x44, - 0x04, - 0x24, - 0x08, - 0x24, - 0x08, - 0x14, - 0x18, - 0x14, - 0x10, - 0x1C, - 0x10, - 0x0C, - 0x10, - 0x0C, - 0x10, - 0x08, - 0x10, - 0x00, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @756 'P' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0xE0, - 0x01, - 0x20, - 0x02, - 0x20, - 0x04, - 0x60, - 0x04, - 0x40, - 0x04, - 0x40, - 0x04, - 0x40, - 0x04, - 0x40, - 0x06, - 0x40, - 0x02, - 0xC0, - 0x01, - 0xC0, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @792 'Q' (16 pixels wide) */ - 0x00, - 0x00, - 0xC0, - 0x03, - 0x30, - 0x06, - 0x18, - 0x08, - 0x08, - 0x10, - 0x04, - 0x10, - 0x04, - 0x20, - 0x04, - 0x20, - 0x04, - 0x20, - 0x08, - 0x21, - 0x08, - 0x33, - 0x10, - 0x12, - 0x30, - 0x0E, - 0xC0, - 0x07, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x10, - 0x00, - 0x00, - - /* @828 'R' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x07, - 0x88, - 0x0D, - 0x48, - 0x08, - 0x68, - 0x00, - 0x28, - 0x00, - 0x28, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @864 'T' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0xE0, - 0x03, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x04, - 0x80, - 0x04, - 0x80, - 0x04, - 0x80, - 0x04, - 0x80, - 0x05, - 0x00, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @900 'V' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x08, - 0x10, - 0x10, - 0x10, - 0x10, - 0x18, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x04, - 0x10, - 0x04, - 0x20, - 0x04, - 0x20, - 0x02, - 0x20, - 0x02, - 0x20, - 0x01, - 0x40, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @936 'W' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x03, - 0x80, - 0x02, - 0x80, - 0x02, - 0x40, - 0x02, - 0x40, - 0x02, - 0x41, - 0x86, - 0x42, - 0x84, - 0x42, - 0x44, - 0x44, - 0x44, - 0x64, - 0x24, - 0x28, - 0x28, - 0x28, - 0x18, - 0x30, - 0x18, - 0x30, - 0x18, - 0x20, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @972 'X' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x08, - 0x08, - 0x10, - 0x04, - 0x20, - 0x04, - 0x40, - 0x02, - 0x80, - 0x03, - 0x80, - 0x01, - 0x80, - 0x03, - 0x40, - 0x02, - 0x30, - 0x04, - 0x18, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @1008 'Y' (16 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x08, - 0x08, - 0x08, - 0x08, - 0x08, - 0x0C, - 0x08, - 0x0C, - 0x08, - 0x0A, - 0x10, - 0x0A, - 0xF0, - 0x09, - 0x00, - 0x0C, - 0x10, - 0x04, - 0x10, - 0x04, - 0x20, - 0x02, - 0xE0, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, -}; - -/* Character descriptors for fun climbing (Demo) 18pt */ -/* { [Char width in bits], [Offset into funclimbingDemo_18ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO funclimbingDemo_18ptDescriptors[] = { - {16, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {16, 36}, /* 0 */ - {16, 72}, /* 1 */ - {16, 108}, /* 2 */ - {16, 144}, /* 3 */ - {16, 180}, /* 4 */ - {16, 216}, /* 5 */ - {16, 252}, /* 6 */ - {16, 288}, /* 7 */ - {16, 324}, /* 8 */ - {16, 360}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {16, 396}, /* B */ - {16, 432}, /* C */ - {16, 468}, /* D */ - {0, 0}, /* E */ - {16, 504}, /* F */ - {16, 540}, /* G */ - {16, 576}, /* H */ - {0, 0}, /* I */ - {16, 612}, /* J */ - {16, 648}, /* K */ - {0, 0}, /* L */ - {16, 684}, /* M */ - {16, 720}, /* N */ - {0, 0}, /* O */ - {16, 756}, /* P */ - {16, 792}, /* Q */ - {16, 828}, /* R */ - {0, 0}, /* S */ - {16, 864}, /* T */ - {0, 0}, /* U */ - {16, 900}, /* V */ - {16, 936}, /* W */ - {16, 972}, /* X */ - {16, 1008}, /* Y */ -}; - -/* Font information for fun climbing (Demo) 18pt */ -const FONT_INFO funclimbingDemo_18ptFontInfo = { - "Fun Climbing", - 18, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - funclimbingDemo_18ptDescriptors, /* Character descriptor array */ - funclimbingDemo_18ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/funclimbing/funclimbing.h b/lib/fonts/funclimbing/funclimbing.h deleted file mode 100644 index 26614adf125..00000000000 --- a/lib/fonts/funclimbing/funclimbing.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -extern const FONT_INFO funclimbingDemo_18ptFontInfo; \ No newline at end of file diff --git a/lib/fonts/graph35pix/graph35pix.c b/lib/fonts/graph35pix/graph35pix.c deleted file mode 100644 index d4edf52e2dd..00000000000 --- a/lib/fonts/graph35pix/graph35pix.c +++ /dev/null @@ -1,941 +0,0 @@ -#include "graph35pix.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for Graph 35+ pix 12pt -*/ - -/* Character bitmaps for Graph 35+ pix 12pt */ -const uint8_t graph35pix_12ptBitmaps[] = { - /* @0 '-' (10 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @28 '0' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0xC3, - 0x03, - 0xC3, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x0F, - 0x03, - 0x0F, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @56 '1' (10 pixels wide) */ - 0x30, - 0x00, - 0x30, - 0x00, - 0x3C, - 0x00, - 0x3C, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @84 '2' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - - /* @112 '3' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x00, - 0x03, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @140 '4' (10 pixels wide) */ - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xF0, - 0x00, - 0xF0, - 0x00, - 0xCC, - 0x00, - 0xCC, - 0x00, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - - /* @168 '5' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @196 '6' (10 pixels wide) */ - 0xF0, - 0x00, - 0xF0, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @224 '7' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - - /* @252 '8' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @280 '9' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x03, - 0xFC, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x3C, - 0x00, - 0x3C, - 0x00, - - /* @308 'B' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFF, - 0x00, - 0xFF, - 0x00, - - /* @336 'C' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @364 'D' (10 pixels wide) */ - 0x3F, - 0x00, - 0x3F, - 0x00, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x3F, - 0x00, - 0x3F, - 0x00, - - /* @392 'F' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - - /* @420 'G' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0xF3, - 0x03, - 0xF3, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFC, - 0x03, - 0xFC, - 0x03, - - /* @448 'H' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @476 'J' (10 pixels wide) */ - 0xF0, - 0x03, - 0xF0, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x3C, - 0x00, - 0x3C, - 0x00, - - /* @504 'K' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x33, - 0x00, - 0x33, - 0x00, - 0x0F, - 0x00, - 0x0F, - 0x00, - 0x33, - 0x00, - 0x33, - 0x00, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @532 'M' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0xCF, - 0x03, - 0xCF, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @560 'N' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x0F, - 0x03, - 0x0F, - 0x03, - 0x0F, - 0x03, - 0x0F, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0xC3, - 0x03, - 0xC3, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @588 'P' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - - /* @616 'Q' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x3C, - 0x03, - 0x3C, - 0x03, - - /* @644 'R' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x33, - 0x00, - 0x33, - 0x00, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @672 'T' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - - /* @700 'V' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xCC, - 0x00, - 0xCC, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - - /* @728 'W' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0xCC, - 0x00, - 0xCC, - 0x00, - - /* @756 'X' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xCC, - 0x00, - 0xCC, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0xCC, - 0x00, - 0xCC, - 0x00, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @784 'Y' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xCC, - 0x00, - 0xCC, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, -}; - -/* Character descriptors for Graph 35+ pix 12pt */ -/* { [Char width in bits], [Offset into graph35pix_12ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO graph35pix_12ptDescriptors[] = { - {10, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {10, 28}, /* 0 */ - {10, 56}, /* 1 */ - {10, 84}, /* 2 */ - {10, 112}, /* 3 */ - {10, 140}, /* 4 */ - {10, 168}, /* 5 */ - {10, 196}, /* 6 */ - {10, 224}, /* 7 */ - {10, 252}, /* 8 */ - {10, 280}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {10, 308}, /* B */ - {10, 336}, /* C */ - {10, 364}, /* D */ - {0, 0}, /* E */ - {10, 392}, /* F */ - {10, 420}, /* G */ - {10, 448}, /* H */ - {0, 0}, /* I */ - {10, 476}, /* J */ - {10, 504}, /* K */ - {0, 0}, /* L */ - {10, 532}, /* M */ - {10, 560}, /* N */ - {0, 0}, /* O */ - {10, 588}, /* P */ - {10, 616}, /* Q */ - {10, 644}, /* R */ - {0, 0}, /* S */ - {10, 672}, /* T */ - {0, 0}, /* U */ - {10, 700}, /* V */ - {10, 728}, /* W */ - {10, 756}, /* X */ - {10, 784}, /* Y */ -}; - -/* Font information for Graph 35+ pix 12pt */ -const FONT_INFO graph35pix_12ptFontInfo = { - "Graph 35pix", - 14, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - graph35pix_12ptDescriptors, /* Character descriptor array */ - graph35pix_12ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/graph35pix/graph35pix.h b/lib/fonts/graph35pix/graph35pix.h deleted file mode 100644 index 07838e3ba72..00000000000 --- a/lib/fonts/graph35pix/graph35pix.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font data for Graph 35+ pix 12pt */ -extern const FONT_INFO graph35pix_12ptFontInfo; diff --git a/lib/fonts/karma_future/karma_future.c b/lib/fonts/karma_future/karma_future.c deleted file mode 100644 index 23bebbc010f..00000000000 --- a/lib/fonts/karma_future/karma_future.c +++ /dev/null @@ -1,1173 +0,0 @@ -#include "karma_future.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for Karma Future 14pt -*/ - -/* Character bitmaps for Karma Future 14pt */ -const uint8_t karmaFuture_14ptBitmaps[] = { - /* @0 '-' (12 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFE, - 0x03, - 0x02, - 0x02, - 0x02, - 0x02, - 0xFE, - 0x03, - 0xFC, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @36 '0' (12 pixels wide) */ - 0xF8, - 0x01, - 0x0E, - 0x03, - 0x02, - 0x06, - 0xF3, - 0x06, - 0xF9, - 0x0C, - 0x79, - 0x0C, - 0x39, - 0x0D, - 0x99, - 0x0C, - 0xC9, - 0x0C, - 0xE9, - 0x0C, - 0xF1, - 0x0C, - 0xF1, - 0x0C, - 0xF1, - 0x0C, - 0xF3, - 0x0E, - 0x02, - 0x0E, - 0x0E, - 0x07, - 0xFC, - 0x07, - 0xF8, - 0x01, - - /* @72 '1' (12 pixels wide) */ - 0x70, - 0x00, - 0xD8, - 0x00, - 0xCE, - 0x00, - 0xC2, - 0x00, - 0xC2, - 0x00, - 0xDE, - 0x00, - 0xDC, - 0x00, - 0xDC, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xDE, - 0x03, - 0x02, - 0x02, - 0x02, - 0x02, - 0xFE, - 0x03, - 0xFC, - 0x03, - - /* @108 '2' (12 pixels wide) */ - 0xFC, - 0x03, - 0x06, - 0x03, - 0x03, - 0x06, - 0xF1, - 0x04, - 0xF9, - 0x0C, - 0xF9, - 0x0C, - 0x7F, - 0x0E, - 0x3E, - 0x0F, - 0x1E, - 0x0F, - 0x90, - 0x07, - 0xC8, - 0x03, - 0xE4, - 0x01, - 0xE6, - 0x00, - 0xF3, - 0x07, - 0x01, - 0x0C, - 0x01, - 0x0C, - 0xFF, - 0x0F, - 0xFE, - 0x0F, - - /* @144 '3' (12 pixels wide) */ - 0xFC, - 0x03, - 0x06, - 0x03, - 0x03, - 0x06, - 0xF1, - 0x04, - 0xF9, - 0x0C, - 0xFF, - 0x0C, - 0xFE, - 0x0C, - 0x0E, - 0x0E, - 0x08, - 0x0F, - 0xF8, - 0x0E, - 0xF8, - 0x04, - 0xFF, - 0x0C, - 0xF9, - 0x0C, - 0xF1, - 0x0C, - 0x03, - 0x0E, - 0x06, - 0x0F, - 0xFC, - 0x07, - 0xFC, - 0x03, - - /* @180 '4' (12 pixels wide) */ - 0xE0, - 0x03, - 0x30, - 0x03, - 0x10, - 0x03, - 0x08, - 0x03, - 0x4C, - 0x03, - 0x64, - 0x03, - 0x72, - 0x03, - 0x73, - 0x03, - 0x79, - 0x03, - 0x01, - 0x04, - 0x01, - 0x0C, - 0x7F, - 0x0F, - 0x7E, - 0x0F, - 0x7E, - 0x0F, - 0x40, - 0x03, - 0x40, - 0x03, - 0xC0, - 0x03, - 0x80, - 0x03, - - /* @216 '5' (12 pixels wide) */ - 0xFF, - 0x07, - 0x01, - 0x0C, - 0x01, - 0x0C, - 0xF9, - 0x0F, - 0xF9, - 0x0F, - 0xF9, - 0x0F, - 0x01, - 0x03, - 0x03, - 0x06, - 0xFE, - 0x04, - 0xFE, - 0x0C, - 0xFC, - 0x0C, - 0xFF, - 0x0C, - 0xF9, - 0x0C, - 0xF1, - 0x0C, - 0x03, - 0x0E, - 0x06, - 0x0F, - 0xFC, - 0x07, - 0xF8, - 0x03, - - /* @252 '6' (12 pixels wide) */ - 0xF0, - 0x03, - 0x10, - 0x03, - 0x08, - 0x03, - 0xCC, - 0x03, - 0xE6, - 0x03, - 0xF2, - 0x03, - 0xF2, - 0x00, - 0x01, - 0x03, - 0x01, - 0x06, - 0xF1, - 0x04, - 0xF9, - 0x0C, - 0xF9, - 0x0C, - 0xF9, - 0x0C, - 0xF1, - 0x0C, - 0x03, - 0x0E, - 0x06, - 0x0F, - 0xFC, - 0x07, - 0xF8, - 0x03, - - /* @288 '7' (12 pixels wide) */ - 0xFF, - 0x07, - 0x01, - 0x0C, - 0x01, - 0x0C, - 0xFF, - 0x0E, - 0xFE, - 0x0E, - 0x7E, - 0x0F, - 0x40, - 0x07, - 0x60, - 0x07, - 0x20, - 0x03, - 0x30, - 0x03, - 0x90, - 0x01, - 0x90, - 0x01, - 0xD0, - 0x00, - 0xC8, - 0x00, - 0xE8, - 0x00, - 0xE8, - 0x00, - 0x78, - 0x00, - 0x78, - 0x00, - - /* @324 '8' (12 pixels wide) */ - 0xF8, - 0x01, - 0x0C, - 0x01, - 0x06, - 0x03, - 0x72, - 0x06, - 0xF2, - 0x06, - 0xF2, - 0x06, - 0x72, - 0x06, - 0x06, - 0x07, - 0x02, - 0x06, - 0xF1, - 0x04, - 0xF9, - 0x0C, - 0xF9, - 0x0C, - 0xF9, - 0x0C, - 0xF1, - 0x0C, - 0x03, - 0x0E, - 0x06, - 0x0F, - 0xFC, - 0x07, - 0xF8, - 0x03, - - /* @360 '9' (12 pixels wide) */ - 0xFC, - 0x03, - 0x06, - 0x03, - 0x03, - 0x06, - 0xF1, - 0x04, - 0xF9, - 0x0C, - 0xF9, - 0x0C, - 0xF1, - 0x0C, - 0x03, - 0x0C, - 0x06, - 0x0C, - 0xFE, - 0x0E, - 0x7C, - 0x0E, - 0x38, - 0x0F, - 0x30, - 0x07, - 0x1C, - 0x07, - 0x84, - 0x03, - 0xC4, - 0x01, - 0xFC, - 0x00, - 0xF8, - 0x00, - - /* @396 'B' (12 pixels wide) */ - 0xFE, - 0x01, - 0x02, - 0x03, - 0x02, - 0x02, - 0x72, - 0x06, - 0xF2, - 0x06, - 0xF2, - 0x06, - 0x72, - 0x06, - 0x02, - 0x06, - 0x02, - 0x06, - 0xF2, - 0x0C, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0C, - 0x02, - 0x0E, - 0x02, - 0x0E, - 0xFE, - 0x07, - 0xFC, - 0x03, - - /* @432 'C' (12 pixels wide) */ - 0xF0, - 0x03, - 0x18, - 0x02, - 0x0C, - 0x06, - 0xE4, - 0x0C, - 0xE6, - 0x0D, - 0xF2, - 0x0F, - 0x72, - 0x0F, - 0x32, - 0x0F, - 0x12, - 0x00, - 0x12, - 0x00, - 0x12, - 0x00, - 0x32, - 0x07, - 0xA6, - 0x0D, - 0xE4, - 0x0C, - 0x08, - 0x0E, - 0x18, - 0x0E, - 0xF0, - 0x07, - 0xF0, - 0x03, - - /* @468 'D' (12 pixels wide) */ - 0xFE, - 0x01, - 0x02, - 0x03, - 0x02, - 0x02, - 0x72, - 0x06, - 0xF2, - 0x06, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0E, - 0xF2, - 0x0E, - 0x72, - 0x0E, - 0x02, - 0x06, - 0x02, - 0x07, - 0xFE, - 0x03, - 0xFC, - 0x01, - - /* @504 'F' (12 pixels wide) */ - 0xFE, - 0x07, - 0x02, - 0x0C, - 0x02, - 0x0C, - 0xF2, - 0x0F, - 0xF2, - 0x0F, - 0xF2, - 0x0F, - 0x12, - 0x00, - 0xF2, - 0x03, - 0x02, - 0x02, - 0xF2, - 0x03, - 0xF2, - 0x03, - 0xF2, - 0x03, - 0x12, - 0x00, - 0x12, - 0x00, - 0x12, - 0x00, - 0x12, - 0x00, - 0x1E, - 0x00, - 0x1C, - 0x00, - - /* @540 'G' (12 pixels wide) */ - 0xF0, - 0x07, - 0x18, - 0x06, - 0x0C, - 0x0C, - 0xE4, - 0x0D, - 0xE6, - 0x0F, - 0xF2, - 0x0F, - 0xF2, - 0x0F, - 0x32, - 0x04, - 0x32, - 0x0C, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xE6, - 0x0D, - 0xE6, - 0x0D, - 0xE4, - 0x0D, - 0x08, - 0x0C, - 0x18, - 0x0C, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - - /* @576 'H' (12 pixels wide) */ - 0x1E, - 0x07, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0xF2, - 0x0D, - 0x02, - 0x0C, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x1E, - 0x0F, - 0x1C, - 0x0F, - - /* @612 'J' (12 pixels wide) */ - 0x80, - 0x03, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x80, - 0x06, - 0x8E, - 0x06, - 0x8A, - 0x06, - 0xDA, - 0x06, - 0x72, - 0x06, - 0x02, - 0x06, - 0x06, - 0x03, - 0xFC, - 0x03, - 0xF8, - 0x01, - - /* @648 'K' (12 pixels wide) */ - 0x1E, - 0x07, - 0x92, - 0x0D, - 0xD2, - 0x0C, - 0x72, - 0x0E, - 0x32, - 0x0E, - 0x12, - 0x0F, - 0x92, - 0x07, - 0xC2, - 0x03, - 0xC2, - 0x01, - 0x92, - 0x01, - 0x12, - 0x01, - 0x32, - 0x02, - 0x32, - 0x02, - 0x72, - 0x06, - 0xD2, - 0x0C, - 0x92, - 0x0D, - 0x9E, - 0x0F, - 0x1C, - 0x0F, - - /* @684 'M' (12 pixels wide) */ - 0x1E, - 0x07, - 0x92, - 0x0D, - 0xA2, - 0x0C, - 0xE2, - 0x0C, - 0x62, - 0x0C, - 0x62, - 0x0C, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x92, - 0x0D, - 0x92, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x1E, - 0x0F, - 0x1C, - 0x0F, - - /* @720 'N' (12 pixels wide) */ - 0x1E, - 0x07, - 0x12, - 0x0D, - 0x22, - 0x0D, - 0x62, - 0x0D, - 0x62, - 0x0D, - 0xD2, - 0x0D, - 0xD2, - 0x0D, - 0x92, - 0x0D, - 0x92, - 0x0D, - 0x32, - 0x0D, - 0x32, - 0x0D, - 0x72, - 0x0C, - 0x52, - 0x0C, - 0xD2, - 0x0C, - 0x92, - 0x0C, - 0x92, - 0x0D, - 0x1E, - 0x0F, - 0x1C, - 0x0F, - - /* @756 'P' (12 pixels wide) */ - 0xFE, - 0x03, - 0x02, - 0x02, - 0x02, - 0x06, - 0xF2, - 0x0C, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0C, - 0x02, - 0x0E, - 0x02, - 0x0E, - 0xF2, - 0x0F, - 0xF2, - 0x07, - 0xF2, - 0x03, - 0x12, - 0x00, - 0x12, - 0x00, - 0x12, - 0x00, - 0x1E, - 0x00, - 0x1C, - 0x00, - - /* @792 'Q' (12 pixels wide) */ - 0xF0, - 0x01, - 0x18, - 0x03, - 0x0C, - 0x02, - 0x64, - 0x06, - 0xE6, - 0x06, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0x32, - 0x0D, - 0x26, - 0x0E, - 0x26, - 0x0E, - 0x64, - 0x0E, - 0x08, - 0x0C, - 0x18, - 0x0D, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - - /* @828 'R' (12 pixels wide) */ - 0xFE, - 0x03, - 0x02, - 0x02, - 0x02, - 0x06, - 0xF2, - 0x0C, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0D, - 0xF2, - 0x0C, - 0x02, - 0x0E, - 0x02, - 0x0E, - 0x12, - 0x0F, - 0x32, - 0x06, - 0x32, - 0x06, - 0x72, - 0x06, - 0xD2, - 0x0C, - 0x92, - 0x0D, - 0x9E, - 0x0F, - 0x1C, - 0x0F, - - /* @864 'T' (12 pixels wide) */ - 0xFE, - 0x03, - 0x02, - 0x02, - 0x02, - 0x02, - 0xDE, - 0x03, - 0xDC, - 0x03, - 0xDC, - 0x03, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xD0, - 0x00, - 0xF0, - 0x00, - 0xF0, - 0x00, - - /* @900 'V' (12 pixels wide) */ - 0x1E, - 0x07, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x92, - 0x0D, - 0xA6, - 0x0E, - 0xA4, - 0x0E, - 0xA4, - 0x0E, - 0xE4, - 0x06, - 0x6C, - 0x06, - 0x68, - 0x06, - 0x68, - 0x02, - 0x18, - 0x03, - 0x10, - 0x03, - 0x10, - 0x01, - 0x90, - 0x01, - 0x90, - 0x01, - 0xE0, - 0x01, - 0xE0, - 0x01, - - /* @936 'W' (12 pixels wide) */ - 0x1E, - 0x07, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0x12, - 0x0D, - 0xF2, - 0x0D, - 0x92, - 0x0D, - 0x12, - 0x0D, - 0x62, - 0x0C, - 0x62, - 0x0C, - 0xE2, - 0x0C, - 0xE2, - 0x0C, - 0xB2, - 0x0D, - 0x3E, - 0x0F, - 0x1C, - 0x0F, - - /* @972 'X' (12 pixels wide) */ - 0x1E, - 0x07, - 0x12, - 0x0D, - 0xB2, - 0x0D, - 0xA6, - 0x0E, - 0xE4, - 0x0E, - 0x6C, - 0x0E, - 0x18, - 0x07, - 0x98, - 0x07, - 0x90, - 0x03, - 0x10, - 0x01, - 0x68, - 0x02, - 0xE4, - 0x02, - 0xE4, - 0x06, - 0xE6, - 0x06, - 0xB2, - 0x0D, - 0x32, - 0x0D, - 0x1E, - 0x0F, - 0x1C, - 0x0E, - - /* @1008 'Y' (12 pixels wide) */ - 0x1E, - 0x07, - 0x12, - 0x0D, - 0xB2, - 0x0D, - 0xA6, - 0x0E, - 0xE4, - 0x0E, - 0x6C, - 0x0E, - 0x68, - 0x06, - 0x18, - 0x07, - 0x18, - 0x03, - 0x90, - 0x03, - 0x90, - 0x01, - 0x90, - 0x01, - 0xA0, - 0x01, - 0xA0, - 0x01, - 0xA0, - 0x01, - 0xE0, - 0x01, - 0xE0, - 0x01, - 0xE0, - 0x01, -}; - -/* Character descriptors for Karma Future 14pt */ -/* { [Char width in bits], [Offset into karmaFuture_14ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO karmaFuture_14ptDescriptors[] = { - {12, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {12, 36}, /* 0 */ - {12, 72}, /* 1 */ - {12, 108}, /* 2 */ - {12, 144}, /* 3 */ - {12, 180}, /* 4 */ - {12, 216}, /* 5 */ - {12, 252}, /* 6 */ - {12, 288}, /* 7 */ - {12, 324}, /* 8 */ - {12, 360}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {12, 396}, /* B */ - {12, 432}, /* C */ - {12, 468}, /* D */ - {0, 0}, /* E */ - {12, 504}, /* F */ - {12, 540}, /* G */ - {12, 576}, /* H */ - {0, 0}, /* I */ - {12, 612}, /* J */ - {12, 648}, /* K */ - {0, 0}, /* L */ - {12, 684}, /* M */ - {12, 720}, /* N */ - {0, 0}, /* O */ - {12, 756}, /* P */ - {12, 792}, /* Q */ - {12, 828}, /* R */ - {0, 0}, /* S */ - {12, 864}, /* T */ - {0, 0}, /* U */ - {12, 900}, /* V */ - {12, 936}, /* W */ - {12, 972}, /* X */ - {12, 1008}, /* Y */ -}; - -/* Font information for Karma Future 14pt */ -const FONT_INFO karmaFuture_14ptFontInfo = { - "Karma Future", - 18, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - karmaFuture_14ptDescriptors, /* Character descriptor array */ - karmaFuture_14ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/karma_future/karma_future.h b/lib/fonts/karma_future/karma_future.h deleted file mode 100644 index 3a6352ef18d..00000000000 --- a/lib/fonts/karma_future/karma_future.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font data for Karma Future 14pt */ -extern const FONT_INFO karmaFuture_14ptFontInfo; diff --git a/lib/fonts/mode_nine/mode_nine.c b/lib/fonts/mode_nine/mode_nine.c deleted file mode 100644 index 5d19f59aa9e..00000000000 --- a/lib/fonts/mode_nine/mode_nine.c +++ /dev/null @@ -1,942 +0,0 @@ -#include "mode_nine.h" -#include - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for ModeNine 15pt -*/ - -/* Character bitmaps for ModeNine 15pt */ -const uint8_t modeNine_15ptBitmaps[] = { - /* @0 '-' (10 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @28 '0' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @56 '1' (10 pixels wide) */ - 0x30, - 0x00, - 0x38, - 0x00, - 0x3C, - 0x00, - 0x3C, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0xFC, - 0x00, - 0xFC, - 0x00, - - /* @84 '2' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x00, - 0x03, - 0x80, - 0x03, - 0xFC, - 0x01, - 0xFE, - 0x00, - 0x07, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - - /* @112 '3' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x80, - 0x03, - 0xC0, - 0x01, - 0xE0, - 0x00, - 0x70, - 0x00, - 0xF8, - 0x00, - 0xFC, - 0x01, - 0x80, - 0x03, - 0x00, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @140 '4' (10 pixels wide) */ - 0xE0, - 0x00, - 0xF0, - 0x00, - 0xF8, - 0x00, - 0xDC, - 0x00, - 0xCE, - 0x00, - 0xC7, - 0x00, - 0xC3, - 0x00, - 0xC3, - 0x00, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - - /* @168 '5' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x01, - 0x80, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @196 '6' (10 pixels wide) */ - 0xF0, - 0x00, - 0xFC, - 0x00, - 0x0E, - 0x00, - 0x06, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x01, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @224 '7' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x00, - 0x03, - 0x80, - 0x01, - 0xC0, - 0x01, - 0xE0, - 0x00, - 0x30, - 0x00, - 0x18, - 0x00, - 0x1C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - - /* @252 '8' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @280 '9' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x07, - 0x03, - 0xFE, - 0x03, - 0xFC, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x80, - 0x01, - 0xC0, - 0x01, - 0xFC, - 0x00, - 0x3C, - 0x00, - - /* @308 'B' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x01, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x83, - 0x03, - 0xFF, - 0x01, - 0xFF, - 0x01, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x83, - 0x03, - 0xFF, - 0x01, - 0xFF, - 0x00, - - /* @336 'C' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @364 'D' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x01, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x83, - 0x03, - 0xFF, - 0x01, - 0xFF, - 0x00, - - /* @392 'F' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0xFF, - 0x00, - 0xFF, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - - /* @420 'G' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0xC3, - 0x03, - 0xC3, - 0x03, - 0x03, - 0x03, - 0x07, - 0x03, - 0xFE, - 0x03, - 0xFC, - 0x03, - - /* @448 'H' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @476 'J' (10 pixels wide) */ - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x00, - - /* @504 'K' (10 pixels wide) */ - 0x83, - 0x03, - 0xC3, - 0x01, - 0xE3, - 0x00, - 0x73, - 0x00, - 0x3B, - 0x00, - 0x1F, - 0x00, - 0x0F, - 0x00, - 0x0F, - 0x00, - 0x1F, - 0x00, - 0x3B, - 0x00, - 0x73, - 0x00, - 0xE3, - 0x00, - 0xC3, - 0x01, - 0x83, - 0x03, - - /* @532 'M' (10 pixels wide) */ - 0x03, - 0x03, - 0x87, - 0x03, - 0xCF, - 0x03, - 0xFF, - 0x03, - 0x7B, - 0x03, - 0x33, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @560 'N' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x07, - 0x03, - 0x0F, - 0x03, - 0x1F, - 0x03, - 0x3B, - 0x03, - 0x73, - 0x03, - 0xE3, - 0x03, - 0xC3, - 0x03, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @588 'P' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x01, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x83, - 0x03, - 0xFF, - 0x01, - 0xFF, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - - /* @616 'Q' (10 pixels wide) */ - 0xFC, - 0x00, - 0xFE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x33, - 0x03, - 0x73, - 0x03, - 0xE7, - 0x03, - 0xFE, - 0x01, - 0xFC, - 0x03, - - /* @644 'R' (10 pixels wide) */ - 0xFF, - 0x00, - 0xFF, - 0x01, - 0x83, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x83, - 0x03, - 0xFF, - 0x01, - 0xFF, - 0x00, - 0x1F, - 0x00, - 0x3B, - 0x00, - 0x73, - 0x00, - 0xE3, - 0x00, - 0xC3, - 0x01, - 0x83, - 0x03, - - /* @672 'T' (10 pixels wide) */ - 0xFF, - 0x03, - 0xFF, - 0x03, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - - /* @700 'V' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x86, - 0x01, - 0x86, - 0x01, - 0xCC, - 0x00, - 0xCC, - 0x00, - 0x78, - 0x00, - 0x78, - 0x00, - 0x30, - 0x00, - - /* @728 'W' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0x33, - 0x03, - 0xFF, - 0x03, - 0xFE, - 0x01, - - /* @756 'X' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xCE, - 0x01, - 0xFC, - 0x00, - 0xFC, - 0x00, - 0xCE, - 0x01, - 0x87, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - - /* @784 'Y' (10 pixels wide) */ - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x03, - 0x87, - 0x03, - 0xCE, - 0x01, - 0xFC, - 0x00, - 0x78, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, - 0x30, - 0x00, -}; - -/* Character descriptors for ModeNine 15pt */ -/* { [Char width in bits], [Offset into modeNine_15ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO modeNine_15ptDescriptors[] = { - {10, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {10, 28}, /* 0 */ - {10, 56}, /* 1 */ - {10, 84}, /* 2 */ - {10, 112}, /* 3 */ - {10, 140}, /* 4 */ - {10, 168}, /* 5 */ - {10, 196}, /* 6 */ - {10, 224}, /* 7 */ - {10, 252}, /* 8 */ - {10, 280}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {10, 308}, /* B */ - {10, 336}, /* C */ - {10, 364}, /* D */ - {0, 0}, /* E */ - {10, 392}, /* F */ - {10, 420}, /* G */ - {10, 448}, /* H */ - {0, 0}, /* I */ - {10, 476}, /* J */ - {10, 504}, /* K */ - {0, 0}, /* L */ - {10, 532}, /* M */ - {10, 560}, /* N */ - {0, 0}, /* O */ - {10, 588}, /* P */ - {10, 616}, /* Q */ - {10, 644}, /* R */ - {0, 0}, /* S */ - {10, 672}, /* T */ - {0, 0}, /* U */ - {10, 700}, /* V */ - {10, 728}, /* W */ - {10, 756}, /* X */ - {10, 784}, /* Y */ -}; - -/* Font information for ModeNine 15pt */ -const FONT_INFO modeNine_15ptFontInfo = { - "Mode Nine", - 14, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - modeNine_15ptDescriptors, /* Character descriptor array */ - modeNine_15ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/mode_nine/mode_nine.h b/lib/fonts/mode_nine/mode_nine.h deleted file mode 100644 index 516e261f8b4..00000000000 --- a/lib/fonts/mode_nine/mode_nine.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font data for ModeNine 15pt */ -extern const FONT_INFO modeNine_15ptFontInfo; diff --git a/lib/fonts/pixelflag/pixelflag.c b/lib/fonts/pixelflag/pixelflag.c deleted file mode 100644 index eacf36b2827..00000000000 --- a/lib/fonts/pixelflag/pixelflag.c +++ /dev/null @@ -1,1115 +0,0 @@ -#include "pixelflag.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for {PixelFlag} 18pt -*/ - -/* Character bitmaps for {PixelFlag} 18pt */ -const uint8_t pixelFlag_18ptBitmaps[] = { - /* @0 '-' (13 pixels wide) */ - 0xFE, - 0x07, - 0xFE, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFE, - 0x07, - 0xFE, - 0x07, - - /* @34 '0' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @68 '1' (13 pixels wide) */ - 0xff, - 0xff, - 0xff, - 0xff, - 0x00, - 0xe0, - 0xc0, - 0xe0, - 0xc0, - 0xe0, - 0xe0, - 0xe0, - 0xe0, - 0xe0, - 0xc0, - 0xe0, - 0xc0, - 0xe0, - 0xc0, - 0xe0, - 0xc0, - 0xe0, - 0xc0, - 0xe0, - 0xe0, - 0xe3, - 0xe0, - 0xe3, - 0x00, - 0xe0, - 0xff, - 0xff, - 0xff, - 0xff, - - /* @102 '2' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0xF8, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @136 '3' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0xE0, - 0x07, - 0xE0, - 0x1F, - 0x00, - 0x18, - 0x00, - 0x18, - 0xFC, - 0x1F, - 0xFC, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @170 '4' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x07, - 0xC0, - 0x07, - 0xC0, - 0x06, - 0x60, - 0x06, - 0x78, - 0x06, - 0x18, - 0x06, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0x00, - 0x06, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @204 '5' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x1F, - 0x00, - 0x18, - 0x00, - 0x18, - 0xFC, - 0x1F, - 0xFC, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @238 '6' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x1F, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @272 '7' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0x00, - 0x06, - 0x00, - 0x07, - 0x00, - 0x03, - 0xC0, - 0x00, - 0xE0, - 0x00, - 0x60, - 0x00, - 0x18, - 0x00, - 0x1C, - 0x00, - 0x0C, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @306 '8' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xF8, - 0x07, - 0xFC, - 0x1F, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @340 '9' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xF8, - 0x1F, - 0xF8, - 0x1F, - 0x00, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @374 'B' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x07, - 0xFC, - 0x1F, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xFC, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @408 'C' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @442 'D' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xFC, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @476 'F' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x03, - 0xFC, - 0x03, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @510 'G' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x00, - 0xCC, - 0x1F, - 0xCC, - 0x1F, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @544 'H' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @578 'J' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @612 'K' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x06, - 0x0C, - 0x07, - 0x0C, - 0x03, - 0xFC, - 0x00, - 0xFC, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x06, - 0x0C, - 0x1E, - 0x0C, - 0x18, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @646 'M' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x1C, - 0x1E, - 0x7C, - 0x1F, - 0x6C, - 0x1B, - 0xCC, - 0x18, - 0xCC, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @680 'N' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x1C, - 0x18, - 0x7C, - 0x18, - 0x6C, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x1B, - 0x0C, - 0x1B, - 0x0C, - 0x1E, - 0x0C, - 0x1E, - 0x0C, - 0x18, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @714 'P' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @748 'Q' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xF8, - 0x07, - 0xF8, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x1B, - 0x0C, - 0x1B, - 0x0C, - 0x1E, - 0xFC, - 0x1F, - 0xF8, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @782 'R' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xFC, - 0x07, - 0xFC, - 0x1F, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @816 'T' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0xFC, - 0x1F, - 0xFC, - 0x1F, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @850 'V' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x1C, - 0x1E, - 0x18, - 0x06, - 0x60, - 0x03, - 0xE0, - 0x03, - 0xC0, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @884 'W' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x18, - 0xCC, - 0x18, - 0xFC, - 0x1F, - 0x78, - 0x07, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @918 'X' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x18, - 0x06, - 0x78, - 0x07, - 0x60, - 0x03, - 0xC0, - 0x00, - 0xE0, - 0x03, - 0x60, - 0x03, - 0x18, - 0x06, - 0x1C, - 0x1E, - 0x0C, - 0x18, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, - - /* @952 'Y' (13 pixels wide) */ - 0xFF, - 0x1F, - 0xFF, - 0x1F, - 0x00, - 0x00, - 0x0C, - 0x18, - 0x0C, - 0x18, - 0x18, - 0x06, - 0x78, - 0x07, - 0x60, - 0x03, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0xC0, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x1F, - 0xFF, - 0x1F, -}; - -/* Character descriptors for {PixelFlag} 18pt */ -/* { [Char width in bits], [Offset into pixelFlag_18ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO pixelFlag_18ptDescriptors[] = { - {13, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {13, 34}, /* 0 */ - {13, 68}, /* 1 */ - {13, 102}, /* 2 */ - {13, 136}, /* 3 */ - {13, 170}, /* 4 */ - {13, 204}, /* 5 */ - {13, 238}, /* 6 */ - {13, 272}, /* 7 */ - {13, 306}, /* 8 */ - {13, 340}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {13, 374}, /* B */ - {13, 408}, /* C */ - {13, 442}, /* D */ - {0, 0}, /* E */ - {13, 476}, /* F */ - {13, 510}, /* G */ - {13, 544}, /* H */ - {0, 0}, /* I */ - {13, 578}, /* J */ - {13, 612}, /* K */ - {0, 0}, /* L */ - {13, 646}, /* M */ - {13, 680}, /* N */ - {0, 0}, /* O */ - {13, 714}, /* P */ - {13, 748}, /* Q */ - {13, 782}, /* R */ - {0, 0}, /* S */ - {13, 816}, /* T */ - {0, 0}, /* U */ - {13, 850}, /* V */ - {13, 884}, /* W */ - {13, 918}, /* X */ - {13, 952}, /* Y */ -}; - -/* Font information for {PixelFlag} 18pt */ -const FONT_INFO pixelFlag_18ptFontInfo = { - "Pixel Flag", - 17, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 0, /* Width, in pixels, of space character */ - pixelFlag_18ptDescriptors, /* Character descriptor array */ - pixelFlag_18ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/pixelflag/pixelflag.h b/lib/fonts/pixelflag/pixelflag.h deleted file mode 100644 index dc339c84d60..00000000000 --- a/lib/fonts/pixelflag/pixelflag.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -extern const FONT_INFO pixelFlag_18ptFontInfo; \ No newline at end of file diff --git a/lib/fonts/redhat_mono/redhat_mono.c b/lib/fonts/redhat_mono/redhat_mono.c deleted file mode 100644 index e39b6c81c3a..00000000000 --- a/lib/fonts/redhat_mono/redhat_mono.c +++ /dev/null @@ -1,1058 +0,0 @@ -#include "redhat_mono.h" -#include - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for Red Hat Mono 16pt -*/ - -/* Character bitmaps for Red Hat Mono 16pt */ -const uint8_t redHatMono_16ptBitmaps[] = { - /* @0 '-' (12 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xF8, - 0x03, - 0xF8, - 0x03, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @32 '0' (12 pixels wide) */ - 0xF0, - 0x00, - 0xF8, - 0x03, - 0x1C, - 0x07, - 0x0E, - 0x07, - 0x8E, - 0x07, - 0x86, - 0x0E, - 0xC6, - 0x0C, - 0x66, - 0x0C, - 0x66, - 0x0C, - 0x36, - 0x0E, - 0x36, - 0x0E, - 0x1E, - 0x06, - 0x1C, - 0x07, - 0xF8, - 0x03, - 0xF0, - 0x01, - 0x00, - 0x00, - - /* @64 '1' (12 pixels wide) */ - 0x40, - 0x00, - 0x78, - 0x00, - 0x7E, - 0x00, - 0x66, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0x60, - 0x00, - 0xFE, - 0x07, - 0xFE, - 0x07, - 0x00, - 0x00, - - /* @96 '2' (12 pixels wide) */ - 0xF0, - 0x01, - 0xFC, - 0x03, - 0x0E, - 0x07, - 0x04, - 0x06, - 0x00, - 0x06, - 0x00, - 0x07, - 0x00, - 0x03, - 0x80, - 0x03, - 0xC0, - 0x01, - 0xE0, - 0x00, - 0x70, - 0x00, - 0x38, - 0x00, - 0x1C, - 0x00, - 0xFE, - 0x07, - 0xFE, - 0x07, - 0x00, - 0x00, - - /* @128 '3' (12 pixels wide) */ - 0xF0, - 0x00, - 0xFC, - 0x03, - 0x0E, - 0x07, - 0x04, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x80, - 0x03, - 0xE0, - 0x00, - 0xE0, - 0x03, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x0E, - 0x06, - 0x07, - 0xFE, - 0x07, - 0xF8, - 0x01, - 0x00, - 0x00, - - /* @160 '4' (12 pixels wide) */ - 0x00, - 0x03, - 0x80, - 0x03, - 0xC0, - 0x03, - 0xE0, - 0x03, - 0x70, - 0x03, - 0x30, - 0x03, - 0x18, - 0x03, - 0x0C, - 0x03, - 0x0E, - 0x03, - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x03, - 0x00, - 0x00, - - /* @192 '5' (12 pixels wide) */ - 0xFC, - 0x07, - 0xFC, - 0x07, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x01, - 0xFE, - 0x07, - 0x00, - 0x07, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x06, - 0x07, - 0xFE, - 0x03, - 0xF8, - 0x01, - 0x00, - 0x00, - - /* @224 '6' (12 pixels wide) */ - 0xE0, - 0x03, - 0xF8, - 0x07, - 0x3C, - 0x06, - 0x0C, - 0x00, - 0x0E, - 0x00, - 0x06, - 0x00, - 0xE6, - 0x03, - 0xFE, - 0x07, - 0x0E, - 0x0E, - 0x06, - 0x0C, - 0x06, - 0x0C, - 0x0E, - 0x0E, - 0x1C, - 0x06, - 0xF8, - 0x07, - 0xF0, - 0x03, - 0x00, - 0x00, - - /* @256 '7' (12 pixels wide) */ - 0xFE, - 0x0F, - 0xFE, - 0x0F, - 0x00, - 0x0E, - 0x00, - 0x06, - 0x00, - 0x07, - 0x00, - 0x03, - 0x80, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x00, - 0xE0, - 0x00, - 0x60, - 0x00, - 0x70, - 0x00, - 0x30, - 0x00, - 0x38, - 0x00, - 0x1C, - 0x00, - 0x00, - 0x00, - - /* @288 '8' (12 pixels wide) */ - 0xF0, - 0x01, - 0xFC, - 0x03, - 0x1C, - 0x07, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0C, - 0x06, - 0xBC, - 0x03, - 0xF0, - 0x01, - 0x1C, - 0x07, - 0x0E, - 0x06, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x0E, - 0x06, - 0xFC, - 0x07, - 0xF8, - 0x03, - 0x00, - 0x00, - - /* @320 '9' (12 pixels wide) */ - 0xF8, - 0x01, - 0xFC, - 0x03, - 0x0C, - 0x07, - 0x0E, - 0x0E, - 0x06, - 0x0C, - 0x06, - 0x0C, - 0x0E, - 0x0E, - 0xFC, - 0x0F, - 0xF8, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0E, - 0x00, - 0x06, - 0x8C, - 0x07, - 0xFC, - 0x03, - 0xF8, - 0x00, - 0x00, - 0x00, - - /* @352 'B' (12 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x03, - 0x8C, - 0x07, - 0x0C, - 0x06, - 0x0C, - 0x06, - 0x0C, - 0x07, - 0xFC, - 0x03, - 0xFC, - 0x01, - 0x8C, - 0x07, - 0x0C, - 0x06, - 0x0C, - 0x0E, - 0x0C, - 0x0E, - 0x0C, - 0x07, - 0xFC, - 0x07, - 0xFC, - 0x01, - 0x00, - 0x00, - - /* @384 'C' (12 pixels wide) */ - 0xF0, - 0x01, - 0xF8, - 0x03, - 0xBC, - 0x07, - 0x0C, - 0x06, - 0x0E, - 0x0E, - 0x0E, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x0E, - 0x0E, - 0x0E, - 0x0E, - 0x1C, - 0x07, - 0xF8, - 0x03, - 0xF0, - 0x01, - 0x00, - 0x00, - - /* @416 'D' (12 pixels wide) */ - 0x7E, - 0x00, - 0xFE, - 0x01, - 0xCE, - 0x03, - 0x0E, - 0x07, - 0x0E, - 0x06, - 0x0E, - 0x0E, - 0x0E, - 0x0E, - 0x0E, - 0x0E, - 0x0C, - 0x0E, - 0x0C, - 0x0E, - 0x0C, - 0x06, - 0x0C, - 0x07, - 0x8C, - 0x07, - 0xFC, - 0x03, - 0xFC, - 0x00, - 0x00, - 0x00, - - /* @448 'F' (12 pixels wide) */ - 0xFC, - 0x0F, - 0xFC, - 0x0F, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0xFC, - 0x01, - 0xFC, - 0x01, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x00, - 0x00, - - /* @480 'G' (12 pixels wide) */ - 0xF0, - 0x01, - 0xF8, - 0x03, - 0xBC, - 0x07, - 0x0C, - 0x06, - 0x0E, - 0x0E, - 0x06, - 0x00, - 0x06, - 0x00, - 0x86, - 0x0F, - 0x86, - 0x0F, - 0x06, - 0x0C, - 0x0E, - 0x0E, - 0x0E, - 0x06, - 0x1C, - 0x07, - 0xF8, - 0x03, - 0xF0, - 0x01, - 0x00, - 0x00, - - /* @512 'H' (12 pixels wide) */ - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0xFE, - 0x07, - 0xFE, - 0x07, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x00, - 0x00, - - /* @544 'J' (12 pixels wide) */ - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x00, - 0x06, - 0x04, - 0x06, - 0x07, - 0x07, - 0x8E, - 0x07, - 0xFC, - 0x03, - 0xF8, - 0x01, - 0x00, - 0x00, - - /* @576 'K' (12 pixels wide) */ - 0x0E, - 0x0E, - 0x0E, - 0x07, - 0x0E, - 0x03, - 0x8E, - 0x01, - 0xCE, - 0x01, - 0xEE, - 0x00, - 0x7E, - 0x00, - 0x3E, - 0x00, - 0x7E, - 0x00, - 0xEE, - 0x00, - 0xCE, - 0x01, - 0x8E, - 0x03, - 0x8E, - 0x03, - 0x0E, - 0x07, - 0x0E, - 0x0E, - 0x00, - 0x00, - - /* @608 'M' (12 pixels wide) */ - 0x0E, - 0x0E, - 0x0E, - 0x0F, - 0x1E, - 0x0F, - 0x9E, - 0x0F, - 0xB6, - 0x0F, - 0xB6, - 0x0F, - 0xF6, - 0x0E, - 0xE6, - 0x0E, - 0x66, - 0x0E, - 0x46, - 0x0E, - 0x26, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x00, - 0x00, - - /* @640 'N' (12 pixels wide) */ - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x1E, - 0x06, - 0x3E, - 0x06, - 0x3E, - 0x06, - 0x76, - 0x06, - 0x66, - 0x06, - 0xE6, - 0x06, - 0xC6, - 0x06, - 0xC6, - 0x07, - 0x86, - 0x07, - 0x86, - 0x07, - 0x06, - 0x07, - 0x06, - 0x07, - 0x06, - 0x06, - 0x00, - 0x00, - - /* @672 'P' (12 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x03, - 0x8C, - 0x07, - 0x0C, - 0x0E, - 0x0C, - 0x0E, - 0x0C, - 0x0E, - 0x0C, - 0x06, - 0xFC, - 0x07, - 0xFC, - 0x03, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x0C, - 0x00, - 0x00, - 0x00, - - /* @704 'Q' (12 pixels wide) */ - 0xF0, - 0x00, - 0xF8, - 0x03, - 0x9C, - 0x07, - 0x0E, - 0x07, - 0x0E, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0x06, - 0x0E, - 0xEE, - 0x0E, - 0xCE, - 0x07, - 0x9C, - 0x07, - 0xFC, - 0x07, - 0xF0, - 0x07, - 0x00, - 0x0A, - - /* @736 'R' (12 pixels wide) */ - 0xFC, - 0x00, - 0xFC, - 0x03, - 0x8C, - 0x07, - 0x0C, - 0x06, - 0x0C, - 0x0E, - 0x0C, - 0x0E, - 0x0C, - 0x07, - 0xFC, - 0x07, - 0xFC, - 0x01, - 0x8C, - 0x01, - 0x8C, - 0x03, - 0x0C, - 0x03, - 0x0C, - 0x07, - 0x0C, - 0x06, - 0x0C, - 0x0E, - 0x00, - 0x00, - - /* @768 'T' (12 pixels wide) */ - 0xFF, - 0x0F, - 0xFF, - 0x0F, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0x00, - 0x00, - - /* @800 'V' (12 pixels wide) */ - 0x07, - 0x0C, - 0x06, - 0x0C, - 0x06, - 0x0E, - 0x0E, - 0x06, - 0x0C, - 0x06, - 0x0C, - 0x07, - 0x1C, - 0x03, - 0x1C, - 0x03, - 0x98, - 0x03, - 0x98, - 0x03, - 0xB8, - 0x01, - 0xB0, - 0x01, - 0xF0, - 0x01, - 0xF0, - 0x00, - 0xE0, - 0x00, - 0x00, - 0x00, - - /* @832 'W' (12 pixels wide) */ - 0x67, - 0x0C, - 0xE6, - 0x0C, - 0xE6, - 0x0C, - 0xE6, - 0x0C, - 0xE6, - 0x0C, - 0xF6, - 0x0C, - 0xB6, - 0x0E, - 0xB6, - 0x07, - 0xB6, - 0x07, - 0x96, - 0x07, - 0x9C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x1C, - 0x07, - 0x0C, - 0x07, - 0x00, - 0x00, - - /* @864 'X' (12 pixels wide) */ - 0x0E, - 0x0E, - 0x0E, - 0x06, - 0x1C, - 0x07, - 0x98, - 0x03, - 0xB8, - 0x01, - 0xF0, - 0x01, - 0xF0, - 0x00, - 0xE0, - 0x00, - 0xF0, - 0x00, - 0xF0, - 0x01, - 0xB8, - 0x03, - 0x9C, - 0x03, - 0x0C, - 0x07, - 0x0E, - 0x06, - 0x07, - 0x0E, - 0x00, - 0x00, - - /* @896 'Y' (12 pixels wide) */ - 0x07, - 0x0C, - 0x0E, - 0x0E, - 0x0E, - 0x06, - 0x1C, - 0x07, - 0x18, - 0x03, - 0xB8, - 0x03, - 0xF0, - 0x01, - 0xF0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0xE0, - 0x00, - 0x00, - 0x00, -}; - -/* Character descriptors for Red Hat Mono 16pt */ -/* { [Char width in bits], [Offset into redHatMono_16ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO redHatMono_16ptDescriptors[] = { - {12, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {12, 32}, /* 0 */ - {12, 64}, /* 1 */ - {12, 96}, /* 2 */ - {12, 128}, /* 3 */ - {12, 160}, /* 4 */ - {12, 192}, /* 5 */ - {12, 224}, /* 6 */ - {12, 256}, /* 7 */ - {12, 288}, /* 8 */ - {12, 320}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {12, 352}, /* B */ - {12, 384}, /* C */ - {12, 416}, /* D */ - {0, 0}, /* E */ - {12, 448}, /* F */ - {12, 480}, /* G */ - {12, 512}, /* H */ - {0, 0}, /* I */ - {12, 544}, /* J */ - {12, 576}, /* K */ - {0, 0}, /* L */ - {12, 608}, /* M */ - {12, 640}, /* N */ - {0, 0}, /* O */ - {12, 672}, /* P */ - {12, 704}, /* Q */ - {12, 736}, /* R */ - {0, 0}, /* S */ - {12, 768}, /* T */ - {0, 0}, /* U */ - {12, 800}, /* V */ - {12, 832}, /* W */ - {12, 864}, /* X */ - {12, 896}, /* Y */ -}; - -/* Font information for Red Hat Mono 16pt */ -const FONT_INFO redHatMono_16ptFontInfo = { - "RedHat Mono", - 16, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - redHatMono_16ptDescriptors, /* Character descriptor array */ - redHatMono_16ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/redhat_mono/redhat_mono.h b/lib/fonts/redhat_mono/redhat_mono.h deleted file mode 100644 index ac9214d6b12..00000000000 --- a/lib/fonts/redhat_mono/redhat_mono.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font data for Redhat Mono 16pt */ -extern const FONT_INFO redHatMono_16ptFontInfo; \ No newline at end of file diff --git a/lib/fonts/zector/zector.c b/lib/fonts/zector/zector.c deleted file mode 100644 index c94e455e44c..00000000000 --- a/lib/fonts/zector/zector.c +++ /dev/null @@ -1,1057 +0,0 @@ -#include "zector.h" - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -/* -** Font data for Zector 18pt -*/ - -/* Character bitmaps for Zector 18pt */ -const uint8_t zector_18ptBitmaps[] = { - /* @0 '-' (9 pixels wide) */ - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0xFF, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - - /* @32 '0' (9 pixels wide) */ - 0x3C, - 0x00, - 0xC2, - 0x00, - 0x83, - 0x00, - 0x85, - 0x00, - 0x85, - 0x00, - 0x89, - 0x00, - 0x89, - 0x00, - 0x91, - 0x00, - 0x91, - 0x00, - 0xA1, - 0x00, - 0xA1, - 0x00, - 0xC1, - 0x00, - 0xC1, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @64 '1' (9 pixels wide) */ - 0x10, - 0x00, - 0x18, - 0x00, - 0x18, - 0x00, - 0x14, - 0x00, - 0x14, - 0x00, - 0x12, - 0x00, - 0x12, - 0x00, - 0x11, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0xFF, - 0x00, - - /* @96 '2' (9 pixels wide) */ - 0x3C, - 0x00, - 0x42, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x40, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x10, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x04, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0xFF, - 0x00, - - /* @128 '3' (9 pixels wide) */ - 0xFF, - 0x01, - 0x80, - 0x00, - 0x80, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x10, - 0x00, - 0x60, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x00, - 0x01, - 0x01, - 0x01, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @160 '4' (9 pixels wide) */ - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0xFF, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - - /* @192 '5' (9 pixels wide) */ - 0xFF, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x3F, - 0x00, - 0x40, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0xC2, - 0x00, - 0x3C, - 0x00, - - /* @224 '6' (9 pixels wide) */ - 0x3C, - 0x00, - 0x42, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x3D, - 0x00, - 0x43, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0xC2, - 0x00, - 0x3C, - 0x00, - - /* @256 '7' (9 pixels wide) */ - 0xFF, - 0x01, - 0x80, - 0x00, - 0x80, - 0x00, - 0x40, - 0x00, - 0x40, - 0x00, - 0x20, - 0x00, - 0x20, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x08, - 0x00, - 0x08, - 0x00, - 0x04, - 0x00, - 0x04, - 0x00, - 0x02, - 0x00, - 0x02, - 0x00, - 0x01, - 0x00, - - /* @288 '8' (9 pixels wide) */ - 0x3C, - 0x00, - 0xC2, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - 0x42, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @320 '9' (9 pixels wide) */ - 0x3C, - 0x00, - 0x42, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0xC2, - 0x00, - 0xBC, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @352 'B' (9 pixels wide) */ - 0x3F, - 0x00, - 0xC1, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x41, - 0x00, - 0x3F, - 0x00, - 0x41, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x41, - 0x00, - 0x3F, - 0x00, - - /* @384 'C' (9 pixels wide) */ - 0x3C, - 0x00, - 0x42, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @416 'D' (9 pixels wide) */ - 0x3F, - 0x00, - 0x41, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x41, - 0x00, - 0x3F, - 0x00, - - /* @448 'F' (9 pixels wide) */ - 0xFF, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0xFF, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - - /* @480 'G' (9 pixels wide) */ - 0x3C, - 0x00, - 0xC2, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0xF1, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @512 'H' (9 pixels wide) */ - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0xFF, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - - /* @544 'J' (9 pixels wide) */ - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x80, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x42, - 0x00, - 0x3C, - 0x00, - - /* @576 'K' (9 pixels wide) */ - 0x81, - 0x00, - 0xC1, - 0x00, - 0x61, - 0x00, - 0x21, - 0x00, - 0x11, - 0x00, - 0x09, - 0x00, - 0x05, - 0x00, - 0x03, - 0x00, - 0x01, - 0x00, - 0x03, - 0x00, - 0x05, - 0x00, - 0x09, - 0x00, - 0x11, - 0x00, - 0x21, - 0x00, - 0x41, - 0x00, - 0x81, - 0x00, - - /* @608 'M' (9 pixels wide) */ - 0x81, - 0x00, - 0x81, - 0x00, - 0x83, - 0x00, - 0xC3, - 0x00, - 0xC5, - 0x00, - 0xA5, - 0x00, - 0xA9, - 0x00, - 0x91, - 0x00, - 0x91, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - - /* @640 'N' (9 pixels wide) */ - 0x81, - 0x00, - 0x81, - 0x00, - 0x83, - 0x00, - 0x83, - 0x00, - 0x85, - 0x00, - 0x85, - 0x00, - 0x89, - 0x00, - 0x89, - 0x00, - 0x91, - 0x00, - 0xA1, - 0x00, - 0xA1, - 0x00, - 0xC1, - 0x00, - 0xC1, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - - /* @672 'P' (9 pixels wide) */ - 0x3F, - 0x00, - 0x41, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x41, - 0x00, - 0x3F, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - 0x01, - 0x00, - - /* @704 'Q' (9 pixels wide) */ - 0x3C, - 0x00, - 0x42, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x91, - 0x00, - 0xA1, - 0x00, - 0xC2, - 0x00, - 0xBC, - 0x00, - - /* @736 'R' (9 pixels wide) */ - 0x3F, - 0x00, - 0x41, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x41, - 0x00, - 0x3F, - 0x00, - 0x03, - 0x00, - 0x05, - 0x00, - 0x09, - 0x00, - 0x11, - 0x00, - 0x21, - 0x00, - 0x41, - 0x00, - 0x81, - 0x00, - - /* @768 'T' (9 pixels wide) */ - 0xFF, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - - /* @800 'V' (9 pixels wide) */ - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x82, - 0x00, - 0x42, - 0x00, - 0x44, - 0x00, - 0x24, - 0x00, - 0x28, - 0x00, - 0x18, - 0x00, - 0x10, - 0x00, - - /* @832 'W' (9 pixels wide) */ - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - 0x91, - 0x00, - 0x91, - 0x00, - 0x99, - 0x00, - 0xA9, - 0x00, - 0xA5, - 0x00, - 0xC5, - 0x00, - 0x83, - 0x00, - 0x81, - 0x00, - 0x81, - 0x00, - - /* @864 'X' (9 pixels wide) */ - 0x81, - 0x00, - 0x82, - 0x00, - 0x82, - 0x00, - 0x44, - 0x00, - 0x44, - 0x00, - 0x28, - 0x00, - 0x28, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x28, - 0x00, - 0x28, - 0x00, - 0x44, - 0x00, - 0x44, - 0x00, - 0x82, - 0x00, - 0x82, - 0x00, - 0x81, - 0x00, - - /* @896 'Y' (9 pixels wide) */ - 0x81, - 0x00, - 0x82, - 0x00, - 0x82, - 0x00, - 0x44, - 0x00, - 0x44, - 0x00, - 0x28, - 0x00, - 0x28, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, - 0x10, - 0x00, -}; - -/* Character descriptors for Zector 18pt */ -/* { [Char width in bits], [Offset into zector_18ptCharBitmaps in bytes] } */ -const FONT_CHAR_INFO zector_18ptDescriptors[] = { - {9, 0}, /* - */ - {0, 0}, /* . */ - {0, 0}, /* / */ - {9, 32}, /* 0 */ - {9, 64}, /* 1 */ - {9, 96}, /* 2 */ - {9, 128}, /* 3 */ - {9, 160}, /* 4 */ - {9, 192}, /* 5 */ - {9, 224}, /* 6 */ - {9, 256}, /* 7 */ - {9, 288}, /* 8 */ - {9, 320}, /* 9 */ - {0, 0}, /* : */ - {0, 0}, /* ; */ - {0, 0}, /* < */ - {0, 0}, /* = */ - {0, 0}, /* > */ - {0, 0}, /* ? */ - {0, 0}, /* @ */ - {0, 0}, /* A */ - {9, 352}, /* B */ - {9, 384}, /* C */ - {9, 416}, /* D */ - {0, 0}, /* E */ - {9, 448}, /* F */ - {9, 480}, /* G */ - {9, 512}, /* H */ - {0, 0}, /* I */ - {9, 544}, /* J */ - {9, 576}, /* K */ - {0, 0}, /* L */ - {9, 608}, /* M */ - {9, 640}, /* N */ - {0, 0}, /* O */ - {9, 672}, /* P */ - {9, 704}, /* Q */ - {9, 736}, /* R */ - {0, 0}, /* S */ - {9, 768}, /* T */ - {0, 0}, /* U */ - {9, 800}, /* V */ - {9, 832}, /* W */ - {9, 864}, /* X */ - {9, 896}, /* Y */ -}; - -/* Font information for Zector 18pt */ -const FONT_INFO zector_18ptFontInfo = { - "Zector", - 16, /* Character height */ - '-', /* Start character */ - 'Y', /* End character */ - 2, /* Width, in pixels, of space character */ - zector_18ptDescriptors, /* Character descriptor array */ - zector_18ptBitmaps, /* Character bitmap array */ -}; diff --git a/lib/fonts/zector/zector.h b/lib/fonts/zector/zector.h deleted file mode 100644 index 2a5cf590796..00000000000 --- a/lib/fonts/zector/zector.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -/* GENERATED BY https://github.com/pavius/the-dot-factory */ - -#include "../font_info.h" - -/* Font information for Zector 18pt */ -extern const FONT_INFO zector_18ptFontInfo; \ No newline at end of file diff --git a/lib/polyfills/memset_s.h b/lib/polyfills/memset_s.h index 54628860d08..11740a46b66 100644 --- a/lib/polyfills/memset_s.h +++ b/lib/polyfills/memset_s.h @@ -3,6 +3,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef _RSIZE_T_DECLARED typedef uint64_t rsize_t; #define _RSIZE_T_DECLARED @@ -20,4 +24,8 @@ typedef int16_t errno_t; //-V677 * @param n number of bytes to fill * @return \c 0 on success; non-zero otherwise */ -errno_t memset_s(void* s, rsize_t smax, int c, rsize_t n); \ No newline at end of file +errno_t memset_s(void* s, rsize_t smax, int c, rsize_t n); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/services/config/config.h b/services/config/config.h index 38bc06ba2d7..463d91682a0 100644 --- a/services/config/config.h +++ b/services/config/config.h @@ -6,6 +6,10 @@ #include "constants.h" #include "token_info_iterator.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint8_t TotpConfigFileOpenResult; typedef uint8_t TotpConfigFileUpdateResult; @@ -101,4 +105,8 @@ bool totp_config_file_ensure_latest_encryption( * @param plugin_state application state * @return token info iterator context */ -TokenInfoIteratorContext* totp_config_get_token_iterator_context(const PluginState* plugin_state); \ No newline at end of file +TokenInfoIteratorContext* totp_config_get_token_iterator_context(const PluginState* plugin_state); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/services/config/token_info_iterator.h b/services/config/token_info_iterator.h index ce4d8c72b2e..bcd35803abc 100644 --- a/services/config/token_info_iterator.h +++ b/services/config/token_info_iterator.h @@ -4,6 +4,10 @@ #include #include "constants.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef int TotpIteratorUpdateTokenResult; typedef TotpIteratorUpdateTokenResult ( @@ -121,3 +125,7 @@ size_t totp_token_info_iterator_get_total_count(const TokenInfoIteratorContext* void totp_token_info_iterator_attach_to_config_file( TokenInfoIteratorContext* context, FlipperFormat* config_file); + +#ifdef __cplusplus +} +#endif diff --git a/services/crypto/crypto_facade.h b/services/crypto/crypto_facade.h index bbcbf7c0074..2ff5ce789a4 100644 --- a/services/crypto/crypto_facade.h +++ b/services/crypto/crypto_facade.h @@ -6,6 +6,10 @@ #include "../../types/crypto_settings.h" #include "common_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Checks whether key slot can be used for encryption purposes * @param key_slot key slot index @@ -57,3 +61,7 @@ CryptoSeedIVResult * @return \c true if cryptographic information is valid; \c false otherwise */ bool totp_crypto_verify_key(const CryptoSettings* crypto_settings); + +#ifdef __cplusplus +} +#endif diff --git a/services/fonts/font_info.c b/services/fonts/font_info.c new file mode 100644 index 00000000000..fd71e903038 --- /dev/null +++ b/services/fonts/font_info.c @@ -0,0 +1,27 @@ +#include "font_info.h" +#include + +FontInfo* totp_font_info_alloc() { + FontInfo* font_info = malloc(sizeof(FontInfo)); + furi_check(font_info != NULL); + font_info->data = NULL; + font_info->char_info = NULL; + return font_info; +} + +void totp_font_info_free(FontInfo* font_info) { + if(font_info == NULL) return; + if(font_info->char_info != NULL) { + free(font_info->char_info); + } + + if(font_info->data != NULL) { + free(font_info->data); + } + + if(font_info->name != NULL) { + free(font_info->name); + } + + free(font_info); +} \ No newline at end of file diff --git a/services/fonts/font_info.h b/services/fonts/font_info.h new file mode 100644 index 00000000000..9609ceb098f --- /dev/null +++ b/services/fonts/font_info.h @@ -0,0 +1,66 @@ +#pragma once + +#include + +struct FontCharInfo_s { + /** + * @brief Width of the character + */ + uint8_t width; + + /** + * @brief Offset of the character's bitmap, in bytes, into the the data array + */ + uint16_t offset; +} __attribute__((packed)); + +typedef struct FontCharInfo_s FontCharInfo; + +typedef struct { + /** + * @brief Font name + */ + char* name; + + /** + * @brief Font characters height + */ + uint8_t height; + + /** + * @brief The first character available in the font + */ + uint8_t start_char; + + /** + * @brief The last character available in the font + */ + uint8_t end_char; + + /** + * @brief Space character width + */ + uint8_t space_width; + + /** + * @brief Pointer to array of char information + */ + FontCharInfo* char_info; + + /** + * @brief Pointer to generated array of character visual representation + */ + uint8_t* data; +} FontInfo; + +/** + * @brief Allocates a new instance of \c FontInfo + * @return pointer to allocated instance + */ +FontInfo* totp_font_info_alloc(); + +/** + * @brief Disposes all the resources allocated by the given \c FontInfo instance + * @param font_info instance to dispose + */ +void totp_font_info_free(FontInfo* font_info); \ No newline at end of file diff --git a/services/fonts/font_provider.c b/services/fonts/font_provider.c new file mode 100644 index 00000000000..fe2cfcdd83f --- /dev/null +++ b/services/fonts/font_provider.c @@ -0,0 +1,114 @@ +#include "font_provider.h" + +#include +#include +#include +#include +#include + +#define FONT_BASE_PATH EXT_PATH("apps_assets/totp/fonts") +#define FONT_FILE_EXTENSION ".font" + +size_t totp_font_provider_get_fonts_count() { + size_t result = 0; + Storage* storage = furi_record_open(RECORD_STORAGE); + + FuriString* path_src = furi_string_alloc(); + + DirWalk* dir_walk = dir_walk_alloc(storage); + dir_walk_set_recursive(dir_walk, false); + + if(dir_walk_open(dir_walk, FONT_BASE_PATH)) { + char extension[sizeof(FONT_FILE_EXTENSION)]; + while(dir_walk_read(dir_walk, path_src, NULL) == DirWalkOK) { + path_extract_extension(path_src, &extension[0], sizeof(extension)); + if(strncmp(&extension[0], FONT_FILE_EXTENSION, sizeof(FONT_FILE_EXTENSION)) == 0) { + result++; + } + } + } + + furi_string_free(path_src); + dir_walk_free(dir_walk); + + furi_record_close(RECORD_STORAGE); + + return result; +} + +bool totp_font_provider_get_font(size_t font_index, FontInfo* font_info) { + Storage* storage = furi_record_open(RECORD_STORAGE); + Stream* stream = file_stream_alloc(storage); + bool loaded = false; + FuriString* font_path = furi_string_alloc_printf( + "%s/%02" PRIu16 "%s", FONT_BASE_PATH, font_index, FONT_FILE_EXTENSION); + + do { + if(!file_stream_open( + stream, furi_string_get_cstr(font_path), FSAM_READ, FSOM_OPEN_EXISTING) || + !stream_rewind(stream)) { + break; + } + uint8_t font_name_length; + if(!stream_read(stream, &font_name_length, 1)) { + break; + } + + if(font_info->name != NULL) { + free(font_info->name); + } + font_info->name = malloc(font_name_length + 1); + furi_check(font_info->name); + if(!stream_read(stream, (uint8_t*)font_info->name, font_name_length)) { + break; + } + + font_info->name[font_name_length] = '\0'; + if(!stream_read(stream, &font_info->height, 1) || + !stream_read(stream, &font_info->start_char, 1) || + !stream_read(stream, &font_info->end_char, 1) || + !stream_read(stream, &font_info->space_width, 1)) { + break; + } + + uint16_t bitmap_data_length; + if(!stream_read(stream, (uint8_t*)&bitmap_data_length, 2)) { + break; + } + + if(font_info->data != NULL) { + free(font_info->data); + } + + font_info->data = malloc(bitmap_data_length); + + furi_check(font_info->data); + + if(!stream_read(stream, font_info->data, bitmap_data_length)) { + break; + } + uint8_t descriptors_length; + if(!stream_read(stream, &descriptors_length, 1)) { + break; + } + + if(font_info->char_info != NULL) { + free(font_info->char_info); + } + uint16_t char_info_array_size = descriptors_length * sizeof(FontCharInfo); + font_info->char_info = malloc(char_info_array_size); + furi_check(font_info->char_info); + if(!stream_read(stream, (uint8_t*)font_info->char_info, char_info_array_size)) { + break; + } + + loaded = true; + } while(false); + + furi_string_free(font_path); + file_stream_close(stream); + stream_free(stream); + + furi_record_close(RECORD_STORAGE); + return loaded; +} \ No newline at end of file diff --git a/services/fonts/font_provider.h b/services/fonts/font_provider.h new file mode 100644 index 00000000000..c8007e8d2e0 --- /dev/null +++ b/services/fonts/font_provider.h @@ -0,0 +1,19 @@ +#pragma once + +#include "font_info.h" +#include +#include + +/** + * @brief Gets total fonts available + * @return total fonts available + */ +size_t totp_font_provider_get_fonts_count(); + +/** + * @brief Load font with given index + * @param font_index font index + * @param[out] font_info font info to populate + * @return \c true if font successfully load; \c false otherwise + */ +bool totp_font_provider_get_font(size_t font_index, FontInfo* font_info); \ No newline at end of file diff --git a/totp_app.c b/totp_app.c index adfd4a9a5ac..f49cb6b717d 100644 --- a/totp_app.c +++ b/totp_app.c @@ -230,14 +230,14 @@ int32_t totp_app() { return 254; } - TotpCliContext* cli_context = totp_cli_register_command_handler(plugin_state); - if(!totp_activate_initial_scene(plugin_state)) { FURI_LOG_E(LOGGING_TAG, "An error ocurred during activating initial scene\r\n"); totp_plugin_state_free(plugin_state); return 253; } + TotpCliContext* cli_context = totp_cli_register_command_handler(plugin_state); + // Affecting dolphin level dolphin_deed(DolphinDeedPluginStart); diff --git a/types/token_info.h b/types/token_info.h index 969445dff5b..84eaea28b4d 100644 --- a/types/token_info.h +++ b/types/token_info.h @@ -16,6 +16,10 @@ #define TOKEN_AUTOMATION_FEATURE_TAB_AT_THE_END_NAME "tab" #define TOKEN_AUTOMATION_FEATURE_TYPE_SLOWER_NAME "slower" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint8_t TokenHashAlgo; typedef uint8_t TokenDigitsCount; typedef uint8_t TokenDuration; @@ -270,3 +274,7 @@ TokenInfo* token_info_clone(const TokenInfo* src); * @param token_info instance to set defaults to */ void token_info_set_defaults(TokenInfo* token_info); + +#ifdef __cplusplus +} +#endif diff --git a/ui/canvas_extensions.c b/ui/canvas_extensions.c index d3f044b7753..55658ebb26f 100644 --- a/ui/canvas_extensions.c +++ b/ui/canvas_extensions.c @@ -6,23 +6,23 @@ void canvas_draw_str_ex( uint8_t y, const char* text, size_t text_length, - const FONT_INFO* const font) { + const FontInfo* const font) { const char* p_ch = text; char ch; size_t i = 0; uint8_t offset_x = x; - uint8_t char_width = font->charInfo[0].width; - uint8_t offset_x_inc = char_width + font->spacePixels; + uint8_t char_width = font->char_info[0].width; + uint8_t offset_x_inc = char_width + font->space_width; while(i < text_length && (ch = *p_ch) != 0) { - if(ch >= font->startChar && ch <= font->endChar) { - uint8_t char_index = ch - font->startChar; + if(ch >= font->start_char && ch <= font->end_char) { + uint8_t char_index = ch - font->start_char; canvas_draw_xbm( canvas, offset_x, y, char_width, font->height, - &font->data[font->charInfo[char_index].offset]); + &font->data[font->char_info[char_index].offset]); } offset_x += offset_x_inc; diff --git a/ui/canvas_extensions.h b/ui/canvas_extensions.h index 2e053b488d1..4067dc1b75d 100644 --- a/ui/canvas_extensions.h +++ b/ui/canvas_extensions.h @@ -2,7 +2,7 @@ #include #include -#include +#include "../services/fonts/font_info.h" /** * @brief Draw string using given font @@ -19,4 +19,4 @@ void canvas_draw_str_ex( uint8_t y, const char* text, size_t text_length, - const FONT_INFO* const font); \ No newline at end of file + const FontInfo* const font); \ No newline at end of file diff --git a/ui/scene_director.h b/ui/scene_director.h index 1f09f9ea988..ea27cc0678e 100644 --- a/ui/scene_director.h +++ b/ui/scene_director.h @@ -5,6 +5,10 @@ #include "../types/plugin_event.h" #include "totp_scenes_enum.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Activates scene * @param plugin_state application state @@ -38,4 +42,8 @@ bool totp_scene_director_handle_event(PluginEvent* const event, PluginState* con * @brief Forces screen to be redraw\updated * @param plugin_state application state */ -void totp_scene_director_force_redraw(PluginState* const plugin_state); \ No newline at end of file +void totp_scene_director_force_redraw(PluginState* const plugin_state); + +#ifdef __cplusplus +} +#endif diff --git a/ui/scenes/app_settings/totp_app_settings.c b/ui/scenes/app_settings/totp_app_settings.c index b0580a05f0e..01f5a4a0b65 100644 --- a/ui/scenes/app_settings/totp_app_settings.c +++ b/ui/scenes/app_settings/totp_app_settings.c @@ -1,7 +1,7 @@ #include "totp_app_settings.h" #include #include -#include +#include "../../../services/fonts/font_provider.h" #include "../../canvas_extensions.h" #include "../../ui_controls.h" #include "../../common_dialogs.h" @@ -56,7 +56,9 @@ typedef struct { uint16_t y_offset; AutomationKeyboardLayout automation_kb_layout; Control selected_control; - uint8_t active_font; + uint8_t active_font_index; + FontInfo* active_font; + uint8_t total_fonts_count; } SceneState; void totp_scene_app_settings_activate(PluginState* plugin_state) { @@ -75,7 +77,13 @@ void totp_scene_app_settings_activate(PluginState* plugin_state) { scene_state->automation_kb_layout = MIN(plugin_state->automation_kb_layout, BAD_KB_LAYOUT_LIST_MAX_INDEX); - scene_state->active_font = plugin_state->active_font_index; + scene_state->total_fonts_count = totp_font_provider_get_fonts_count(); + scene_state->active_font_index = plugin_state->active_font_index; + scene_state->active_font = totp_font_info_alloc(); + if(!totp_font_provider_get_font(scene_state->active_font_index, scene_state->active_font)) { + scene_state->active_font_index = 0; + totp_font_provider_get_font(scene_state->active_font_index, scene_state->active_font); + } } static void two_digit_to_str(int8_t num, char* str) { @@ -129,7 +137,7 @@ void totp_scene_app_settings_render(Canvas* const canvas, const PluginState* plu canvas, 0, 64 - scene_state->y_offset, AlignLeft, AlignTop, "Font"); canvas_set_font(canvas, FontSecondary); - const FONT_INFO* const font = available_fonts[scene_state->active_font]; + const FontInfo* const font = scene_state->active_font; ui_control_select_render( canvas, 0, @@ -140,7 +148,7 @@ void totp_scene_app_settings_render(Canvas* const canvas, const PluginState* plu uint8_t font_x_offset = SCREEN_WIDTH_CENTER - - (((font->charInfo[0].width + font->spacePixels) * FONT_TEST_STR_LENGTH) >> 1); + (((font->char_info[0].width + font->space_width) * FONT_TEST_STR_LENGTH) >> 1); uint8_t font_y_offset = 108 - scene_state->y_offset - (font->height >> 1); canvas_draw_str_ex( canvas, font_x_offset, font_y_offset, FONT_TEST_STR, FONT_TEST_STR_LENGTH, font); @@ -264,11 +272,13 @@ bool totp_scene_app_settings_handle_event( &scene_state->tz_offset_minutes, 15, 0, 45, RollOverflowBehaviorRoll); } else if(scene_state->selected_control == FontSelect) { totp_roll_value_uint8_t( - &scene_state->active_font, + &scene_state->active_font_index, 1, 0, - AVAILABLE_FONTS_COUNT - 1, + scene_state->total_fonts_count - 1, RollOverflowBehaviorRoll); + totp_font_provider_get_font( + scene_state->active_font_index, scene_state->active_font); } else if(scene_state->selected_control == SoundSwitch) { scene_state->notification_sound = !scene_state->notification_sound; } else if(scene_state->selected_control == VibroSwitch) { @@ -298,11 +308,13 @@ bool totp_scene_app_settings_handle_event( &scene_state->tz_offset_minutes, -15, 0, 45, RollOverflowBehaviorRoll); } else if(scene_state->selected_control == FontSelect) { totp_roll_value_uint8_t( - &scene_state->active_font, + &scene_state->active_font_index, -1, 0, - AVAILABLE_FONTS_COUNT - 1, + scene_state->total_fonts_count - 1, RollOverflowBehaviorRoll); + totp_font_provider_get_font( + scene_state->active_font_index, scene_state->active_font); } else if(scene_state->selected_control == SoundSwitch) { scene_state->notification_sound = !scene_state->notification_sound; } else if(scene_state->selected_control == VibroSwitch) { @@ -343,7 +355,7 @@ bool totp_scene_app_settings_handle_event( (scene_state->notification_vibro ? NotificationMethodVibro : NotificationMethodNone); plugin_state->automation_method = scene_state->automation_method; - plugin_state->active_font_index = scene_state->active_font; + plugin_state->active_font_index = scene_state->active_font_index; plugin_state->automation_kb_layout = scene_state->automation_kb_layout; if(!totp_config_file_update_user_settings(plugin_state)) { @@ -368,6 +380,9 @@ bool totp_scene_app_settings_handle_event( void totp_scene_app_settings_deactivate(PluginState* plugin_state) { if(plugin_state->current_scene_state == NULL) return; - free(plugin_state->current_scene_state); + SceneState* scene_state = plugin_state->current_scene_state; + totp_font_info_free(scene_state->active_font); + + free(scene_state); plugin_state->current_scene_state = NULL; } diff --git a/ui/scenes/generate_token/totp_scene_generate_token.c b/ui/scenes/generate_token/totp_scene_generate_token.c index c0b8414eaea..e4c1da938f7 100644 --- a/ui/scenes/generate_token/totp_scene_generate_token.c +++ b/ui/scenes/generate_token/totp_scene_generate_token.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include "../../../services/fonts/font_provider.h" #include "../../canvas_extensions.h" #include "../../../types/token_info.h" #include "../../../types/common.h" @@ -37,7 +37,7 @@ typedef struct { FuriMutex* last_code_update_sync; TotpGenerateCodeWorkerContext* generate_code_worker_context; UiPrecalculatedDimensions ui_precalculated_dimensions; - const FONT_INFO* active_font; + FontInfo* active_font; NotificationApp* notification_app; } SceneState; @@ -140,15 +140,14 @@ static void on_new_token_code_generated(bool time_left, void* context) { SceneState* scene_state = plugin_state->current_scene_state; const TokenInfo* current_token = totp_token_info_iterator_get_current_token(iterator_context); - const FONT_INFO* const font = scene_state->active_font; - uint8_t char_width = font->charInfo[0].width; + uint8_t char_width = scene_state->active_font->char_info[0].width; scene_state->ui_precalculated_dimensions.code_total_length = - current_token->digits * (char_width + font->spacePixels); + current_token->digits * (char_width + scene_state->active_font->space_width); scene_state->ui_precalculated_dimensions.code_offset_x = (SCREEN_WIDTH - scene_state->ui_precalculated_dimensions.code_total_length) >> 1; scene_state->ui_precalculated_dimensions.code_offset_y = - SCREEN_HEIGHT_CENTER - (font->height >> 1); + SCREEN_HEIGHT_CENTER - (scene_state->active_font->height >> 1); if(time_left) { notification_message( @@ -188,7 +187,11 @@ void totp_scene_generate_token_activate(PluginState* plugin_state) { plugin_state->automation_kb_layout); } - scene_state->active_font = available_fonts[plugin_state->active_font_index]; + scene_state->active_font = totp_font_info_alloc(); + + if(!totp_font_provider_get_font(plugin_state->active_font_index, scene_state->active_font)) { + totp_font_provider_get_font(0, scene_state->active_font); + } scene_state->notification_app = furi_record_open(RECORD_NOTIFICATION); scene_state->notification_sequence_automation[0] = NULL; scene_state->notification_sequence_new_token[0] = NULL; @@ -427,6 +430,8 @@ void totp_scene_generate_token_deactivate(PluginState* plugin_state) { furi_mutex_free(scene_state->last_code_update_sync); + totp_font_info_free(scene_state->active_font); + free(scene_state); plugin_state->current_scene_state = NULL; } diff --git a/version.h b/version.h index d511907e525..1325e062ef1 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #pragma once -#define TOTP_APP_VERSION_MAJOR (4) -#define TOTP_APP_VERSION_MINOR (1) -#define TOTP_APP_VERSION_PATCH (1) \ No newline at end of file +#define TOTP_APP_VERSION_MAJOR (5) +#define TOTP_APP_VERSION_MINOR (0) +#define TOTP_APP_VERSION_PATCH (0) \ No newline at end of file diff --git a/workers/bt_type_code/bt_type_code.h b/workers/bt_type_code/bt_type_code.h index 1b9db9bee97..74043a5d481 100644 --- a/workers/bt_type_code/bt_type_code.h +++ b/workers/bt_type_code/bt_type_code.h @@ -5,6 +5,10 @@ #include #include "../../types/automation_kb_layout.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef uint8_t TotpBtTypeCodeWorkerEvent; typedef struct TotpBtTypeCodeWorkerContext TotpBtTypeCodeWorkerContext; @@ -80,3 +84,7 @@ void totp_bt_type_code_worker_notify( * @return \c true if Bluetooth is advertising now; \c false otherwise */ bool totp_bt_type_code_worker_is_advertising(const TotpBtTypeCodeWorkerContext* context); + +#ifdef __cplusplus +} +#endif