[FL-1430] ApiHal: add regions and colors enums #597

This commit is contained in:
あく 2021-07-22 12:44:52 +03:00 committed by GitHub
parent ac8387e372
commit a81203941b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 6 deletions

View file

@ -9,6 +9,21 @@
extern "C" {
#endif
/** Device Colors */
typedef enum {
ApiHalVersionColorUnknown=0x00,
ApiHalVersionColorBlack=0x01,
ApiHalVersionColorWhite=0x02,
} ApiHalVersionColor;
/** Device Regions */
typedef enum {
ApiHalVersionRegionUnknown=0x00,
ApiHalVersionRegionEuRu=0x01,
ApiHalVersionRegionUsCaAu=0x02,
ApiHalVersionRegionJp=0x03,
} ApiHalVersionRegion;
/** Init flipper version */
void api_hal_version_init();
@ -28,13 +43,13 @@ const uint8_t api_hal_version_get_hw_target();
const uint8_t api_hal_version_get_hw_body();
/** Get hardware body color */
const uint8_t api_hal_version_get_hw_color();
const ApiHalVersionColor api_hal_version_get_hw_color();
/** Get hardware connect */
const uint8_t api_hal_version_get_hw_connect();
/** Get hardware region */
const uint8_t api_hal_version_get_hw_region();
const ApiHalVersionRegion api_hal_version_get_hw_region();
/** Get hardware timestamp */
const uint32_t api_hal_version_get_hw_timestamp();

View file

@ -187,7 +187,7 @@ const uint8_t api_hal_version_get_hw_body() {
return api_hal_version.board_body;
}
const uint8_t api_hal_version_get_hw_color() {
const ApiHalVersionColor api_hal_version_get_hw_color() {
return api_hal_version.board_color;
}
@ -195,7 +195,7 @@ const uint8_t api_hal_version_get_hw_connect() {
return api_hal_version.board_connect;
}
const uint8_t api_hal_version_get_hw_region() {
const ApiHalVersionRegion api_hal_version_get_hw_region() {
return api_hal_version.board_region;
}

View file

@ -20,8 +20,9 @@ OTP_COLORS = {
}
OTP_REGIONS = {
"unknown": 0x00,
"europe": 0x01,
"usa": 0x02,
"eu_ru": 0x01,
"us_ca_au": 0x02,
"jp": 0x03,
}
BOARD_RESERVED = 0x0000