mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-26 06:20:21 +00:00
revert furi_hal_version changes
This commit is contained in:
parent
c69ce4c921
commit
aa54a477d8
1 changed files with 21 additions and 11 deletions
|
@ -91,14 +91,7 @@ typedef struct {
|
|||
static FuriHalVersion furi_hal_version = {0};
|
||||
|
||||
void furi_hal_version_set_name(const char* name) {
|
||||
uint32_t udn = LL_FLASH_GetUDN();
|
||||
if(name == NULL) {
|
||||
name = version_get_custom_name(NULL);
|
||||
if(name != NULL) {
|
||||
udn = *((uint32_t*)name);
|
||||
}
|
||||
}
|
||||
if(name != NULL && strlen(name)) {
|
||||
if(name != NULL) {
|
||||
strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH);
|
||||
snprintf(
|
||||
furi_hal_version.device_name,
|
||||
|
@ -112,6 +105,11 @@ void furi_hal_version_set_name(const char* name) {
|
|||
furi_hal_version.device_name[0] = AD_TYPE_COMPLETE_LOCAL_NAME;
|
||||
|
||||
// BLE Mac address
|
||||
uint32_t udn = LL_FLASH_GetUDN();
|
||||
if(version_get_custom_name(NULL) != NULL) {
|
||||
udn = *((uint32_t*)version_get_custom_name(NULL));
|
||||
}
|
||||
|
||||
uint32_t company_id = LL_FLASH_GetSTCompanyID();
|
||||
// uint32_t device_id = LL_FLASH_GetDeviceID();
|
||||
// Some flippers return 0x27 (flippers with chip revision 2003 6495) instead of 0x26 (flippers with chip revision 2001 6495)
|
||||
|
@ -139,7 +137,11 @@ static void furi_hal_version_load_otp_v0() {
|
|||
furi_hal_version.board_body = otp->board_body;
|
||||
furi_hal_version.board_connect = otp->board_connect;
|
||||
|
||||
furi_hal_version_set_name(otp->name);
|
||||
if(version_get_custom_name(NULL) != NULL) {
|
||||
furi_hal_version_set_name(version_get_custom_name(NULL));
|
||||
} else {
|
||||
furi_hal_version_set_name(otp->name);
|
||||
}
|
||||
}
|
||||
|
||||
static void furi_hal_version_load_otp_v1() {
|
||||
|
@ -153,7 +155,11 @@ static void furi_hal_version_load_otp_v1() {
|
|||
furi_hal_version.board_color = otp->board_color;
|
||||
furi_hal_version.board_region = otp->board_region;
|
||||
|
||||
furi_hal_version_set_name(otp->name);
|
||||
if(version_get_custom_name(NULL) != NULL) {
|
||||
furi_hal_version_set_name(version_get_custom_name(NULL));
|
||||
} else {
|
||||
furi_hal_version_set_name(otp->name);
|
||||
}
|
||||
}
|
||||
|
||||
static void furi_hal_version_load_otp_v2() {
|
||||
|
@ -173,7 +179,11 @@ static void furi_hal_version_load_otp_v2() {
|
|||
if(otp->board_color != 0xFF) {
|
||||
furi_hal_version.board_color = otp->board_color;
|
||||
furi_hal_version.board_region = otp->board_region;
|
||||
furi_hal_version_set_name(otp->name);
|
||||
if(version_get_custom_name(NULL) != NULL) {
|
||||
furi_hal_version_set_name(version_get_custom_name(NULL));
|
||||
} else {
|
||||
furi_hal_version_set_name(otp->name);
|
||||
}
|
||||
} else {
|
||||
furi_hal_version.board_color = 0;
|
||||
furi_hal_version.board_region = 0;
|
||||
|
|
Loading…
Reference in a new issue