1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 12:42:30 +04:00

FuriHal: fix chip id used in BLE MAC address

This commit is contained in:
Aleksandr Kutuzov
2024-06-18 16:23:47 +01:00
parent 3859646e13
commit b7ad1b454d

View File

@@ -10,8 +10,10 @@
#define TAG "FuriHalVersion" #define TAG "FuriHalVersion"
#define FURI_HAL_VERSION_OTP_HEADER_MAGIC 0xBABE #define FURI_HAL_VERSION_OTP_HEADER_MAGIC (0xBABE)
#define FURI_HAL_VERSION_OTP_ADDRESS OTP_AREA_BASE #define FURI_HAL_VERSION_OTP_ADDRESS (OTP_AREA_BASE)
#define FURI_HAL_VERSION_DEVICE_ID (0x26u)
/** OTP V0 Structure: prototypes and early EVT */ /** OTP V0 Structure: prototypes and early EVT */
typedef struct { typedef struct {
@@ -107,11 +109,10 @@ static void furi_hal_version_set_name(const char* name) {
// BLE Mac address // BLE Mac address
uint32_t udn = LL_FLASH_GetUDN(); uint32_t udn = LL_FLASH_GetUDN();
uint32_t company_id = LL_FLASH_GetSTCompanyID(); uint32_t company_id = LL_FLASH_GetSTCompanyID();
uint32_t device_id = LL_FLASH_GetDeviceID();
furi_hal_version.ble_mac[0] = (uint8_t)(udn & 0x000000FF); furi_hal_version.ble_mac[0] = (uint8_t)(udn & 0x000000FF);
furi_hal_version.ble_mac[1] = (uint8_t)((udn & 0x0000FF00) >> 8); furi_hal_version.ble_mac[1] = (uint8_t)((udn & 0x0000FF00) >> 8);
furi_hal_version.ble_mac[2] = (uint8_t)((udn & 0x00FF0000) >> 16); furi_hal_version.ble_mac[2] = (uint8_t)((udn & 0x00FF0000) >> 16);
furi_hal_version.ble_mac[3] = (uint8_t)device_id; furi_hal_version.ble_mac[3] = FURI_HAL_VERSION_DEVICE_ID;
furi_hal_version.ble_mac[4] = (uint8_t)(company_id & 0x000000FF); furi_hal_version.ble_mac[4] = (uint8_t)(company_id & 0x000000FF);
furi_hal_version.ble_mac[5] = (uint8_t)((company_id & 0x0000FF00) >> 8); furi_hal_version.ble_mac[5] = (uint8_t)((company_id & 0x0000FF00) >> 8);
} }