Demo code: add static modifiers (#1373)
CI Checks / git-secrets (push) Has been cancelled
CI Checks / formatting (push) Has been cancelled
CI Checks / spell-check (push) Has been cancelled
CI Checks / doxygen (push) Has been cancelled
CI Checks / verify-manifest (push) Has been cancelled
CI Checks / memory-statistics (push) Has been cancelled
CI Checks / proof_ci (push) Has been cancelled
FreeRTOS Demos / WIN32 MSVC (push) Has been cancelled
FreeRTOS Demos / WIN32 MingW (push) Has been cancelled
FreeRTOS Demos / Posix GCC (push) Has been cancelled
FreeRTOS Demos / GNU MSP430 Toolchain (push) Has been cancelled
FreeRTOS Demos / GNU ARM Toolchain (push) Has been cancelled
FreeRTOS MPU Demo / TI-Hercules RM46 and RM57 MPU Demos (push) Has been cancelled
Build FreeRTOS+ Demos / Windows Simulator Cellular Demos (push) Has been cancelled
Build FreeRTOS+ Demos / coreHTTP WinSim Demos (push) Has been cancelled
Build FreeRTOS+ Demos / corePKCS11 WinSim Demos (push) Has been cancelled
Build FreeRTOS+ Demos / core Library Windows Simulator Demos (push) Has been cancelled
Build FreeRTOS+ Demos / AWS IoT Windows Simulator Demos (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+TCP Posix Simulator Demo (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+TCP QEMU ARM MPS2 AN385 (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+TCP Windows Simulator Demos (push) Has been cancelled
Build FreeRTOS+ Demos / FreeRTOS+CLI Windows Simulator Demos (push) Has been cancelled
Kernel Unit Tests / FreeRTOS/Source Submodule Revision (push) Has been cancelled
Kernel Unit Tests / FreeRTOS-Kernel Main Branch (push) Has been cancelled

Add "static" modifier to demo code to reduce global vars.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
This commit is contained in:
Florian La Roche
2025-09-17 10:57:53 +05:30
committed by GitHub
parent 62195136d1
commit bcef9d066a
9 changed files with 10 additions and 13 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ static portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;
static portBASE_TYPE xPriorityRaiseWhenSuspendedError = pdFALSE;
/* Queue used by the second test. */
QueueHandle_t xSuspendedTestQueue;
static QueueHandle_t xSuspendedTestQueue;
/*-----------------------------------------------------------*/
+3 -3
View File
@@ -124,13 +124,13 @@
static const char * pcControllingTaskName = "AbtCtrl", * pcBlockingTaskName = "AbtBlk";
/* The maximum amount of time a task will block for. */
const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 100 );
const TickType_t xHalfMaxBlockTime = pdMS_TO_TICKS( 50 );
static const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 100 );
static const TickType_t xHalfMaxBlockTime = pdMS_TO_TICKS( 50 );
/* The actual block time is dependent on the priority of other tasks in the
* system so the actual block time might be greater than that expected, but it
* should be within an acceptable upper bound. */
const TickType_t xAllowableMargin = pdMS_TO_TICKS( 7 );
static const TickType_t xAllowableMargin = pdMS_TO_TICKS( 7 );
/*-----------------------------------------------------------*/
@@ -78,9 +78,6 @@
/* A block time of zero simply means "don't block". */
#define ebDONT_BLOCK ( 0 )
/* A 5ms delay. */
#define ebSHORT_DELAY pdMS_TO_TICKS( ( TickType_t ) 5 )
/* Used in the selective bits test which checks no, one or both tasks blocked on
* event bits in a group are unblocked as appropriate as different bits get set. */
#define ebSELECTIVE_BITS_1 0x03
+1 -1
View File
@@ -123,7 +123,7 @@ static SemaphoreHandle_t xMasterSlaveMutex = NULL;
static BaseType_t xOkToGiveMutex = pdFALSE, xOkToGiveCountingSemaphore = pdFALSE;
/* Used to coordinate timing between tasks and the interrupt. */
const TickType_t xInterruptGivePeriod = pdMS_TO_TICKS( intsemINTERRUPT_MUTEX_GIVE_PERIOD_MS );
static const TickType_t xInterruptGivePeriod = pdMS_TO_TICKS( intsemINTERRUPT_MUTEX_GIVE_PERIOD_MS );
/*-----------------------------------------------------------*/
@@ -121,7 +121,7 @@ static uint32_t ulCycleCounters[ mbaNUMBER_OF_CORE_B_TASKS ];
/* Set to pdFALSE if any errors are detected. Used to inform the check task
* that something might be wrong. */
BaseType_t xDemoStatus = pdPASS;
static BaseType_t xDemoStatus = pdPASS;
/*-----------------------------------------------------------*/
+1 -1
View File
@@ -74,7 +74,7 @@ static volatile BaseType_t xErrorDetected = pdFALSE;
static volatile uint32_t ulLoopCounter = 0;
/* Handles to the test tasks. */
TaskHandle_t xMediumPriorityTask, xHighPriorityTask, xHighestPriorityTask;
static TaskHandle_t xMediumPriorityTask, xHighPriorityTask, xHighestPriorityTask;
/*-----------------------------------------------------------*/
void vStartQueuePeekTasks( void )
+1 -1
View File
@@ -203,7 +203,7 @@
static size_t uxNextRand = 0;
/* The task handles are stored so their priorities can be changed. */
TaskHandle_t xQueueSetSendingTask, xQueueSetReceivingTask;
static TaskHandle_t xQueueSetSendingTask, xQueueSetReceivingTask;
/*-----------------------------------------------------------*/
+1 -1
View File
@@ -80,7 +80,7 @@ static const UBaseType_t uxMaxNumberOfExtraTasksRunning = 3;
/* Used to store a handle to the task that should be killed by a suicidal task,
* before it kills itself. */
TaskHandle_t xCreatedTask;
static TaskHandle_t xCreatedTask;
/*-----------------------------------------------------------*/
+1 -1
View File
@@ -133,7 +133,7 @@ static volatile BaseType_t xSuspendedQueueSendError = pdFALSE;
static volatile BaseType_t xSuspendedQueueReceiveError = pdFALSE;
/* Queue used by the second test. */
QueueHandle_t xSuspendedTestQueue;
static QueueHandle_t xSuspendedTestQueue;
/* The value the queue receive task expects to receive next. This is file
* scope so xAreDynamicPriorityTasksStillRunning() can ensure it is still