From 263c94d1673f151a6dfb04c1e5a1d528469a3c44 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 3 Jun 2023 15:03:07 +0300 Subject: [PATCH 01/11] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4a49fb2..d93dd25ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ### New changes * If you have copied any apps manually into `apps` folder - remove `apps` folder or that specific apps you copied on your microSD before installing this release to avoid issues due to OFW API version update! If you using regular builds or extra pack builds (e) without your manually added apps, all included apps will be installed automatically, no extra actions needed! ----- +* Only in release 052 -> **Multiple Extra pack apps was fixed!** -> TAMA P1, Flizzer Tracker, Video Player, Music Tracker +### Previous changes * SubGHz Remote: Fixed BinRAW support, + many other fixes (by @gid9798 | PR #492) * SubGHz: Fix KL: Stilmatic support + add manually support * SubGHz: Keeloq mfname refactoring (by @gid9798 | PR #479) From 2008247e658b8f4a60fd29c6593d0fa23e416d81 Mon Sep 17 00:00:00 2001 From: Tiernan Messmer Date: Sat, 3 Jun 2023 22:31:24 +1000 Subject: [PATCH 02/11] Remove delay from emulation loop. This improves compatibility when the reader is Android. --- lib/nfc/nfc_worker.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/nfc/nfc_worker.c b/lib/nfc/nfc_worker.c index f2d07e4c2..2819ea7ad 100644 --- a/lib/nfc/nfc_worker.c +++ b/lib/nfc/nfc_worker.c @@ -179,7 +179,6 @@ void nfc_worker_nfcv_emulate(NfcWorker* nfc_worker) { } } } - furi_delay_ms(10); } nfcv_emu_deinit(nfcv_data); @@ -207,7 +206,6 @@ void nfc_worker_nfcv_sniff(NfcWorker* nfc_worker) { nfc_worker->callback(NfcWorkerEventNfcVCommandExecuted, nfc_worker->context); } } - furi_delay_ms(10); } nfcv_emu_deinit(nfcv_data); From a0e39ddb67c0d2376f8a726ca1d5acbc6740b202 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 3 Jun 2023 20:36:20 +0300 Subject: [PATCH 03/11] more checks just in case?? --- lib/digital_signal/digital_signal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/digital_signal/digital_signal.c b/lib/digital_signal/digital_signal.c index 6ccfcf280..9dd13886d 100644 --- a/lib/digital_signal/digital_signal.c +++ b/lib/digital_signal/digital_signal.c @@ -243,11 +243,15 @@ static void digital_signal_stop_timer() { LL_TIM_DisableUpdateEvent(TIM2); LL_TIM_DisableDMAReq_UPDATE(TIM2); - furi_hal_bus_disable(FuriHalBusTIM2); + if(furi_hal_bus_is_enabled(FuriHalBusTIM2)) { + furi_hal_bus_disable(FuriHalBusTIM2); + } } static void digital_signal_setup_timer() { - furi_hal_bus_enable(FuriHalBusTIM2); + if(!furi_hal_bus_is_enabled(FuriHalBusTIM2)) { + furi_hal_bus_enable(FuriHalBusTIM2); + } LL_TIM_SetCounterMode(TIM2, LL_TIM_COUNTERMODE_UP); LL_TIM_SetClockDivision(TIM2, LL_TIM_CLOCKDIVISION_DIV1); From 5a2fbf4af3e65369a6beab12af86971e9e3dc49e Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 3 Jun 2023 22:36:19 +0300 Subject: [PATCH 04/11] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d93dd25ba..d92b032a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * If you have copied any apps manually into `apps` folder - remove `apps` folder or that specific apps you copied on your microSD before installing this release to avoid issues due to OFW API version update! If you using regular builds or extra pack builds (e) without your manually added apps, all included apps will be installed automatically, no extra actions needed! ----- * Only in release 052 -> **Multiple Extra pack apps was fixed!** -> TAMA P1, Flizzer Tracker, Video Player, Music Tracker +* NFC V: Remove delay from emulation loop. This improves compatibility when the reader is Android. ### Previous changes * SubGHz Remote: Fixed BinRAW support, + many other fixes (by @gid9798 | PR #492) * SubGHz: Fix KL: Stilmatic support + add manually support From 75ee4efa31b3cb38b55b031be1da0c42ff557890 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 3 Jun 2023 23:46:55 +0300 Subject: [PATCH 05/11] Fix ibtn fuzzer file loading (temp) --- CHANGELOG.md | 1 + .../scene/ibtnfuzzer_scene_load_file.c | 193 ++++++++++++++---- 2 files changed, 154 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d92b032a4..f81527b72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ----- * Only in release 052 -> **Multiple Extra pack apps was fixed!** -> TAMA P1, Flizzer Tracker, Video Player, Music Tracker * NFC V: Remove delay from emulation loop. This improves compatibility when the reader is Android. +* Plugins: iButton Fuzzer -> Fix v2 key files load (all new saved files) ### Previous changes * SubGHz Remote: Fixed BinRAW support, + many other fixes (by @gid9798 | PR #492) * SubGHz: Fix KL: Stilmatic support + add manually support diff --git a/applications/external/ibtn_fuzzer/scene/ibtnfuzzer_scene_load_file.c b/applications/external/ibtn_fuzzer/scene/ibtnfuzzer_scene_load_file.c index 47d5122ab..92f79a424 100644 --- a/applications/external/ibtn_fuzzer/scene/ibtnfuzzer_scene_load_file.c +++ b/applications/external/ibtn_fuzzer/scene/ibtnfuzzer_scene_load_file.c @@ -10,6 +10,7 @@ bool ibtnfuzzer_load(iBtnFuzzerState* context, const char* file_path) { FlipperFormat* fff_data_file = flipper_format_file_alloc(storage); FuriString* temp_str; temp_str = furi_string_alloc(); + bool key_v2 = false; do { if(!flipper_format_file_open_existing(fff_data_file, file_path)) { FURI_LOG_E(TAG, "Error open file %s", file_path); @@ -30,10 +31,43 @@ bool ibtnfuzzer_load(iBtnFuzzerState* context, const char* file_path) { // Key type if(!flipper_format_read_string(fff_data_file, "Key type", temp_str)) { - FURI_LOG_E(TAG, "Missing or incorrect Key type"); - furi_string_reset(context->notification_msg); - furi_string_set(context->notification_msg, "Missing or incorrect Key type"); - break; + FURI_LOG_E(TAG, "Missing or incorrect Key type, checking for typ2.."); + + if(!flipper_format_rewind(fff_data_file)) { + FURI_LOG_E(TAG, "Failed to rewind file"); + break; + } + if(!flipper_format_read_string(fff_data_file, "Protocol", temp_str)) { + furi_string_reset(context->notification_msg); + furi_string_set( + context->notification_msg, "Missing or incorrect Protocol or Key type"); + break; + } + FURI_LOG_I(TAG, "Key type V2: %s", furi_string_get_cstr(temp_str)); + key_v2 = true; + + if(context->proto == DS1990) { + if(strcmp(furi_string_get_cstr(temp_str), "DS1990") != 0) { + FURI_LOG_E(TAG, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); + break; + } + } else if(context->proto == Cyfral) { + if(strcmp(furi_string_get_cstr(temp_str), "Cyfral") != 0) { + FURI_LOG_E(TAG, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); + break; + } + } else { + if(strcmp(furi_string_get_cstr(temp_str), "Metakom") != 0) { + FURI_LOG_E(TAG, "Unsupported Key type"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Unsupported Key type"); + break; + } + } } else { FURI_LOG_I(TAG, "Key type: %s", furi_string_get_cstr(temp_str)); @@ -60,46 +94,125 @@ bool ibtnfuzzer_load(iBtnFuzzerState* context, const char* file_path) { } } } - - // Data - if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) { - FURI_LOG_E(TAG, "Missing or incorrect Data"); - furi_string_reset(context->notification_msg); - furi_string_set(context->notification_msg, "Missing or incorrect Key"); - break; - } else { - FURI_LOG_I(TAG, "Key: %s", furi_string_get_cstr(context->data_str)); - - if(context->proto == DS1990) { - if(furi_string_size(context->data_str) != 23) { - FURI_LOG_E(TAG, "Incorrect Key length"); - furi_string_reset(context->notification_msg); - furi_string_set(context->notification_msg, "Incorrect Key length"); - break; - } - } else if(context->proto == Cyfral) { - if(furi_string_size(context->data_str) != 5) { - FURI_LOG_E(TAG, "Incorrect Key length"); - furi_string_reset(context->notification_msg); - furi_string_set(context->notification_msg, "Incorrect Key length"); - break; - } + if(!key_v2) { + // Data + if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) { + FURI_LOG_E(TAG, "Missing or incorrect Data"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Key"); + break; } else { - if(furi_string_size(context->data_str) != 11) { - FURI_LOG_E(TAG, "Incorrect Key length"); - furi_string_reset(context->notification_msg); - furi_string_set(context->notification_msg, "Incorrect Key length"); - break; + FURI_LOG_I(TAG, "Key: %s", furi_string_get_cstr(context->data_str)); + + if(context->proto == DS1990) { + if(furi_string_size(context->data_str) != 23) { + FURI_LOG_E(TAG, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); + break; + } + } else if(context->proto == Cyfral) { + if(furi_string_size(context->data_str) != 5) { + FURI_LOG_E(TAG, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); + break; + } + } else { + if(furi_string_size(context->data_str) != 11) { + FURI_LOG_E(TAG, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); + break; + } + } + + // String to uint8_t + for(uint8_t i = 0; i < 8; i++) { + char temp_str2[3]; + temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3]; + temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1]; + temp_str2[2] = '\0'; + context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); } } + } else { + // Data + if(context->proto == DS1990) { + if(!flipper_format_read_string(fff_data_file, "Rom Data", context->data_str)) { + FURI_LOG_E(TAG, "Missing or incorrect Rom Data"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Rom Data"); + break; + } else { + FURI_LOG_I(TAG, "Key: %s", furi_string_get_cstr(context->data_str)); - // String to uint8_t - for(uint8_t i = 0; i < 8; i++) { - char temp_str2[3]; - temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3]; - temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1]; - temp_str2[2] = '\0'; - context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); + if(furi_string_size(context->data_str) != 23) { + FURI_LOG_E(TAG, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); + break; + } + + // String to uint8_t + for(uint8_t i = 0; i < 8; i++) { + char temp_str2[3]; + temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3]; + temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1]; + temp_str2[2] = '\0'; + context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); + } + } + } else if(context->proto == Cyfral) { + if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) { + FURI_LOG_E(TAG, "Missing or incorrect Data"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Data"); + break; + } else { + FURI_LOG_I(TAG, "Key: %s", furi_string_get_cstr(context->data_str)); + + if(furi_string_size(context->data_str) != 5) { + FURI_LOG_E(TAG, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); + break; + } + + // String to uint8_t + for(uint8_t i = 0; i < 8; i++) { + char temp_str2[3]; + temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3]; + temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1]; + temp_str2[2] = '\0'; + context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); + } + } + } else { + if(!flipper_format_read_string(fff_data_file, "Data", context->data_str)) { + FURI_LOG_E(TAG, "Missing or incorrect Data"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Missing or incorrect Data"); + break; + } else { + FURI_LOG_I(TAG, "Key: %s", furi_string_get_cstr(context->data_str)); + + if(furi_string_size(context->data_str) != 11) { + FURI_LOG_E(TAG, "Incorrect Key length"); + furi_string_reset(context->notification_msg); + furi_string_set(context->notification_msg, "Incorrect Key length"); + break; + } + + // String to uint8_t + for(uint8_t i = 0; i < 8; i++) { + char temp_str2[3]; + temp_str2[0] = furi_string_get_cstr(context->data_str)[i * 3]; + temp_str2[1] = furi_string_get_cstr(context->data_str)[i * 3 + 1]; + temp_str2[2] = '\0'; + context->data[i] = (uint8_t)strtol(temp_str2, NULL, 16); + } + } } } From 6d433edc3887d007b20c9dc6ee05dfcc1b459b1f Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Sun, 4 Jun 2023 10:48:46 +0200 Subject: [PATCH 06/11] Add furi_hal_version_uid_default (Fix TOTP) --- applications/external/totp/services/crypto/crypto.c | 2 +- firmware/targets/f7/api_symbols.csv | 3 ++- firmware/targets/f7/furi_hal/furi_hal_version.c | 4 ++++ firmware/targets/furi_hal_include/furi_hal_version.h | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/applications/external/totp/services/crypto/crypto.c b/applications/external/totp/services/crypto/crypto.c index 03d9c9d51..d01fe5c11 100644 --- a/applications/external/totp/services/crypto/crypto.c +++ b/applications/external/totp/services/crypto/crypto.c @@ -90,7 +90,7 @@ CryptoSeedIVResult max_i = uid_size; } - const uint8_t* uid = furi_hal_version_uid(); + const uint8_t* uid = furi_hal_version_uid_default(); for(uint8_t i = 0; i < max_i; i++) { plugin_state->iv[i] = plugin_state->iv[i] ^ uid[i]; } diff --git a/firmware/targets/f7/api_symbols.csv b/firmware/targets/f7/api_symbols.csv index c033cf3ea..5128fdace 100644 --- a/firmware/targets/f7/api_symbols.csv +++ b/firmware/targets/f7/api_symbols.csv @@ -1,5 +1,5 @@ entry,status,name,type,params -Version,+,28.2,, +Version,+,28.3,, Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli_vcp.h,, @@ -1481,6 +1481,7 @@ Function,+,furi_hal_version_get_otp_version,FuriHalVersionOtpVersion, Function,-,furi_hal_version_init,void, Function,-,furi_hal_version_set_name,void,const char* Function,+,furi_hal_version_uid,const uint8_t*, +Function,+,furi_hal_version_uid_default,const uint8_t*, Function,+,furi_hal_version_uid_size,size_t, Function,-,furi_hal_vibro_init,void, Function,+,furi_hal_vibro_on,void,_Bool diff --git a/firmware/targets/f7/furi_hal/furi_hal_version.c b/firmware/targets/f7/furi_hal/furi_hal_version.c index d0857f288..0e5f428ba 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_version.c +++ b/firmware/targets/f7/furi_hal/furi_hal_version.c @@ -314,6 +314,10 @@ size_t furi_hal_version_uid_size() { return 64 / 8; } +const uint8_t* furi_hal_version_uid_default() { + return (const uint8_t*)UID64_BASE; +} + const uint8_t* furi_hal_version_uid() { if(version_get_custom_name(NULL) != NULL) { return (const uint8_t*)&(*((uint32_t*)version_get_custom_name(NULL))); diff --git a/firmware/targets/furi_hal_include/furi_hal_version.h b/firmware/targets/furi_hal_include/furi_hal_version.h index f5e5ca49a..4a3f4c170 100644 --- a/firmware/targets/furi_hal_include/furi_hal_version.h +++ b/firmware/targets/furi_hal_include/furi_hal_version.h @@ -204,6 +204,8 @@ size_t furi_hal_version_uid_size(); */ const uint8_t* furi_hal_version_uid(); +const uint8_t* furi_hal_version_uid_default(); + #ifdef __cplusplus } #endif From a12f563d1c44b9bd6b71035bc50f6a4b8cfea4bf Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Sun, 4 Jun 2023 10:56:53 +0200 Subject: [PATCH 07/11] revert in app, dumb idea, needs some more work. --- applications/external/totp/services/crypto/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/external/totp/services/crypto/crypto.c b/applications/external/totp/services/crypto/crypto.c index d01fe5c11..03d9c9d51 100644 --- a/applications/external/totp/services/crypto/crypto.c +++ b/applications/external/totp/services/crypto/crypto.c @@ -90,7 +90,7 @@ CryptoSeedIVResult max_i = uid_size; } - const uint8_t* uid = furi_hal_version_uid_default(); + const uint8_t* uid = furi_hal_version_uid(); for(uint8_t i = 0; i < max_i; i++) { plugin_state->iv[i] = plugin_state->iv[i] ^ uid[i]; } From 0f8ca0a56347571963ade5af580e843eff946543 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 4 Jun 2023 12:52:24 +0300 Subject: [PATCH 08/11] Apply required TOTP changes --- applications/external/totp/services/crypto/crypto.c | 5 ++++- firmware/targets/f7/api_symbols.csv | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/external/totp/services/crypto/crypto.c b/applications/external/totp/services/crypto/crypto.c index 03d9c9d51..448529100 100644 --- a/applications/external/totp/services/crypto/crypto.c +++ b/applications/external/totp/services/crypto/crypto.c @@ -89,8 +89,11 @@ CryptoSeedIVResult } else { max_i = uid_size; } - +#if TOTP_TARGET_FIRMWARE == TOTP_FIRMWARE_UL_XFW + const uint8_t* uid = furi_hal_version_uid_default(); +#else const uint8_t* uid = furi_hal_version_uid(); +#endif for(uint8_t i = 0; i < max_i; i++) { plugin_state->iv[i] = plugin_state->iv[i] ^ uid[i]; } diff --git a/firmware/targets/f7/api_symbols.csv b/firmware/targets/f7/api_symbols.csv index 5128fdace..58f439b3a 100644 --- a/firmware/targets/f7/api_symbols.csv +++ b/firmware/targets/f7/api_symbols.csv @@ -1,5 +1,5 @@ entry,status,name,type,params -Version,+,28.3,, +Version,+,28.2,, Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli_vcp.h,, From 2e47c5a2acbcf5e4cfd614fe209043760e90e9a3 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 4 Jun 2023 15:27:59 +0300 Subject: [PATCH 09/11] lets try patch --- .ci_files/rgb.patch | 556 ++++++++++++++++++++++++++++++++++++++++++++ .drone.yml | 96 +++++++- 2 files changed, 648 insertions(+), 4 deletions(-) create mode 100644 .ci_files/rgb.patch diff --git a/.ci_files/rgb.patch b/.ci_files/rgb.patch new file mode 100644 index 000000000..804034bab --- /dev/null +++ b/.ci_files/rgb.patch @@ -0,0 +1,556 @@ +diff --git a/applications/services/notification/notification_app.c b/applications/services/notification/notification_app.c +index f91a73f32..b559a79ad 100644 +--- a/applications/services/notification/notification_app.c ++++ b/applications/services/notification/notification_app.c +@@ -6,6 +6,7 @@ + #include "notification.h" + #include "notification_messages.h" + #include "notification_app.h" ++#include "applications/settings/notification_settings/rgb_backlight.h" + + #define TAG "NotificationSrv" + +@@ -564,6 +565,7 @@ int32_t notification_srv(void* p) { + break; + case SaveSettingsMessage: + notification_save_settings(app); ++ rgb_backlight_save_settings(); + break; + } + +diff --git a/applications/settings/notification_settings/notification_settings_app.c b/applications/settings/notification_settings/notification_settings_app.c +index f5d7a82ca..930c0bd1f 100644 +--- a/applications/settings/notification_settings/notification_settings_app.c ++++ b/applications/settings/notification_settings/notification_settings_app.c +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + #define MAX_NOTIFICATION_SETTINGS 4 + +@@ -73,7 +74,6 @@ const bool vibro_value[VIBRO_COUNT] = {false, true}; + static void backlight_changed(VariableItem* item) { + NotificationAppSettings* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); +- + variable_item_set_current_value_text(item, backlight_text[index]); + app->notification->settings.display_brightness = backlight_value[index]; + notification_message(app->notification, &sequence_display_backlight_on); +@@ -125,6 +125,14 @@ static void vibro_changed(VariableItem* item) { + notification_message(app->notification, &sequence_single_vibro); + } + ++static void color_changed(VariableItem* item) { ++ NotificationAppSettings* app = variable_item_get_context(item); ++ uint8_t index = variable_item_get_current_value_index(item); ++ rgb_backlight_set_color(index); ++ variable_item_set_current_value_text(item, rgb_backlight_get_color_text(index)); ++ notification_message(app->notification, &sequence_display_backlight_on); ++} ++ + static uint32_t notification_app_settings_exit(void* context) { + UNUSED(context); + return VIEW_NONE; +@@ -143,7 +151,13 @@ static NotificationAppSettings* alloc_settings() { + uint8_t value_index; + + item = variable_item_list_add( +- app->variable_item_list, "LCD Backlight", BACKLIGHT_COUNT, backlight_changed, app); ++ app->variable_item_list, "LCD Color", rgb_backlight_get_color_count(), color_changed, app); ++ value_index = rgb_backlight_get_settings()->display_color_index; ++ variable_item_set_current_value_index(item, value_index); ++ variable_item_set_current_value_text(item, rgb_backlight_get_color_text(value_index)); ++ ++ item = variable_item_list_add( ++ app->variable_item_list, "LCD Brightness", BACKLIGHT_COUNT, backlight_changed, app); + value_index = value_index_float( + app->notification->settings.display_brightness, backlight_value, BACKLIGHT_COUNT); + variable_item_set_current_value_index(item, value_index); +@@ -215,6 +229,7 @@ int32_t notification_settings_app(void* p) { + NotificationAppSettings* app = alloc_settings(); + view_dispatcher_run(app->view_dispatcher); + notification_message_save_settings(app->notification); ++ + free_settings(app); + return 0; + } +diff --git a/applications/settings/notification_settings/rgb_backlight.c b/applications/settings/notification_settings/rgb_backlight.c +new file mode 100644 +index 000000000..269b544ae +--- /dev/null ++++ b/applications/settings/notification_settings/rgb_backlight.c +@@ -0,0 +1,171 @@ ++/* ++ RGB backlight FlipperZero driver ++ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n) ++ ++ This program is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++*/ ++ ++#include "rgb_backlight.h" ++#include ++#include ++ ++#define RGB_BACKLIGHT_SETTINGS_VERSION 5 ++#define RGB_BACKLIGHT_SETTINGS_FILE_NAME ".rgb_backlight.settings" ++#define RGB_BACKLIGHT_SETTINGS_PATH EXT_PATH(RGB_BACKLIGHT_SETTINGS_FILE_NAME) ++ ++#define COLOR_COUNT (sizeof(colors) / sizeof(RGBBacklightColor)) ++ ++#define TAG "RGB Backlight" ++ ++static RGBBacklightSettings rgb_settings = { ++ .version = RGB_BACKLIGHT_SETTINGS_VERSION, ++ .display_color_index = 0, ++ .settings_is_loaded = false}; ++ ++static const RGBBacklightColor colors[] = { ++ {"Orange", 255, 79, 0}, ++ {"Yellow", 255, 170, 0}, ++ {"Spring", 167, 255, 0}, ++ {"Lime", 0, 255, 0}, ++ {"Aqua", 0, 255, 127}, ++ {"Cyan", 0, 210, 210}, ++ {"Azure", 0, 127, 255}, ++ {"Blue", 0, 0, 255}, ++ {"Purple", 127, 0, 255}, ++ {"Magenta", 210, 0, 210}, ++ {"Pink", 255, 0, 127}, ++ {"Red", 255, 0, 0}, ++ {"White", 140, 140, 140}, ++}; ++ ++uint8_t rgb_backlight_get_color_count(void) { ++ return COLOR_COUNT; ++} ++ ++const char* rgb_backlight_get_color_text(uint8_t index) { ++ return colors[index].name; ++} ++ ++void rgb_backlight_load_settings(void) { ++ //Не загружать данные из внутренней памяти при загрузке в режиме DFU ++ FuriHalRtcBootMode bm = furi_hal_rtc_get_boot_mode(); ++ if(bm == FuriHalRtcBootModeDfu) { ++ rgb_settings.settings_is_loaded = true; ++ return; ++ } ++ ++ RGBBacklightSettings settings; ++ File* file = storage_file_alloc(furi_record_open(RECORD_STORAGE)); ++ const size_t settings_size = sizeof(RGBBacklightSettings); ++ ++ FURI_LOG_I(TAG, "loading settings from \"%s\"", RGB_BACKLIGHT_SETTINGS_PATH); ++ bool fs_result = ++ storage_file_open(file, RGB_BACKLIGHT_SETTINGS_PATH, FSAM_READ, FSOM_OPEN_EXISTING); ++ ++ if(fs_result) { ++ uint16_t bytes_count = storage_file_read(file, &settings, settings_size); ++ ++ if(bytes_count != settings_size) { ++ fs_result = false; ++ } ++ } ++ ++ if(fs_result) { ++ FURI_LOG_I(TAG, "load success"); ++ if(settings.version != RGB_BACKLIGHT_SETTINGS_VERSION) { ++ FURI_LOG_E( ++ TAG, ++ "version(%d != %d) mismatch", ++ settings.version, ++ RGB_BACKLIGHT_SETTINGS_VERSION); ++ } else { ++ memcpy(&rgb_settings, &settings, settings_size); ++ } ++ } else { ++ FURI_LOG_E(TAG, "load failed, %s", storage_file_get_error_desc(file)); ++ } ++ ++ storage_file_close(file); ++ storage_file_free(file); ++ furi_record_close(RECORD_STORAGE); ++ rgb_settings.settings_is_loaded = true; ++}; ++ ++void rgb_backlight_save_settings(void) { ++ RGBBacklightSettings settings; ++ File* file = storage_file_alloc(furi_record_open(RECORD_STORAGE)); ++ const size_t settings_size = sizeof(RGBBacklightSettings); ++ ++ FURI_LOG_I(TAG, "saving settings to \"%s\"", RGB_BACKLIGHT_SETTINGS_PATH); ++ ++ memcpy(&settings, &rgb_settings, settings_size); ++ ++ bool fs_result = ++ storage_file_open(file, RGB_BACKLIGHT_SETTINGS_PATH, FSAM_WRITE, FSOM_CREATE_ALWAYS); ++ ++ if(fs_result) { ++ uint16_t bytes_count = storage_file_write(file, &settings, settings_size); ++ ++ if(bytes_count != settings_size) { ++ fs_result = false; ++ } ++ } ++ ++ if(fs_result) { ++ FURI_LOG_I(TAG, "save success"); ++ } else { ++ FURI_LOG_E(TAG, "save failed, %s", storage_file_get_error_desc(file)); ++ } ++ ++ storage_file_close(file); ++ storage_file_free(file); ++ furi_record_close(RECORD_STORAGE); ++}; ++ ++RGBBacklightSettings* rgb_backlight_get_settings(void) { ++ if(!rgb_settings.settings_is_loaded) { ++ rgb_backlight_load_settings(); ++ } ++ return &rgb_settings; ++} ++ ++void rgb_backlight_set_color(uint8_t color_index) { ++ if(color_index > (rgb_backlight_get_color_count() - 1)) color_index = 0; ++ rgb_settings.display_color_index = color_index; ++} ++ ++void rgb_backlight_update(uint8_t brightness) { ++ if(!rgb_settings.settings_is_loaded) { ++ rgb_backlight_load_settings(); ++ } ++ ++ static uint8_t last_color_index = 255; ++ static uint8_t last_brightness = 123; ++ ++ if(last_brightness == brightness && last_color_index == rgb_settings.display_color_index) ++ return; ++ ++ last_brightness = brightness; ++ last_color_index = rgb_settings.display_color_index; ++ ++ for(uint8_t i = 0; i < SK6805_get_led_count(); i++) { ++ uint8_t r = colors[rgb_settings.display_color_index].red * (brightness / 255.0f); ++ uint8_t g = colors[rgb_settings.display_color_index].green * (brightness / 255.0f); ++ uint8_t b = colors[rgb_settings.display_color_index].blue * (brightness / 255.0f); ++ ++ SK6805_set_led_color(i, r, g, b); ++ } ++ ++ SK6805_update(); ++} +diff --git a/applications/settings/notification_settings/rgb_backlight.h b/applications/settings/notification_settings/rgb_backlight.h +new file mode 100644 +index 000000000..b63d223e6 +--- /dev/null ++++ b/applications/settings/notification_settings/rgb_backlight.h +@@ -0,0 +1,79 @@ ++/* ++ RGB backlight FlipperZero driver ++ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n) ++ ++ This program is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++*/ ++ ++#include ++#include "SK6805.h" ++ ++typedef struct { ++ char* name; ++ uint8_t red; ++ uint8_t green; ++ uint8_t blue; ++} RGBBacklightColor; ++ ++typedef struct { ++ uint8_t version; ++ uint8_t display_color_index; ++ bool settings_is_loaded; ++} RGBBacklightSettings; ++ ++/** ++ * @brief Получить текущие настройки RGB-подсветки ++ * ++ * @return Указатель на структуру настроек ++ */ ++RGBBacklightSettings* rgb_backlight_get_settings(void); ++ ++/** ++ * @brief Загрузить настройки подсветки с SD-карты ++ */ ++void rgb_backlight_load_settings(void); ++ ++/** ++ * @brief Сохранить текущие настройки RGB-подсветки ++ */ ++void rgb_backlight_save_settings(void); ++ ++/** ++ * @brief Применить текущие настройки RGB-подсветки ++ * ++ * @param brightness Яркость свечения (0-255) ++ */ ++void rgb_backlight_update(uint8_t brightness); ++ ++/** ++ * @brief Установить цвет RGB-подсветки ++ * ++ * @param color_index Индекс цвета (0 - rgb_backlight_get_color_count()) ++ */ ++void rgb_backlight_set_color(uint8_t color_index); ++ ++/** ++ * @brief Получить количество доступных цветов ++ * ++ * @return Число доступных вариантов цвета ++ */ ++uint8_t rgb_backlight_get_color_count(void); ++ ++/** ++ * @brief Получить текстовое название цвета ++ * ++ * @param index Индекс из доступных вариантов цвета ++ * @return Указатель на строку с названием цвета ++ */ ++const char* rgb_backlight_get_color_text(uint8_t index); +\ No newline at end of file +diff --git a/firmware/targets/f7/furi_hal/furi_hal_light.c b/firmware/targets/f7/furi_hal/furi_hal_light.c +index 83e1603b7..cad5b86cb 100644 +--- a/firmware/targets/f7/furi_hal/furi_hal_light.c ++++ b/firmware/targets/f7/furi_hal/furi_hal_light.c +@@ -3,6 +3,7 @@ + #include + #include + #include ++#include + + #define LED_CURRENT_RED 50 + #define LED_CURRENT_GREEN 50 +@@ -31,22 +32,21 @@ void furi_hal_light_init() { + } + + void furi_hal_light_set(Light light, uint8_t value) { +- furi_hal_i2c_acquire(&furi_hal_i2c_handle_power); +- if(light & LightRed) { +- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelRed, value); +- } +- if(light & LightGreen) { +- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelGreen, value); +- } +- if(light & LightBlue) { +- lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value); +- } + if(light & LightBacklight) { +- uint8_t prev = lp5562_get_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelWhite); +- lp5562_execute_ramp( +- &furi_hal_i2c_handle_power, LP5562Engine1, LP5562ChannelWhite, prev, value, 100); ++ rgb_backlight_update(value); ++ } else { ++ furi_hal_i2c_acquire(&furi_hal_i2c_handle_power); ++ if(light & LightRed) { ++ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelRed, value); ++ } ++ if(light & LightGreen) { ++ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelGreen, value); ++ } ++ if(light & LightBlue) { ++ lp5562_set_channel_value(&furi_hal_i2c_handle_power, LP5562ChannelBlue, value); ++ } ++ furi_hal_i2c_release(&furi_hal_i2c_handle_power); + } +- furi_hal_i2c_release(&furi_hal_i2c_handle_power); + } + + void furi_hal_light_blink_start(Light light, uint8_t brightness, uint16_t on_time, uint16_t period) { +diff --git a/lib/drivers/SK6805.c b/lib/drivers/SK6805.c +new file mode 100644 +index 000000000..572e1df97 +--- /dev/null ++++ b/lib/drivers/SK6805.c +@@ -0,0 +1,101 @@ ++/* ++ SK6805 FlipperZero driver ++ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n) ++ ++ This program is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++*/ ++ ++#include "SK6805.h" ++#include ++ ++/* Настройки */ ++#define SK6805_LED_COUNT 3 //Количество светодиодов на плате подсветки ++#define SK6805_LED_PIN &led_pin //Порт подключения светодиодов ++ ++#ifdef FURI_DEBUG ++#define DEBUG_PIN &gpio_ext_pa7 ++#define DEBUG_INIT() \ ++ furi_hal_gpio_init(DEBUG_PIN, GpioModeOutputPushPull, GpioPullNo, GpioSpeedVeryHigh) ++#define DEBUG_SET_HIGH() furi_hal_gpio_write(DEBUG_PIN, true) ++#define DEBUG_SET_LOW() furi_hal_gpio_write(DEBUG_PIN, false) ++#else ++#define DEBUG_INIT() ++#define DEBUG_SET_HIGH() ++#define DEBUG_SET_LOW() ++#endif ++ ++static const GpioPin led_pin = {.port = GPIOA, .pin = LL_GPIO_PIN_8}; ++static uint8_t led_buffer[SK6805_LED_COUNT][3]; ++ ++void SK6805_init(void) { ++ DEBUG_INIT(); ++ furi_hal_gpio_write(SK6805_LED_PIN, false); ++ furi_hal_gpio_init(SK6805_LED_PIN, GpioModeOutputPushPull, GpioPullNo, GpioSpeedVeryHigh); ++} ++ ++uint8_t SK6805_get_led_count(void) { ++ return (const uint8_t)SK6805_LED_COUNT; ++} ++void SK6805_set_led_color(uint8_t led_index, uint8_t r, uint8_t g, uint8_t b) { ++ furi_check(led_index < SK6805_LED_COUNT); ++ ++ led_buffer[led_index][0] = g; ++ led_buffer[led_index][1] = r; ++ led_buffer[led_index][2] = b; ++} ++ ++void SK6805_update(void) { ++ SK6805_init(); ++ furi_kernel_lock(); ++ uint32_t end; ++ /* Последовательная отправка цветов светодиодов */ ++ for(uint8_t lednumber = 0; lednumber < SK6805_LED_COUNT; lednumber++) { ++ //Последовательная отправка цветов светодиода ++ for(uint8_t color = 0; color < 3; color++) { ++ //Последовательная отправка битов цвета ++ uint8_t i = 0b10000000; ++ while(i != 0) { ++ if(led_buffer[lednumber][color] & (i)) { ++ furi_hal_gpio_write(SK6805_LED_PIN, true); ++ DEBUG_SET_HIGH(); ++ end = DWT->CYCCNT + 30; ++ //T1H 600 us (615 us) ++ while(DWT->CYCCNT < end) { ++ } ++ furi_hal_gpio_write(SK6805_LED_PIN, false); ++ DEBUG_SET_LOW(); ++ end = DWT->CYCCNT + 26; ++ //T1L 600 us (587 us) ++ while(DWT->CYCCNT < end) { ++ } ++ } else { ++ furi_hal_gpio_write(SK6805_LED_PIN, true); ++ DEBUG_SET_HIGH(); ++ end = DWT->CYCCNT + 11; ++ //T0H 300 ns (312 ns) ++ while(DWT->CYCCNT < end) { ++ } ++ furi_hal_gpio_write(SK6805_LED_PIN, false); ++ DEBUG_SET_LOW(); ++ end = DWT->CYCCNT + 43; ++ //T0L 900 ns (890 ns) ++ while(DWT->CYCCNT < end) { ++ } ++ } ++ i >>= 1; ++ } ++ } ++ } ++ furi_kernel_unlock(); ++} +diff --git a/lib/drivers/SK6805.h b/lib/drivers/SK6805.h +new file mode 100644 +index 000000000..7c58956fa +--- /dev/null ++++ b/lib/drivers/SK6805.h +@@ -0,0 +1,51 @@ ++/* ++ SK6805 FlipperZero driver ++ Copyright (C) 2022-2023 Victor Nikitchuk (https://github.com/quen0n) ++ ++ This program is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++*/ ++ ++#ifndef SK6805_H_ ++#define SK6805_H_ ++ ++#include ++ ++/** ++ * @brief Инициализация линии управления подсветкой ++ */ ++void SK6805_init(void); ++ ++/** ++ * @brief Получить количество светодиодов в подсветке ++ * ++ * @return Количество светодиодов ++ */ ++uint8_t SK6805_get_led_count(void); ++ ++/** ++ * @brief Установить цвет свечения светодиода ++ * ++ * @param led_index номер светодиода (от 0 до SK6805_get_led_count()) ++ * @param r значение красного (0-255) ++ * @param g значение зелёного (0-255) ++ * @param b значение синего (0-255) ++ */ ++void SK6805_set_led_color(uint8_t led_index, uint8_t r, uint8_t g, uint8_t b); ++ ++/** ++ * @brief Обновление состояния подсветки дисплея ++ */ ++void SK6805_update(void); ++ ++#endif /* SK6805_H_ */ +\ No newline at end of file + +\ No newline at end of file diff --git a/.drone.yml b/.drone.yml index a03063528..c82921c9d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,7 +31,9 @@ steps: - echo '' >> CHANGELOG.md - echo '### [Version without custom animations - Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-'${DRONE_TAG}'n.tgz&channel=release-cfw&version='${DRONE_TAG}'n)' >> CHANGELOG.md - echo '' >> CHANGELOG.md - - echo '### [Version with extra apps - Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)' >> CHANGELOG.md + - echo '### [Version with RGB patch - Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'r.tgz&channel=release-cfw&version='${DRONE_TAG}'r)' >> CHANGELOG.md + - echo '' >> CHANGELOG.md + - echo '## [Version with Extra apps - Install via Web Updater](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)' >> CHANGELOG.md environment: FBT_TOOLS_CUSTOM_LINK: from_secret: fbt_link @@ -56,10 +58,30 @@ steps: FBT_TOOLS_CUSTOM_LINK: from_secret: fbt_link + - name: "Build with RGB patch" + image: hfdj/fztools + pull: never + commands: + - git apply .ci_files/rgb.patch + - export DIST_SUFFIX=${DRONE_TAG}r + - export WORKFLOW_BRANCH_OR_TAG=release-cfw + - export FORCE_NO_DIRTY=yes + - rm -f build/f7-firmware-C/toolbox/version.* + - ./fbt COMPACT=1 DEBUG=0 updater_package + - mkdir artifacts-rgb-patch + - mv dist/f7-C/* artifacts-rgb-patch/ + - ls -laS artifacts-rgb-patch + - ls -laS artifacts-rgb-patch/f7-update-${DRONE_TAG}r + environment: + FBT_TOOLS_CUSTOM_LINK: + from_secret: fbt_link + - name: "Build with ofw anims" image: hfdj/fztools pull: never commands: + - git clean -df + - git checkout -- . - rm -f assets/dolphin/external/manifest.txt - cp .ci_files/anims_ofw.txt assets/dolphin/external/manifest.txt - rm -rf assets/resources/apps/ @@ -80,16 +102,20 @@ steps: image: kramos/alpine-zip commands: - cp artifacts-extra-apps/flipper-z-f7-update-${DRONE_TAG}e.tgz . + - cp artifacts-rgb-patch/flipper-z-f7-update-${DRONE_TAG}r.tgz . - cp artifacts-ofw-anims/flipper-z-f7-update-${DRONE_TAG}n.tgz . - cp artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz . - zip -r artifacts-extra-apps/flipper-z-f7-update-${DRONE_TAG}e.zip artifacts-extra-apps/f7-update-${DRONE_TAG}e + - zip -r artifacts-rgb-patch/flipper-z-f7-update-${DRONE_TAG}r.zip artifacts-rgb-patch/f7-update-${DRONE_TAG}r - zip -r artifacts-ofw-anims/flipper-z-f7-update-${DRONE_TAG}n.zip artifacts-ofw-anims/f7-update-${DRONE_TAG}n - zip -r artifacts-default/flipper-z-f7-update-${DRONE_TAG}.zip artifacts-default/f7-update-${DRONE_TAG} - tar czpf artifacts-default/flipper-z-any-scripts-${DRONE_TAG}.tgz scripts - rm -rf artifacts-extra-apps/f7-update-${DRONE_TAG} + - rm -rf artifacts-rgb-patch/f7-update-${DRONE_TAG} - rm -rf artifacts-ofw-anims/f7-update-${DRONE_TAG} - rm -rf artifacts-default/f7-update-${DRONE_TAG} - ls -laS artifacts-extra-apps + - ls -laS artifacts-rgb-patch - ls -laS artifacts-ofw-anims - ls -laS artifacts-default - mv artifacts-default/ ${DRONE_TAG} @@ -146,6 +172,21 @@ steps: from_secret: dep_target_extra source: flipper-z-f7-update-${DRONE_TAG}e.tgz + - name: "Upload rgb patch version to updates srv" + image: appleboy/drone-scp:linux-amd64 + settings: + host: + from_secret: dep_host + username: + from_secret: dep_user + password: + from_secret: dep_passwd + port: + from_secret: dep_port + target: + from_secret: dep_target_extra + source: flipper-z-f7-update-${DRONE_TAG}r.tgz + - name: "Do Github release" image: ddplugins/github-release pull: never @@ -160,6 +201,7 @@ steps: - ${DRONE_TAG}/*.zip - artifacts-ofw-anims/*.tgz - artifacts-extra-apps/*.tgz + - artifacts-rgb-patch/*.tgz title: ${DRONE_TAG} note: CHANGELOG.md checksum: @@ -210,7 +252,13 @@ steps: [-Version without custom animations - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-${DRONE_TAG}n.tgz&channel=release-cfw&version=${DRONE_TAG}n) - [-Version with extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_TAG}e.tgz&channel=release-cfw&version=${DRONE_TAG}e)" + [-Version with RGB patch - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_TAG}r.tgz&channel=release-cfw&version=${DRONE_TAG}r) + + + [-Version with RGB patch - Direct download-](https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_TAG}r.tgz) + + + [-Version with Extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_TAG}e.tgz&channel=release-cfw&version=${DRONE_TAG}e)" document: - ${DRONE_TAG}/flipper-z-f7-update-${DRONE_TAG}.tgz @@ -223,7 +271,7 @@ steps: commands: - wget "https://raw.githubusercontent.com/fieu/discord.sh/e1dc1a7595efad2cad8f072f0b3531c470f5b7c8/discord.sh" - chmod +x ./discord.sh - - ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\n\n[[Github - Changelog]](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/'${DRONE_TAG}')\n\n[-How to install firmware-](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)\n\n[-Download latest extra apps pack-](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)\n\n[-Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/'${DRONE_TAG}'/flipper-z-f7-update-'${DRONE_TAG}'.tgz&channel=release-cfw&version='${DRONE_TAG}')\n\n[-Version without custom animations - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-'${DRONE_TAG}'n.tgz&channel=release-cfw&version='${DRONE_TAG}'n)\n\n[-Version with extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)' + - ./discord.sh --text 'New Unleashed firmware released!\n\nVersion - '${DRONE_TAG}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\n\n[[Github - Changelog]](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/'${DRONE_TAG}')\n\n[-How to install firmware-](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)\n\n[-Download latest extra apps pack-](https://github.com/xMasterX/all-the-plugins/archive/refs/heads/main.zip)\n\n[-Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/'${DRONE_TAG}'/flipper-z-f7-update-'${DRONE_TAG}'.tgz&channel=release-cfw&version='${DRONE_TAG}')\n\n[-Version without custom animations - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_no_anim/flipper-z-f7-update-'${DRONE_TAG}'n.tgz&channel=release-cfw&version='${DRONE_TAG}'n)\n\n[-Version with RGB patch - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'r.tgz&channel=release-cfw&version='${DRONE_TAG}'r)\n\n[-Version with RGB patch - Direct download-](https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'r.tgz)\n\n[-Version with Extra apps - Install FW via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_TAG}'e.tgz&channel=release-cfw&version='${DRONE_TAG}'e)' - name: "Send extra pack build to telegram" image: appleboy/drone-telegram @@ -297,10 +345,29 @@ steps: FBT_TOOLS_CUSTOM_LINK: from_secret: fbt_link + - name: "Build dev with rgb patch" + image: hfdj/fztools + pull: never + commands: + - git apply .ci_files/rgb.patch + - export DIST_SUFFIX=${DRONE_BUILD_NUMBER}r + - export WORKFLOW_BRANCH_OR_TAG=dev-cfw + - export FORCE_NO_DIRTY=yes + - rm -f build/f7-firmware-C/toolbox/version.* + - ./fbt COMPACT=1 DEBUG=0 updater_package + - mkdir artifacts-rgb-patch + - mv dist/f7-C/* artifacts-rgb-patch/ + - ls -laS artifacts-rgb-patch + - ls -laS artifacts-rgb-patch/f7-update-${DRONE_BUILD_NUMBER}r + environment: + FBT_TOOLS_CUSTOM_LINK: + from_secret: fbt_link + - name: "Bundle self-update packages" image: kramos/alpine-zip commands: - cp artifacts-extra-apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz . + - cp artifacts-rgb-patch/flipper-z-f7-update-${DRONE_BUILD_NUMBER}r.tgz . - cp artifacts-default/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz . - rm -rf artifacts-default/f7-update-${DRONE_BUILD_NUMBER} - ls -laS artifacts-default @@ -358,6 +425,21 @@ steps: from_secret: dep_target_extra source: flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz + - name: "Upload rgb patch version to updates srv" + image: appleboy/drone-scp:linux-amd64 + settings: + host: + from_secret: dep_host + username: + from_secret: dep_user + password: + from_secret: dep_passwd + port: + from_secret: dep_port + target: + from_secret: dep_target_extra + source: flipper-z-f7-update-${DRONE_BUILD_NUMBER}r.tgz + - name: "Trigger update server reindex" image: hfdj/fztools pull: never @@ -392,6 +474,12 @@ steps: [-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-${DRONE_BUILD_NUMBER}.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}) + [-Version with RGB patch - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}r.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}r) + + + [-Version with RGB patch - Direct download-](https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}r.tgz) + + [-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}e)" - name: "Send build to telegram" @@ -427,7 +515,7 @@ steps: commands: - wget "https://raw.githubusercontent.com/fieu/discord.sh/e1dc1a7595efad2cad8f072f0b3531c470f5b7c8/discord.sh" - chmod +x ./discord.sh - - ./discord.sh --text 'Unleashed firmware dev build successful!\n\nBuild - '${DRONE_BUILD_NUMBER}'\n\nCommit - https://github.com/DarkFlippers/unleashed-firmware/commit/'${DRONE_COMMIT_SHA}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\n\n[-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'e.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}'e)\n\n[-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}')' + - ./discord.sh --text 'Unleashed firmware dev build successful!\n\nBuild - '${DRONE_BUILD_NUMBER}'\n\nCommit - https://github.com/DarkFlippers/unleashed-firmware/commit/'${DRONE_COMMIT_SHA}'\n\n[-> Sponsor our project](https://boosty.to/mmxdev)\n\n[-Version with Extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'e.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}'e)\n\n[-Version with RGB patch - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'r.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}'r)\n\n[-Version with RGB patch - Direct download-](https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'r.tgz)\n\n[-Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw/dev/flipper-z-f7-update-'${DRONE_BUILD_NUMBER}'.tgz&channel=dev-cfw&version='${DRONE_BUILD_NUMBER}')' trigger: branch: From b16357494dd28e62e158032b622cc04e74bd295a Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 4 Jun 2023 15:31:39 +0300 Subject: [PATCH 10/11] fix branch --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index c82921c9d..bb7d4fcd9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -64,7 +64,7 @@ steps: commands: - git apply .ci_files/rgb.patch - export DIST_SUFFIX=${DRONE_TAG}r - - export WORKFLOW_BRANCH_OR_TAG=release-cfw + - export WORKFLOW_BRANCH_OR_TAG=release-cfw-rgb - export FORCE_NO_DIRTY=yes - rm -f build/f7-firmware-C/toolbox/version.* - ./fbt COMPACT=1 DEBUG=0 updater_package @@ -351,7 +351,7 @@ steps: commands: - git apply .ci_files/rgb.patch - export DIST_SUFFIX=${DRONE_BUILD_NUMBER}r - - export WORKFLOW_BRANCH_OR_TAG=dev-cfw + - export WORKFLOW_BRANCH_OR_TAG=dev-cfw-rgb - export FORCE_NO_DIRTY=yes - rm -f build/f7-firmware-C/toolbox/version.* - ./fbt COMPACT=1 DEBUG=0 updater_package From 73d4fc6d2fa0f65fc050e525157688e6abb8de25 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 4 Jun 2023 15:35:43 +0300 Subject: [PATCH 11/11] Fix E --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index bb7d4fcd9..f7c6d07de 100644 --- a/.drone.yml +++ b/.drone.yml @@ -480,7 +480,7 @@ steps: [-Version with RGB patch - Direct download-](https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}r.tgz) - [-Version with extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}e)" + [-Version with Extra apps - Install via Web Updater-](https://lab.flipper.net/?url=https://unleashedflip.com/fw_extra_apps/flipper-z-f7-update-${DRONE_BUILD_NUMBER}e.tgz&channel=dev-cfw&version=${DRONE_BUILD_NUMBER}e)" - name: "Send build to telegram" image: appleboy/drone-telegram