Pulled in the latest SystemK (with new BLE). (#1)

The new spec is here: [KTag Beacon Specification v0.11](https://ktag.clubk.club/Technology/BLE/KTag%20Beacon%20Specification%20v0.11.pdf)

Co-authored-by: Joe Kearney <joe@clubk.club>
Reviewed-on: #1
This commit is contained in:
Joe Kearney 2025-06-08 22:21:17 +00:00
parent dac4af8d25
commit e8dda3f16a
18 changed files with 274 additions and 47 deletions

Binary file not shown.

View file

@ -1654,6 +1654,20 @@
<build_action v="HEADER;CortexM4;CortexM4;;" />
<PropertyDeltas />
</CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b>
<CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtFileSerialize" version="3" xml_contents_version="1">
<CyGuid_31768f72-0253-412b-af77-e7dba74d1330 type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtItemSerialize" version="2" name="BLE_Utils.c" persistent="SystemK\BLE\BLE_Utils.c">
<Hidden v="False" />
</CyGuid_31768f72-0253-412b-af77-e7dba74d1330>
<build_action v="SOURCE_C;CortexM4;CortexM4;;" />
<PropertyDeltas />
</CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b>
<CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtFileSerialize" version="3" xml_contents_version="1">
<CyGuid_31768f72-0253-412b-af77-e7dba74d1330 type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtItemSerialize" version="2" name="BLE_Utils.h" persistent="SystemK\BLE\BLE_Utils.h">
<Hidden v="False" />
</CyGuid_31768f72-0253-412b-af77-e7dba74d1330>
<build_action v="HEADER;CortexM4;CortexM4;;" />
<PropertyDeltas />
</CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b>
</dependencies>
</CyGuid_0820c2e7-528d-4137-9a08-97257b946089>
</CyGuid_2f73275c-45bf-46ba-b3b1-00a2fe0c8dd8>

View file

@ -241,7 +241,7 @@ void COMM_BLE_Task(void * pvParameters)
}
break;
case COMM_BLE_SCANNING_AND_ADVERTISING:
case COMM_BLE_SCANNING_AND_ADVERTISING:
{
TRACE_BLE_STATE_ENTRY("COMM_BLE_SCANNING_AND_ADVERTISING");
@ -332,6 +332,14 @@ SystemKResult_T BLE_ScanAndAdvertise(void)
return SYSTEMK_RESULT_SUCCESS;
}
SystemKResult_T BLE_StopAdvertising(void)
{
COMM_BLE_Command_T command = { .ID = COMM_BLE_STOP_ADVERTISING, .Data = (void *)0x00 };
xQueueSend(COMM_BLE_CommandQueue, &command, 0);
return SYSTEMK_RESULT_SUCCESS;
}
void COMM_BLE_RequestState(COMM_BLE_StateID_T state)
{
Next_State = state;

View file

@ -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

View file

@ -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)

View file

@ -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!
*/

View file

@ -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!
*/

View file

@ -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;
@ -81,8 +97,20 @@ SystemKResult_T SETTINGS_get_uint32_t(SystemKSettingID_T id, uint32_t * value)
switch (id)
{
case SYSTEMK_SETTING_DEVICE_TYPE:
*value = 1; // 2020TPC
break;
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:
@ -99,9 +127,21 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
switch (id)
{
case SYSTEMK_SETTING_T_START_GAME_in_ms:
case SYSTEMK_SETTING_DEVICE_TYPE:
result = SYSTEMK_RESULT_NOT_IMPLEMENTED;
break;
case SYSTEMK_SETTING_T_START_GAME_in_ms:
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:
result = SYSTEMK_RESULT_WRONG_DATATYPE;
@ -111,6 +151,20 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
return result;
}
SystemKResult_T SETTINGS_get_device_name(char* name)
{
static char device_name[] = "Another 2020TPC";
strncpy(name, device_name, sizeof(device_name));
return SYSTEMK_RESULT_SUCCESS;
}
SystemKResult_T SETTINGS_set_device_name(char* name)
{
return SYSTEMK_RESULT_NOT_IMPLEMENTED;
}
SystemKResult_T SETTINGS_Save(void)
{
#if (CONFIG__HAS_EXTERNAL_NVM)

@ -1 +1 @@
Subproject commit 4fe072f2d3280b19aa53e197bd22ec44b174ff88
Subproject commit bfcdf4c354ae6c96165e11e2fd6d52d0c8ab91eb

View file

@ -1839,6 +1839,20 @@
<build_action v="HEADER;CortexM4;CortexM4;;" />
<PropertyDeltas />
</CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b>
<CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtFileSerialize" version="3" xml_contents_version="1">
<CyGuid_31768f72-0253-412b-af77-e7dba74d1330 type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtItemSerialize" version="2" name="BLE_Utils.c" persistent="SystemK\BLE\BLE_Utils.c">
<Hidden v="False" />
</CyGuid_31768f72-0253-412b-af77-e7dba74d1330>
<build_action v="SOURCE_C;CortexM4;CortexM4;;" />
<PropertyDeltas />
</CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b>
<CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtFileSerialize" version="3" xml_contents_version="1">
<CyGuid_31768f72-0253-412b-af77-e7dba74d1330 type_name="CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtItemSerialize" version="2" name="BLE_Utils.h" persistent="SystemK\BLE\BLE_Utils.h">
<Hidden v="False" />
</CyGuid_31768f72-0253-412b-af77-e7dba74d1330>
<build_action v="HEADER;CortexM4;CortexM4;;" />
<PropertyDeltas />
</CyGuid_8b8ab257-35d3-4473-b57b-36315200b38b>
</dependencies>
</CyGuid_0820c2e7-528d-4137-9a08-97257b946089>
</CyGuid_2f73275c-45bf-46ba-b3b1-00a2fe0c8dd8>

View file

@ -241,7 +241,7 @@ void COMM_BLE_Task(void * pvParameters)
}
break;
case COMM_BLE_SCANNING_AND_ADVERTISING:
case COMM_BLE_SCANNING_AND_ADVERTISING:
{
TRACE_BLE_STATE_ENTRY("COMM_BLE_SCANNING_AND_ADVERTISING");
@ -332,6 +332,14 @@ SystemKResult_T BLE_ScanAndAdvertise(void)
return SYSTEMK_RESULT_SUCCESS;
}
SystemKResult_T BLE_StopAdvertising(void)
{
COMM_BLE_Command_T command = { .ID = COMM_BLE_STOP_ADVERTISING, .Data = (void *)0x00 };
xQueueSend(COMM_BLE_CommandQueue, &command, 0);
return SYSTEMK_RESULT_SUCCESS;
}
void COMM_BLE_RequestState(COMM_BLE_StateID_T state)
{
Next_State = state;

View file

@ -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

View file

@ -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)

View file

@ -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!
*/

View file

@ -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!
*/

View file

@ -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;
@ -81,8 +97,20 @@ SystemKResult_T SETTINGS_get_uint32_t(SystemKSettingID_T id, uint32_t * value)
switch (id)
{
case SYSTEMK_SETTING_DEVICE_TYPE:
*value = 1; // 2020TPC
break;
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:
@ -99,9 +127,21 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
switch (id)
{
case SYSTEMK_SETTING_T_START_GAME_in_ms:
case SYSTEMK_SETTING_DEVICE_TYPE:
result = SYSTEMK_RESULT_NOT_IMPLEMENTED;
break;
case SYSTEMK_SETTING_T_START_GAME_in_ms:
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:
result = SYSTEMK_RESULT_WRONG_DATATYPE;
@ -111,6 +151,20 @@ SystemKResult_T SETTINGS_set_uint32_t(SystemKSettingID_T id, uint32_t value)
return result;
}
SystemKResult_T SETTINGS_get_device_name(char* name)
{
static char device_name[] = "Another 2020TPC";
strncpy(name, device_name, sizeof(device_name));
return SYSTEMK_RESULT_SUCCESS;
}
SystemKResult_T SETTINGS_set_device_name(char* name)
{
return SYSTEMK_RESULT_NOT_IMPLEMENTED;
}
SystemKResult_T SETTINGS_Save(void)
{
#if (CONFIG__HAS_EXTERNAL_NVM)

@ -1 +1 @@
Subproject commit 4fe072f2d3280b19aa53e197bd22ec44b174ff88
Subproject commit bfcdf4c354ae6c96165e11e2fd6d52d0c8ab91eb

View file

@ -18,7 +18,7 @@ import openpyxl
APP_NAME = "KTag Autocode Generator"
__author__ = "Joe Kearney"
__version__ = "00.02"
__version__ = "00.03"
NVM_SPREADSHEET_FILENAME = "2020TPC Nonvolatile Memory.xlsx"
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
@ -164,17 +164,17 @@ def generate_NVM_autocode():
with codecs.open('NVM_' + location + 'EEPROMEntries.h', 'w', "utf-8") as f:
f.write("/*\n")
f.write(
" * __ ________ _____ ______ __ \n")
r" * __ ________ _____ ______ __ " + "\n")
f.write(
" * / //_/_ __/___ _____ _ / ___/____ __ _______________ / ____/___ ____/ /__ \n")
r" * / //_/_ __/___ _____ _ / ___/____ __ _______________ / ____/___ ____/ /__ " + "\n")
f.write(
" * / ,< / / / __ `/ __ `/ \__ \/ __ \/ / / / ___/ ___/ _ \ / / / __ \/ __ / _ \ \n")
r" * / ,< / / / __ `/ __ `/ \__ \/ __ \/ / / / ___/ ___/ _ \ / / / __ \/ __ / _ \ " + "\n")
f.write(
" * / /| | / / / /_/ / /_/ / ___/ / /_/ / /_/ / / / /__/ __/ / /___/ /_/ / /_/ / __/ \n")
r" * / /| | / / / /_/ / /_/ / ___/ / /_/ / /_/ / / / /__/ __/ / /___/ /_/ / /_/ / __/ " + "\n")
f.write(
" * /_/ |_|/_/ \__,_/\__, / /____/\____/\__,_/_/ \___/\___/ \____/\____/\__,_/\___/ \n")
r" * /_/ |_|/_/ \__,_/\__, / /____/\____/\__,_/_/ \___/\___/ \____/\____/\__,_/\___/ " + "\n")
f.write(
" * /____/ \n")
r" * /____/ " + "\n")
f.write(" *\n")
f.write(
" * 🃞 THIS FILE IS PART OF THE KTAG SOURCE CODE. Visit https://ktag.clubk.club/ for more. 🃞\n")
@ -259,20 +259,21 @@ def generate_NVM_autocode():
with codecs.open('NVM_' + location + 'EEPROMEntries.c', 'w', "utf-8") as f:
f.write("/*\n")
f.write(
" * __ ________ _____ ______ __ \n")
r" * __ ________ _____ ______ __ " + "\n")
f.write(
" * / //_/_ __/___ _____ _ / ___/____ __ _______________ / ____/___ ____/ /__ \n")
r" * / //_/_ __/___ _____ _ / ___/____ __ _______________ / ____/___ ____/ /__ " + "\n")
f.write(
" * / ,< / / / __ `/ __ `/ \__ \/ __ \/ / / / ___/ ___/ _ \ / / / __ \/ __ / _ \ \n")
r" * / ,< / / / __ `/ __ `/ \__ \/ __ \/ / / / ___/ ___/ _ \ / / / __ \/ __ / _ \ " + "\n")
f.write(
" * / /| | / / / /_/ / /_/ / ___/ / /_/ / /_/ / / / /__/ __/ / /___/ /_/ / /_/ / __/ \n")
r" * / /| | / / / /_/ / /_/ / ___/ / /_/ / /_/ / / / /__/ __/ / /___/ /_/ / /_/ / __/ " + "\n")
f.write(
" * /_/ |_|/_/ \__,_/\__, / /____/\____/\__,_/_/ \___/\___/ \____/\____/\__,_/\___/ \n")
r" * /_/ |_|/_/ \__,_/\__, / /____/\____/\__,_/_/ \___/\___/ \____/\____/\__,_/\___/ " + "\n")
f.write(
" * /____/ \n")
r" * /____/ " + "\n")
f.write(" *\n")
f.write(" * This file is part of the KTag project, a DIY laser tag game with customizable features and wide interoperability.\n")
f.write(
" * 🃞 THIS FILE IS PART OF THE KTAG SOURCE CODE. Visit https://ktag.clubk.club/ for more. 🃞\n")
" * 🛡️ <https://ktag.clubk.club> 🃞\n")
f.write(" *\n")
f.write(" */\n")
@ -294,7 +295,7 @@ def generate_NVM_autocode():
f.write('\n')
f.write('/* EEPROM Entries */\n')
f.write('\n')
f.write('/** \defgroup NVM_' + location.upper() +
f.write(r'/** \defgroup NVM_' + location.upper() +
'_EEPROM NVM ' + location + ' EEPROM\n')
f.write(' *\n')
f.write(' * The ' + location +