New settings to support the new state machine.
This commit is contained in:
parent
8eb3ed2996
commit
7bf8f47e90
14 changed files with 184 additions and 45 deletions
|
@ -6,14 +6,15 @@
|
|||
* /_/ |_|/_/ \__,_/\__, / /____/\____/\__,_/_/ \___/\___/ \____/\____/\__,_/\___/
|
||||
* /____/
|
||||
*
|
||||
* 🃞 THIS FILE IS PART OF THE KTAG SOURCE CODE. Visit https://ktag.clubk.club/ for more. 🃞
|
||||
* This file is part of the KTag project, a DIY laser tag game with customizable features and wide interoperability.
|
||||
* 🛡️ <https://ktag.clubk.club> 🃞
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief [Autogenerated] This file defines the External EEPROM entries.
|
||||
*
|
||||
* \note AUTOGENERATED: This file was generated automatically on Friday, April 28, 2023 at 11:31:31 AM.
|
||||
* \note AUTOGENERATED: This file was generated automatically on Saturday, March 1, 2025 at 08:52:44 AM.
|
||||
* DO NOT MODIFY THIS FILE MANUALLY!
|
||||
*/
|
||||
|
||||
|
@ -102,18 +103,28 @@ static const NVM_Game_Settings_T DEFAULT_Game_Settings =
|
|||
{
|
||||
//! Selected weapon.
|
||||
.Weapon_ID = LASER_X_ID,
|
||||
//! Player identification (is this used?)
|
||||
//! Player identification.
|
||||
.Player_ID = 0,
|
||||
//! Selected team.
|
||||
.Team_ID = 1,
|
||||
//! Maximum health.
|
||||
.Max_Health = 100,
|
||||
//! Number of special weapons regained upon reentry to the game.
|
||||
.N_Special_Weapons_On_Reentry = 1,
|
||||
//! Time in milliseconds between instigating a game and when the countdown begins.
|
||||
.T_Start_Game_in_ms = 30000,
|
||||
//! Duration of the game in milliseconds.
|
||||
.T_Game_Length_in_ms = 600000,
|
||||
//! Color representing the player, rather than the team.
|
||||
.Secondary_Color = 0,
|
||||
};
|
||||
|
||||
NVM_EEPROMEntry_T NVM_Game_Settings =
|
||||
{
|
||||
//! Size == sizeof(NVM_Game_Settings_T)
|
||||
.Size = 3,
|
||||
.Size = 17,
|
||||
.EE_Address = 22,
|
||||
.EE_CRC_Address = 25,
|
||||
.EE_CRC_Address = 39,
|
||||
.Value = (uint8_t *)&RAM_Game_Settings,
|
||||
.Default = (uint8_t *)&DEFAULT_Game_Settings,
|
||||
.State = NVM_STATE_UNINITIALIZED
|
||||
|
@ -130,8 +141,8 @@ NVM_EEPROMEntry_T NVM_Hourmeter =
|
|||
{
|
||||
//! Size == sizeof(NVM_Hourmeter_T)
|
||||
.Size = 2,
|
||||
.EE_Address = 27,
|
||||
.EE_CRC_Address = 29,
|
||||
.EE_Address = 41,
|
||||
.EE_CRC_Address = 43,
|
||||
.Value = (uint8_t *)&RAM_Hourmeter,
|
||||
.Default = (uint8_t *)&DEFAULT_Hourmeter,
|
||||
.State = NVM_STATE_UNINITIALIZED
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
/** \file
|
||||
* \brief [Autogenerated] This file declares the External EEPROM entries.
|
||||
*
|
||||
* \note AUTOGENERATED: This file was generated automatically on Friday, April 28, 2023 at 11:31:31 AM.
|
||||
* \note AUTOGENERATED: This file was generated automatically on Saturday, March 1, 2025 at 08:52:44 AM.
|
||||
* DO NOT MODIFY THIS FILE MANUALLY!
|
||||
*/
|
||||
|
||||
|
@ -60,10 +60,20 @@ typedef struct __attribute__((packed))
|
|||
{
|
||||
//! Selected weapon.
|
||||
uint8_t Weapon_ID;
|
||||
//! Player identification (is this used?)
|
||||
//! Player identification.
|
||||
uint8_t Player_ID;
|
||||
//! Selected team.
|
||||
uint8_t Team_ID;
|
||||
//! Maximum health.
|
||||
uint8_t Max_Health;
|
||||
//! Number of special weapons regained upon reentry to the game.
|
||||
uint8_t N_Special_Weapons_On_Reentry;
|
||||
//! Time in milliseconds between instigating a game and when the countdown begins.
|
||||
uint32_t T_Start_Game_in_ms;
|
||||
//! Duration of the game in milliseconds.
|
||||
uint32_t T_Game_Length_in_ms;
|
||||
//! Color representing the player, rather than the team.
|
||||
uint32_t Secondary_Color;
|
||||
} NVM_Game_Settings_T;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
|
@ -123,6 +133,21 @@ extern const uint8_t NVM_N_EXTERNAL_EEPROM_ENTRIES;
|
|||
#define NVM_TEAM_ID (((NVM_Game_Settings_T*)NVM_Game_Settings.Value)->Team_ID)
|
||||
#define NVM_TEAM_ID_ENTRY_PTR (&NVM_Game_Settings)
|
||||
|
||||
#define NVM_MAX_HEALTH (((NVM_Game_Settings_T*)NVM_Game_Settings.Value)->Max_Health)
|
||||
#define NVM_MAX_HEALTH_ENTRY_PTR (&NVM_Game_Settings)
|
||||
|
||||
#define NVM_N_SPECIAL_WEAPONS_ON_REENTRY (((NVM_Game_Settings_T*)NVM_Game_Settings.Value)->N_Special_Weapons_On_Reentry)
|
||||
#define NVM_N_SPECIAL_WEAPONS_ON_REENTRY_ENTRY_PTR (&NVM_Game_Settings)
|
||||
|
||||
#define NVM_T_START_GAME_IN_MS (((NVM_Game_Settings_T*)NVM_Game_Settings.Value)->T_Start_Game_in_ms)
|
||||
#define NVM_T_START_GAME_IN_MS_ENTRY_PTR (&NVM_Game_Settings)
|
||||
|
||||
#define NVM_T_GAME_LENGTH_IN_MS (((NVM_Game_Settings_T*)NVM_Game_Settings.Value)->T_Game_Length_in_ms)
|
||||
#define NVM_T_GAME_LENGTH_IN_MS_ENTRY_PTR (&NVM_Game_Settings)
|
||||
|
||||
#define NVM_SECONDARY_COLOR (((NVM_Game_Settings_T*)NVM_Game_Settings.Value)->Secondary_Color)
|
||||
#define NVM_SECONDARY_COLOR_ENTRY_PTR (&NVM_Game_Settings)
|
||||
|
||||
#define NVM_HOURMETER_STARTUPS (((NVM_Hourmeter_T*)NVM_Hourmeter.Value)->Hourmeter_Startups)
|
||||
#define NVM_HOURMETER_STARTUPS_ENTRY_PTR (&NVM_Hourmeter)
|
||||
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
* /_/ |_|/_/ \__,_/\__, / /____/\____/\__,_/_/ \___/\___/ \____/\____/\__,_/\___/
|
||||
* /____/
|
||||
*
|
||||
* 🃞 THIS FILE IS PART OF THE KTAG SOURCE CODE. Visit https://ktag.clubk.club/ for more. 🃞
|
||||
* This file is part of the KTag project, a DIY laser tag game with customizable features and wide interoperability.
|
||||
* 🛡️ <https://ktag.clubk.club> 🃞
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief [Autogenerated] This file defines the OnChip EEPROM entries.
|
||||
*
|
||||
* \note AUTOGENERATED: This file was generated automatically on Friday, April 28, 2023 at 11:31:31 AM.
|
||||
* \note AUTOGENERATED: This file was generated automatically on Saturday, March 1, 2025 at 08:52:44 AM.
|
||||
* DO NOT MODIFY THIS FILE MANUALLY!
|
||||
*/
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
/** \file
|
||||
* \brief [Autogenerated] This file declares the OnChip EEPROM entries.
|
||||
*
|
||||
* \note AUTOGENERATED: This file was generated automatically on Friday, April 28, 2023 at 11:31:31 AM.
|
||||
* \note AUTOGENERATED: This file was generated automatically on Saturday, March 1, 2025 at 08:52:44 AM.
|
||||
* DO NOT MODIFY THIS FILE MANUALLY!
|
||||
*/
|
||||
|
||||
|
|
|
@ -33,6 +33,14 @@ SystemKResult_T SETTINGS_get_uint8_t(SystemKSettingID_T id, uint8_t * value)
|
|||
*value = NVM_WEAPON_ID;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_MAX_HEALTH:
|
||||
*value = NVM_MAX_HEALTH;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_N_SPECIAL_WEAPONS_ON_REENTRY:
|
||||
*value = NVM_N_SPECIAL_WEAPONS_ON_REENTRY;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
break;
|
||||
|
@ -67,6 +75,14 @@ SystemKResult_T SETTINGS_set_uint8_t(SystemKSettingID_T id, uint8_t value)
|
|||
NVM_WEAPON_ID = value;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_MAX_HEALTH:
|
||||
NVM_MAX_HEALTH = value;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_N_SPECIAL_WEAPONS_ON_REENTRY:
|
||||
NVM_N_SPECIAL_WEAPONS_ON_REENTRY = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = SYSTEMK_RESULT_WRONG_DATATYPE;
|
||||
break;
|
||||
|
@ -82,7 +98,15 @@ SystemKResult_T SETTINGS_get_uint32_t(SystemKSettingID_T id, uint32_t * value)
|
|||
switch (id)
|
||||
{
|
||||
case SYSTEMK_SETTING_T_START_GAME_in_ms:
|
||||
*value = CONFIG_KTAG_T_DEFAULT_START_GAME_in_ms;
|
||||
*value = NVM_T_START_GAME_IN_MS;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_T_GAME_LENGTH_in_ms:
|
||||
*value = NVM_T_GAME_LENGTH_IN_MS;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_SECONDARY_COLOR:
|
||||
*value = NVM_SECONDARY_COLOR;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -100,7 +124,15 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
|
|||
switch (id)
|
||||
{
|
||||
case SYSTEMK_SETTING_T_START_GAME_in_ms:
|
||||
result = SYSTEMK_RESULT_NOT_IMPLEMENTED;
|
||||
NVM_T_START_GAME_IN_MS = value;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_T_GAME_LENGTH_in_ms:
|
||||
NVM_T_GAME_LENGTH_IN_MS = value;
|
||||
break;
|
||||
|
||||
case SYSTEMK_SETTING_SECONDARY_COLOR:
|
||||
NVM_SECONDARY_COLOR = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue