mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
revert furi_hal_version changes
This commit is contained in:
@@ -91,14 +91,7 @@ typedef struct {
|
|||||||
static FuriHalVersion furi_hal_version = {0};
|
static FuriHalVersion furi_hal_version = {0};
|
||||||
|
|
||||||
void furi_hal_version_set_name(const char* name) {
|
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) {
|
if(name != NULL) {
|
||||||
udn = *((uint32_t*)name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(name != NULL && strlen(name)) {
|
|
||||||
strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH);
|
strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH);
|
||||||
snprintf(
|
snprintf(
|
||||||
furi_hal_version.device_name,
|
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;
|
furi_hal_version.device_name[0] = AD_TYPE_COMPLETE_LOCAL_NAME;
|
||||||
|
|
||||||
// BLE Mac address
|
// 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 company_id = LL_FLASH_GetSTCompanyID();
|
||||||
// uint32_t device_id = LL_FLASH_GetDeviceID();
|
// 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)
|
// Some flippers return 0x27 (flippers with chip revision 2003 6495) instead of 0x26 (flippers with chip revision 2001 6495)
|
||||||
@@ -139,8 +137,12 @@ static void furi_hal_version_load_otp_v0() {
|
|||||||
furi_hal_version.board_body = otp->board_body;
|
furi_hal_version.board_body = otp->board_body;
|
||||||
furi_hal_version.board_connect = otp->board_connect;
|
furi_hal_version.board_connect = otp->board_connect;
|
||||||
|
|
||||||
|
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);
|
furi_hal_version_set_name(otp->name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void furi_hal_version_load_otp_v1() {
|
static void furi_hal_version_load_otp_v1() {
|
||||||
const FuriHalVersionOTPv1* otp = (FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS;
|
const FuriHalVersionOTPv1* otp = (FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS;
|
||||||
@@ -153,8 +155,12 @@ static void furi_hal_version_load_otp_v1() {
|
|||||||
furi_hal_version.board_color = otp->board_color;
|
furi_hal_version.board_color = otp->board_color;
|
||||||
furi_hal_version.board_region = otp->board_region;
|
furi_hal_version.board_region = otp->board_region;
|
||||||
|
|
||||||
|
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);
|
furi_hal_version_set_name(otp->name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void furi_hal_version_load_otp_v2() {
|
static void furi_hal_version_load_otp_v2() {
|
||||||
const FuriHalVersionOTPv2* otp = (FuriHalVersionOTPv2*)FURI_HAL_VERSION_OTP_ADDRESS;
|
const FuriHalVersionOTPv2* otp = (FuriHalVersionOTPv2*)FURI_HAL_VERSION_OTP_ADDRESS;
|
||||||
@@ -173,7 +179,11 @@ static void furi_hal_version_load_otp_v2() {
|
|||||||
if(otp->board_color != 0xFF) {
|
if(otp->board_color != 0xFF) {
|
||||||
furi_hal_version.board_color = otp->board_color;
|
furi_hal_version.board_color = otp->board_color;
|
||||||
furi_hal_version.board_region = otp->board_region;
|
furi_hal_version.board_region = otp->board_region;
|
||||||
|
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);
|
furi_hal_version_set_name(otp->name);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
furi_hal_version.board_color = 0;
|
furi_hal_version.board_color = 0;
|
||||||
furi_hal_version.board_region = 0;
|
furi_hal_version.board_region = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user