mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-10-02 16:24:45 +08:00
Add uncrustify github workflow (#659)
* Add uncrustify github workflow * Fix exclusion pattern * fix find expression * exclude uncrustify files * Uncrustify common demo and test files * exlude white space checking files * Fix EOL whitespace checker * Remove whitespaces from EOL * Fix space at EOL * Fix find spaces at EOL Co-authored-by: Archit Aggarwal <architag@amazon.com>
This commit is contained in:
co-authored by
Archit Aggarwal
parent
dd80d615b5
commit
ae92d8c6ee
@@ -17,7 +17,7 @@ If you discover a potential security issue in this project we ask that you notif
|
||||
|
||||
## Submitting a bugs/feature request
|
||||
Have a bug to report or feature to request? Follow these steps:
|
||||
1. Search on the [FreeRTOS Community Support Forums](https://forums.freertos.org/) and [GitHub issue tracker](https://github.com/FreeRTOS/FreeRTOS/issues?utf8=%E2%9C%93&q=is%3Aissue) to be sure this hasn't been already reported or discussed.
|
||||
1. Search on the [FreeRTOS Community Support Forums](https://forums.freertos.org/) and [GitHub issue tracker](https://github.com/FreeRTOS/FreeRTOS/issues?utf8=%E2%9C%93&q=is%3Aissue) to be sure this hasn't been already reported or discussed.
|
||||
2. If your search turns up empty, create a new topic in the [forums](https://forums.freertos.org/) and work with the community to help clarify issues or refine the idea. Include as many of the details listed below.
|
||||
3. Once the community has had time to discuss and digest, we welcome you to create an [issue](https://github.com/FreeRTOS/FreeRTOS/issues) to report bugs or suggest features.
|
||||
|
||||
@@ -43,8 +43,8 @@ To send us a pull request, please:
|
||||
2. Modify the source; focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
|
||||
3. Follow the [coding style guide](https://www.freertos.org/FreeRTOS-Coding-Standard-and-Style-Guide.html).
|
||||
4. Commit to your fork using clear commit messages.
|
||||
5. Send us a pull request, answering any default questions in the pull request interface.
|
||||
NOTE: Please make sure the default option (Allow edits from maintainers) is left checked.
|
||||
5. Send us a pull request, answering any default questions in the pull request interface.
|
||||
NOTE: Please make sure the default option (Allow edits from maintainers) is left checked.
|
||||
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
|
||||
|
||||
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
|
||||
|
||||
@@ -24,7 +24,7 @@ A concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
- Use project ... and configure with ...
|
||||
- Run on ... and could observe ...
|
||||
- Run on ... and could observe ...
|
||||
|
||||
**Expected behavior**
|
||||
A concise description of what you expected to happen.
|
||||
|
||||
@@ -11,7 +11,7 @@ assignees: ''
|
||||
Please describe the issue and expected clarification in concise language.
|
||||
|
||||
**Reference**
|
||||
Please attach the URL at which you are experiencing the issue.
|
||||
Please attach the URL at which you are experiencing the issue.
|
||||
|
||||
**Screenshot**
|
||||
If applicable, please attach screenshot.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security
|
||||
via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com.
|
||||
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security
|
||||
via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com.
|
||||
Please do **not** create a public github issue.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# python >= 3.4
|
||||
# python >= 3.4
|
||||
|
||||
import os
|
||||
from common.header_checker import HeaderChecker
|
||||
|
||||
@@ -211,7 +211,7 @@ def configure_argparser():
|
||||
type = str,
|
||||
default = 'HEAD',
|
||||
help = 'Commit ID of FreeRTOS repo to package')
|
||||
|
||||
|
||||
return parser
|
||||
|
||||
def sanitize_cmd_args(args):
|
||||
@@ -254,13 +254,13 @@ def main():
|
||||
FREERTOS_GIT_LINK,
|
||||
core_package_name,
|
||||
commit_id=args.freertos_commit)
|
||||
|
||||
|
||||
if path_core_out_tree == None:
|
||||
print('Failed to prepare repo for zipping')
|
||||
exit(1);
|
||||
|
||||
|
||||
core_outzip = create_package(path_core_out_tree, core_package_name, RELATIVE_FILE_EXCLUDES)
|
||||
|
||||
|
||||
# Create FreeRTOS-Labs package
|
||||
labs_package_name = 'FreeRTOS-Labs'
|
||||
(path_labs_in_tree, path_labs_out_tree) = create_file_trees(DIR_INPUT_TREES,
|
||||
@@ -271,7 +271,7 @@ def main():
|
||||
if path_labs_out_tree == None:
|
||||
print('Failed to prepare repo for zipping')
|
||||
exit(1);
|
||||
|
||||
|
||||
labs_outzip = create_package(path_labs_out_tree, labs_package_name, LABS_RELATIVE_EXCLUDE_FILES)
|
||||
|
||||
# Package summaries
|
||||
|
||||
@@ -10,7 +10,7 @@ from argparse import ArgumentParser
|
||||
REPO_PATH=''
|
||||
|
||||
# List of submodules excluded from manifest.yml file
|
||||
IGNORE_SUBMODULES_LIST = [
|
||||
IGNORE_SUBMODULES_LIST = [
|
||||
'FreeRTOS-Plus/Test/CMock',
|
||||
'FreeRTOS/Test/CMock/CMock',
|
||||
'FreeRTOS/Test/litani'
|
||||
@@ -19,7 +19,7 @@ IGNORE_SUBMODULES_LIST = [
|
||||
# Obtain submodule path of all entries in manifest.yml file.
|
||||
def read_manifest():
|
||||
path_list = []
|
||||
|
||||
|
||||
# Read YML file
|
||||
path_manifest = os.path.join(REPO_PATH, 'manifest.yml')
|
||||
assert os.path.exists(path_manifest), 'Missing manifest.yml'
|
||||
@@ -53,7 +53,7 @@ def get_all_submodules():
|
||||
path = submodule.abspath.replace(REPO_PATH+'/', '')
|
||||
if path not in IGNORE_SUBMODULES_LIST:
|
||||
path_list.append(path)
|
||||
|
||||
|
||||
return sorted(path_list)
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -69,13 +69,13 @@ if __name__ == '__main__':
|
||||
# Convert any relative path (like './') in passed argument to absolute path.
|
||||
REPO_PATH = os.path.abspath(args.repo_root_path)
|
||||
|
||||
libraries_in_manifest_file = read_manifest()
|
||||
libraries_in_manifest_file = read_manifest()
|
||||
git_submodules_list = get_all_submodules()
|
||||
|
||||
print(REPO_PATH)
|
||||
print(git_submodules_list)
|
||||
|
||||
# Check that manifest.yml contains entries for all submodules
|
||||
# Check that manifest.yml contains entries for all submodules
|
||||
# present in repository.
|
||||
if libraries_in_manifest_file == git_submodules_list:
|
||||
print('Manifest.yml is verified!')
|
||||
|
||||
@@ -24,6 +24,38 @@ jobs:
|
||||
run: |
|
||||
git-secrets --register-aws
|
||||
git-secrets --scan
|
||||
|
||||
formatting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Uncrustify
|
||||
run: sudo apt-get install uncrustify
|
||||
- name: Run Uncrustify
|
||||
run: |
|
||||
uncrustify --version
|
||||
find FreeRTOS/Demo/Common FreeRTOS/Test \( -name ethernet -o -name drivers -o -path 'FreeRTOS/Test/CMock/CMock' \) -prune -false -o -name "*.[hc]" -exec uncrustify --check -c tools/uncrustify.cfg {} +
|
||||
- name: Check For Trailing Whitespace
|
||||
run: |
|
||||
set +e
|
||||
ERROR=0
|
||||
find . \( -name '.git' -o -path "./FreeRTOS/Test/CBMC/patches" -o -path "./FreeRTOS-Plus" -o -path "./FreeRTOS/Source" -o -path "./FreeRTOS/Test/CMock/CMock" -o -path "./FreeRTOS/Demo" \) -prune -false -o -type f -a -name "*" -exec grep -In -e "[[:blank:]]$" {} +
|
||||
if [ "$?" = "0" ]; then
|
||||
echo "Files have trailing whitespace."
|
||||
ERROR=1
|
||||
fi
|
||||
|
||||
find FreeRTOS/Demo/Common \( -name "ethernet" \) -prune -o -false -o -type f -a -name "*" -exec grep --color=yes -In -e "[[:blank:]]$" {} +
|
||||
if [ "$?" = "0" ]; then
|
||||
echo "Files have trailing whitespace."
|
||||
exit 1
|
||||
else
|
||||
if [ "$ERROR" -eq "1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
doxygen:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
@@ -53,7 +85,7 @@ jobs:
|
||||
- name: Upload doxygen artifact if main branch
|
||||
if: success() && ( github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release-candidate' )
|
||||
env:
|
||||
GIT_SHA:
|
||||
GIT_SHA:
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: doxygen.zip-${{ github.sha }}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Ignore MacOS file system related.
|
||||
# Ignore MacOS file system related.
|
||||
**/*.DS_Store*
|
||||
|
||||
# Ignore build results
|
||||
|
||||
@@ -68,6 +68,7 @@ int main()
|
||||
#error "Invalid Selection...\nPlease Select a Demo application from the main command"
|
||||
}
|
||||
#endif /* if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 ) */
|
||||
snprint
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,23 +37,23 @@ static uint32_t ulSecureCounter = 0;
|
||||
/**
|
||||
* @brief typedef for non-secure callback.
|
||||
*/
|
||||
typedef void ( *NonSecureCallback_t ) ( void ) __attribute__( ( cmse_nonsecure_call ) );
|
||||
typedef void ( *NonSecureCallback_t )( void ) __attribute__( ( cmse_nonsecure_call ) );
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
secureportNON_SECURE_CALLABLE uint32_t NSCFunction( Callback_t pxCallback )
|
||||
{
|
||||
NonSecureCallback_t pxNonSecureCallback;
|
||||
NonSecureCallback_t pxNonSecureCallback;
|
||||
|
||||
/* Return function pointer with cleared LSB. */
|
||||
pxNonSecureCallback = ( NonSecureCallback_t ) cmse_nsfptr_create( pxCallback );
|
||||
/* Return function pointer with cleared LSB. */
|
||||
pxNonSecureCallback = ( NonSecureCallback_t ) cmse_nsfptr_create( pxCallback );
|
||||
|
||||
/* Invoke the supplied callback. */
|
||||
pxNonSecureCallback();
|
||||
/* Invoke the supplied callback. */
|
||||
pxNonSecureCallback();
|
||||
|
||||
/* Increment the secure side counter. */
|
||||
ulSecureCounter += 1;
|
||||
/* Increment the secure side counter. */
|
||||
ulSecureCounter += 1;
|
||||
|
||||
/* Return the secure side counter. */
|
||||
return ulSecureCounter;
|
||||
/* Return the secure side counter. */
|
||||
return ulSecureCounter;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
/**
|
||||
* @brief Callback function pointer definition.
|
||||
*/
|
||||
typedef void ( *Callback_t ) ( void );
|
||||
typedef void ( * Callback_t ) ( void );
|
||||
|
||||
/**
|
||||
* @brief Invokes the supplied callback which is on the non-secure side.
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* 4 bytes and upto 32 bytes will also fall in the same MPU region and the task
|
||||
* having access to ulNonSecureCounter will also have access to all those items.
|
||||
*/
|
||||
static uint32_t ulNonSecureCounter[8] __attribute__( ( aligned( 32 ) ) ) = { 0 };
|
||||
static uint32_t ulNonSecureCounter[ 8 ] __attribute__( ( aligned( 32 ) ) ) = { 0 };
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -68,66 +68,67 @@ static void prvSecureCallingTask( void * pvParameters );
|
||||
|
||||
void vStartTZDemo( void )
|
||||
{
|
||||
static StackType_t xSecureCallingTaskStack[ configMINIMAL_STACK_SIZE ] __attribute__( ( aligned( 32 ) ) );
|
||||
TaskParameters_t xSecureCallingTaskParameters =
|
||||
{
|
||||
.pvTaskCode = prvSecureCallingTask,
|
||||
.pcName = "SecCalling",
|
||||
.usStackDepth = configMINIMAL_STACK_SIZE,
|
||||
.pvParameters = NULL,
|
||||
.uxPriority = tskIDLE_PRIORITY,
|
||||
.puxStackBuffer = xSecureCallingTaskStack,
|
||||
.xRegions = {
|
||||
{ ulNonSecureCounter, 32, tskMPU_REGION_READ_WRITE | tskMPU_REGION_EXECUTE_NEVER },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
}
|
||||
};
|
||||
static StackType_t xSecureCallingTaskStack[ configMINIMAL_STACK_SIZE ] __attribute__( ( aligned( 32 ) ) );
|
||||
TaskParameters_t xSecureCallingTaskParameters =
|
||||
{
|
||||
.pvTaskCode = prvSecureCallingTask,
|
||||
.pcName = "SecCalling",
|
||||
.usStackDepth = configMINIMAL_STACK_SIZE,
|
||||
.pvParameters = NULL,
|
||||
.uxPriority = tskIDLE_PRIORITY,
|
||||
.puxStackBuffer = xSecureCallingTaskStack,
|
||||
.xRegions =
|
||||
{
|
||||
{ ulNonSecureCounter, 32, tskMPU_REGION_READ_WRITE | tskMPU_REGION_EXECUTE_NEVER },
|
||||
{ 0, 0, 0 },
|
||||
{ 0, 0, 0 },
|
||||
}
|
||||
};
|
||||
|
||||
/* Create an unprivileged task which calls secure functions. */
|
||||
xTaskCreateRestricted( &( xSecureCallingTaskParameters ), NULL );
|
||||
/* Create an unprivileged task which calls secure functions. */
|
||||
xTaskCreateRestricted( &( xSecureCallingTaskParameters ), NULL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvCallback( void )
|
||||
{
|
||||
/* This function is called from the secure side. Just increment the counter
|
||||
* here. The check that this counter keeps incrementing is performed in the
|
||||
* prvSecureCallingTask. */
|
||||
ulNonSecureCounter[ 0 ] += 1;
|
||||
/* This function is called from the secure side. Just increment the counter
|
||||
* here. The check that this counter keeps incrementing is performed in the
|
||||
* prvSecureCallingTask. */
|
||||
ulNonSecureCounter[ 0 ] += 1;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvSecureCallingTask( void * pvParameters )
|
||||
{
|
||||
uint32_t ulLastSecureCounter = 0, ulLastNonSecureCounter = 0;
|
||||
uint32_t ulCurrentSecureCounter = 0;
|
||||
uint32_t ulLastSecureCounter = 0, ulLastNonSecureCounter = 0;
|
||||
uint32_t ulCurrentSecureCounter = 0;
|
||||
|
||||
/* This task calls secure side functions. So allocate a secure context for
|
||||
* it. */
|
||||
portALLOCATE_SECURE_CONTEXT( configMINIMAL_SECURE_STACK_SIZE );
|
||||
/* This task calls secure side functions. So allocate a secure context for
|
||||
* it. */
|
||||
portALLOCATE_SECURE_CONTEXT( configMINIMAL_SECURE_STACK_SIZE );
|
||||
|
||||
for( ; ; )
|
||||
{
|
||||
/* Call the secure side function. It does two things:
|
||||
* - It calls the supplied function (prvCallback) which in turn
|
||||
* increments the non-secure counter.
|
||||
* - It increments the secure counter and returns the incremented value.
|
||||
* Therefore at the end of this function call both the secure and
|
||||
* non-secure counters must have been incremented.
|
||||
*/
|
||||
ulCurrentSecureCounter = NSCFunction( prvCallback );
|
||||
for( ; ; )
|
||||
{
|
||||
/* Call the secure side function. It does two things:
|
||||
* - It calls the supplied function (prvCallback) which in turn
|
||||
* increments the non-secure counter.
|
||||
* - It increments the secure counter and returns the incremented value.
|
||||
* Therefore at the end of this function call both the secure and
|
||||
* non-secure counters must have been incremented.
|
||||
*/
|
||||
ulCurrentSecureCounter = NSCFunction( prvCallback );
|
||||
|
||||
/* Make sure that both the counters are incremented. */
|
||||
configASSERT( ulCurrentSecureCounter == ulLastSecureCounter + 1 );
|
||||
configASSERT( ulNonSecureCounter[ 0 ] == ulLastNonSecureCounter + 1 );
|
||||
/* Make sure that both the counters are incremented. */
|
||||
configASSERT( ulCurrentSecureCounter == ulLastSecureCounter + 1 );
|
||||
configASSERT( ulNonSecureCounter[ 0 ] == ulLastNonSecureCounter + 1 );
|
||||
|
||||
/* Update the last values for both the counters. */
|
||||
ulLastSecureCounter = ulCurrentSecureCounter;
|
||||
ulLastNonSecureCounter = ulNonSecureCounter[ 0 ];
|
||||
/* Update the last values for both the counters. */
|
||||
ulLastSecureCounter = ulCurrentSecureCounter;
|
||||
ulLastNonSecureCounter = ulNonSecureCounter[ 0 ];
|
||||
|
||||
/* Wait for a second. */
|
||||
vTaskDelay( pdMS_TO_TICKS( 1000 ) );
|
||||
}
|
||||
/* Wait for a second. */
|
||||
vTaskDelay( pdMS_TO_TICKS( 1000 ) );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
+193
-193
File diff suppressed because it is too large
Load Diff
+125
-123
File diff suppressed because it is too large
Load Diff
+224
-219
File diff suppressed because it is too large
Load Diff
@@ -25,17 +25,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a single persistent task which periodically dynamically creates another
|
||||
* four tasks. The original task is called the creator task, the four tasks it
|
||||
* Create a single persistent task which periodically dynamically creates another
|
||||
* four tasks. The original task is called the creator task, the four tasks it
|
||||
* creates are called suicidal tasks.
|
||||
*
|
||||
* Two of the created suicidal tasks kill one other suicidal task before killing
|
||||
* themselves - leaving just the original task remaining.
|
||||
* Two of the created suicidal tasks kill one other suicidal task before killing
|
||||
* themselves - leaving just the original task remaining.
|
||||
*
|
||||
* The creator task must be spawned after all of the other demo application tasks
|
||||
* as it keeps a check on the number of tasks under the scheduler control. The
|
||||
* number of tasks it expects to see running should never be greater than the
|
||||
* number of tasks that were in existence when the creator task was spawned, plus
|
||||
* The creator task must be spawned after all of the other demo application tasks
|
||||
* as it keeps a check on the number of tasks under the scheduler control. The
|
||||
* number of tasks it expects to see running should never be greater than the
|
||||
* number of tasks that were in existence when the creator task was spawned, plus
|
||||
* one set of four suicidal tasks. If this number is exceeded an error is flagged.
|
||||
*
|
||||
* \page DeathC death.c
|
||||
@@ -44,11 +44,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
* Changes from V2.0.0
|
||||
*
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
+ TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -60,66 +60,66 @@ Changes from V2.0.0
|
||||
#include "death.h"
|
||||
#include "print.h"
|
||||
|
||||
#define deathSTACK_SIZE ( ( unsigned short ) 512 )
|
||||
#define deathSTACK_SIZE ( ( unsigned short ) 512 )
|
||||
|
||||
/* The task originally created which is responsible for periodically dynamically
|
||||
creating another four tasks. */
|
||||
static void vCreateTasks( void *pvParameters );
|
||||
/* The task originally created which is responsible for periodically dynamically
|
||||
* creating another four tasks. */
|
||||
static void vCreateTasks( void * pvParameters );
|
||||
|
||||
/* The task function of the dynamically created tasks. */
|
||||
static void vSuicidalTask( void *pvParameters );
|
||||
static void vSuicidalTask( void * pvParameters );
|
||||
|
||||
/* A variable which is incremented every time the dynamic tasks are created. This
|
||||
is used to check that the task is still running. */
|
||||
/* A variable which is incremented every time the dynamic tasks are created. This
|
||||
* is used to check that the task is still running. */
|
||||
static volatile short sCreationCount = 0;
|
||||
|
||||
/* Used to store the number of tasks that were originally running so the creator
|
||||
task can tell if any of the suicidal tasks have failed to die. */
|
||||
/* Used to store the number of tasks that were originally running so the creator
|
||||
* task can tell if any of the suicidal tasks have failed to die. */
|
||||
static volatile unsigned portBASE_TYPE uxTasksRunningAtStart = 0;
|
||||
static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 5;
|
||||
|
||||
/* Used to store a handle to the tasks that should be killed by a suicidal task,
|
||||
before it kills itself. */
|
||||
/* Used to store a handle to the tasks that should be killed by a suicidal task,
|
||||
* before it kills itself. */
|
||||
TaskHandle_t xCreatedTask1, xCreatedTask2;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vCreateSuicidalTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
unsigned portBASE_TYPE *puxPriority;
|
||||
unsigned portBASE_TYPE * puxPriority;
|
||||
|
||||
/* Create the Creator tasks - passing in as a parameter the priority at which
|
||||
the suicidal tasks should be created. */
|
||||
/* Create the Creator tasks - passing in as a parameter the priority at which
|
||||
* the suicidal tasks should be created. */
|
||||
puxPriority = ( unsigned portBASE_TYPE * ) pvPortMalloc( sizeof( unsigned portBASE_TYPE ) );
|
||||
*puxPriority = uxPriority;
|
||||
|
||||
xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );
|
||||
|
||||
/* Record the number of tasks that are running now so we know if any of the
|
||||
suicidal tasks have failed to be killed. */
|
||||
/* Record the number of tasks that are running now so we know if any of the
|
||||
* suicidal tasks have failed to be killed. */
|
||||
uxTasksRunningAtStart = uxTaskGetNumberOfTasks();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void vSuicidalTask( void *pvParameters )
|
||||
static void vSuicidalTask( void * pvParameters )
|
||||
{
|
||||
portDOUBLE d1, d2;
|
||||
TaskHandle_t xTaskToKill;
|
||||
const TickType_t xDelay = ( TickType_t ) 500 / portTICK_PERIOD_MS;
|
||||
portDOUBLE d1, d2;
|
||||
TaskHandle_t xTaskToKill;
|
||||
const TickType_t xDelay = ( TickType_t ) 500 / portTICK_PERIOD_MS;
|
||||
|
||||
if( pvParameters != NULL )
|
||||
{
|
||||
/* This task is periodically created four times. Tow created tasks are
|
||||
passed a handle to the other task so it can kill it before killing itself.
|
||||
The other task is passed in null. */
|
||||
xTaskToKill = *( TaskHandle_t* )pvParameters;
|
||||
/* This task is periodically created four times. Tow created tasks are
|
||||
* passed a handle to the other task so it can kill it before killing itself.
|
||||
* The other task is passed in null. */
|
||||
xTaskToKill = *( TaskHandle_t * ) pvParameters;
|
||||
}
|
||||
else
|
||||
{
|
||||
xTaskToKill = NULL;
|
||||
}
|
||||
|
||||
for( ;; )
|
||||
for( ; ; )
|
||||
{
|
||||
/* Do something random just to use some stack and registers. */
|
||||
d1 = 2.4;
|
||||
@@ -137,14 +137,14 @@ const TickType_t xDelay = ( TickType_t ) 500 / portTICK_PERIOD_MS;
|
||||
vTaskDelete( NULL );
|
||||
}
|
||||
}
|
||||
}/*lint !e818 !e550 Function prototype must be as per standard for task functions. */
|
||||
} /*lint !e818 !e550 Function prototype must be as per standard for task functions. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void vCreateTasks( void *pvParameters )
|
||||
static void vCreateTasks( void * pvParameters )
|
||||
{
|
||||
const TickType_t xDelay = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
unsigned portBASE_TYPE uxPriority;
|
||||
const char * const pcTaskStartMsg = "Create task started.\r\n";
|
||||
const TickType_t xDelay = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
unsigned portBASE_TYPE uxPriority;
|
||||
const char * const pcTaskStartMsg = "Create task started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
@@ -152,7 +152,7 @@ const char * const pcTaskStartMsg = "Create task started.\r\n";
|
||||
uxPriority = *( unsigned portBASE_TYPE * ) pvParameters;
|
||||
vPortFree( pvParameters );
|
||||
|
||||
for( ;; )
|
||||
for( ; ; )
|
||||
{
|
||||
/* Just loop round, delaying then creating the four suicidal tasks. */
|
||||
vTaskDelay( xDelay );
|
||||
@@ -168,18 +168,19 @@ const char * const pcTaskStartMsg = "Create task started.\r\n";
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* This is called to check that the creator task is still running and that there
|
||||
are not any more than four extra tasks. */
|
||||
/* This is called to check that the creator task is still running and that there
|
||||
* are not any more than four extra tasks. */
|
||||
portBASE_TYPE xIsCreateTaskStillRunning( void )
|
||||
{
|
||||
static short sLastCreationCount = 0;
|
||||
short sReturn = pdTRUE;
|
||||
unsigned portBASE_TYPE uxTasksRunningNow;
|
||||
static short sLastCreationCount = 0;
|
||||
short sReturn = pdTRUE;
|
||||
unsigned portBASE_TYPE uxTasksRunningNow;
|
||||
|
||||
if( sLastCreationCount == sCreationCount )
|
||||
{
|
||||
sReturn = pdFALSE;
|
||||
}
|
||||
|
||||
sLastCreationCount = sCreationCount;
|
||||
|
||||
uxTasksRunningNow = uxTaskGetNumberOfTasks();
|
||||
@@ -199,5 +200,3 @@ unsigned portBASE_TYPE uxTasksRunningNow;
|
||||
|
||||
return sReturn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+347
-350
File diff suppressed because it is too large
Load Diff
+235
-234
File diff suppressed because it is too large
Load Diff
@@ -27,13 +27,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* Creates eight tasks, each of which flash an LED at a different rate. The first
|
||||
* Creates eight tasks, each of which flash an LED at a different rate. The first
|
||||
* LED flashes every 125ms, the second every 250ms, the third every 375ms, etc.
|
||||
*
|
||||
* The LED flash tasks provide instant visual feedback. They show that the scheduler
|
||||
* The LED flash tasks provide instant visual feedback. They show that the scheduler
|
||||
* is still operational.
|
||||
*
|
||||
* The PC port uses the standard parallel port for outputs, the Flashlite 186 port
|
||||
* The PC port uses the standard parallel port for outputs, the Flashlite 186 port
|
||||
* uses IO port F.
|
||||
*
|
||||
* \page flashC flash.c
|
||||
@@ -42,16 +42,16 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
TickType_t rather than unsigned long.
|
||||
|
||||
Changes from V2.1.1
|
||||
|
||||
+ The stack size now uses configMINIMAL_STACK_SIZE.
|
||||
+ String constants made file scope to decrease stack depth on 8051 port.
|
||||
*/
|
||||
* Changes from V2.0.0
|
||||
*
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
+ TickType_t rather than unsigned long.
|
||||
+
|
||||
+ Changes from V2.1.1
|
||||
+
|
||||
+ The stack size now uses configMINIMAL_STACK_SIZE.
|
||||
+ String constants made file scope to decrease stack depth on 8051 port.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -64,18 +64,18 @@ Changes from V2.1.1
|
||||
#include "flash.h"
|
||||
#include "print.h"
|
||||
|
||||
#define ledSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define ledSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
|
||||
/* Structure used to pass parameters to the LED tasks. */
|
||||
typedef struct LED_PARAMETERS
|
||||
{
|
||||
unsigned portBASE_TYPE uxLED; /*< The output the task should use. */
|
||||
TickType_t xFlashRate; /*< The rate at which the LED should flash. */
|
||||
unsigned portBASE_TYPE uxLED; /*< The output the task should use. */
|
||||
TickType_t xFlashRate; /*< The rate at which the LED should flash. */
|
||||
} xLEDParameters;
|
||||
|
||||
/* The task that is created eight times - each time with a different xLEDParaemtes
|
||||
structure passed in as the parameter. */
|
||||
static void vLEDFlashTask( void *pvParameters );
|
||||
/* The task that is created eight times - each time with a different xLEDParaemtes
|
||||
* structure passed in as the parameter. */
|
||||
static void vLEDFlashTask( void * pvParameters );
|
||||
|
||||
/* String to print if USE_STDIO is defined. */
|
||||
const char * const pcTaskStartMsg = "LED flash task started.\r\n";
|
||||
@@ -84,45 +84,44 @@ const char * const pcTaskStartMsg = "LED flash task started.\r\n";
|
||||
|
||||
void vStartLEDFlashTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
unsigned portBASE_TYPE uxLEDTask;
|
||||
xLEDParameters *pxLEDParameters;
|
||||
const unsigned portBASE_TYPE uxNumOfLEDs = 8;
|
||||
const TickType_t xFlashRate = 125;
|
||||
unsigned portBASE_TYPE uxLEDTask;
|
||||
xLEDParameters * pxLEDParameters;
|
||||
const unsigned portBASE_TYPE uxNumOfLEDs = 8;
|
||||
const TickType_t xFlashRate = 125;
|
||||
|
||||
/* Create the eight tasks. */
|
||||
for( uxLEDTask = 0; uxLEDTask < uxNumOfLEDs; ++uxLEDTask )
|
||||
{
|
||||
/* Create and complete the structure used to pass parameters to the next
|
||||
created task. */
|
||||
pxLEDParameters = ( xLEDParameters * ) pvPortMalloc( sizeof( xLEDParameters ) );
|
||||
pxLEDParameters->uxLED = uxLEDTask;
|
||||
pxLEDParameters->xFlashRate = ( xFlashRate + ( xFlashRate * ( TickType_t ) uxLEDTask ) );
|
||||
pxLEDParameters->xFlashRate /= portTICK_PERIOD_MS;
|
||||
/* Create the eight tasks. */
|
||||
for( uxLEDTask = 0; uxLEDTask < uxNumOfLEDs; ++uxLEDTask )
|
||||
{
|
||||
/* Create and complete the structure used to pass parameters to the next
|
||||
* created task. */
|
||||
pxLEDParameters = ( xLEDParameters * ) pvPortMalloc( sizeof( xLEDParameters ) );
|
||||
pxLEDParameters->uxLED = uxLEDTask;
|
||||
pxLEDParameters->xFlashRate = ( xFlashRate + ( xFlashRate * ( TickType_t ) uxLEDTask ) );
|
||||
pxLEDParameters->xFlashRate /= portTICK_PERIOD_MS;
|
||||
|
||||
/* Spawn the task. */
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, ( void * ) pxLEDParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
/* Spawn the task. */
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, ( void * ) pxLEDParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void vLEDFlashTask( void *pvParameters )
|
||||
static void vLEDFlashTask( void * pvParameters )
|
||||
{
|
||||
xLEDParameters *pxParameters;
|
||||
xLEDParameters * pxParameters;
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
||||
pxParameters = ( xLEDParameters * ) pvParameters;
|
||||
pxParameters = ( xLEDParameters * ) pvParameters;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
/* Delay for half the flash period then turn the LED on. */
|
||||
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
|
||||
vParTestToggleLED( pxParameters->uxLED );
|
||||
for( ; ; )
|
||||
{
|
||||
/* Delay for half the flash period then turn the LED on. */
|
||||
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
|
||||
vParTestToggleLED( pxParameters->uxLED );
|
||||
|
||||
/* Delay for half the flash period then turn the LED off. */
|
||||
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
|
||||
vParTestToggleLED( pxParameters->uxLED );
|
||||
}
|
||||
/* Delay for half the flash period then turn the LED off. */
|
||||
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
|
||||
vParTestToggleLED( pxParameters->uxLED );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+210
-211
File diff suppressed because it is too large
Load Diff
+209
-210
File diff suppressed because it is too large
Load Diff
@@ -26,22 +26,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Manages a queue of strings that are waiting to be displayed. This is used to
|
||||
* Manages a queue of strings that are waiting to be displayed. This is used to
|
||||
* ensure mutual exclusion of console output.
|
||||
*
|
||||
* A task wishing to display a message will call vPrintDisplayMessage (), with a
|
||||
* pointer to the string as the parameter. The pointer is posted onto the
|
||||
* A task wishing to display a message will call vPrintDisplayMessage (), with a
|
||||
* pointer to the string as the parameter. The pointer is posted onto the
|
||||
* xPrintQueue queue.
|
||||
*
|
||||
* The task spawned in main. c blocks on xPrintQueue. When a message becomes
|
||||
* available it calls pcPrintGetNextMessage () to obtain a pointer to the next
|
||||
* string, then uses the functions defined in the portable layer FileIO. c to
|
||||
* The task spawned in main. c blocks on xPrintQueue. When a message becomes
|
||||
* available it calls pcPrintGetNextMessage () to obtain a pointer to the next
|
||||
* string, then uses the functions defined in the portable layer FileIO. c to
|
||||
* display the message.
|
||||
*
|
||||
* <b>NOTE:</b>
|
||||
* Using console IO can disrupt real time performance - depending on the port.
|
||||
* Standard C IO routines are not designed for real time applications. While
|
||||
* standard IO is useful for demonstration and debugging an alternative method
|
||||
* Using console IO can disrupt real time performance - depending on the port.
|
||||
* Standard C IO routines are not designed for real time applications. While
|
||||
* standard IO is useful for demonstration and debugging an alternative method
|
||||
* should be used if you actually require console IO as part of your application.
|
||||
*
|
||||
* \page PrintC print.c
|
||||
@@ -50,11 +50,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
* Changes from V2.0.0
|
||||
*
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
+ TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -71,36 +71,34 @@ static QueueHandle_t xPrintQueue;
|
||||
|
||||
void vPrintInitialise( void )
|
||||
{
|
||||
const unsigned portBASE_TYPE uxQueueSize = 20;
|
||||
const unsigned portBASE_TYPE uxQueueSize = 20;
|
||||
|
||||
/* Create the queue on which errors will be reported. */
|
||||
xPrintQueue = xQueueCreate( uxQueueSize, ( unsigned portBASE_TYPE ) sizeof( char * ) );
|
||||
/* Create the queue on which errors will be reported. */
|
||||
xPrintQueue = xQueueCreate( uxQueueSize, ( unsigned portBASE_TYPE ) sizeof( char * ) );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend )
|
||||
{
|
||||
#ifdef USE_STDIO
|
||||
xQueueSend( xPrintQueue, ( void * ) ppcMessageToSend, ( TickType_t ) 0 );
|
||||
#else
|
||||
/* Stop warnings. */
|
||||
( void ) ppcMessageToSend;
|
||||
#endif
|
||||
#ifdef USE_STDIO
|
||||
xQueueSend( xPrintQueue, ( void * ) ppcMessageToSend, ( TickType_t ) 0 );
|
||||
#else
|
||||
/* Stop warnings. */
|
||||
( void ) ppcMessageToSend;
|
||||
#endif
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
const char *pcPrintGetNextMessage( TickType_t xPrintRate )
|
||||
const char * pcPrintGetNextMessage( TickType_t xPrintRate )
|
||||
{
|
||||
char *pcMessage;
|
||||
char * pcMessage;
|
||||
|
||||
if( xQueueReceive( xPrintQueue, &pcMessage, xPrintRate ) == pdPASS )
|
||||
{
|
||||
return pcMessage;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if( xQueueReceive( xPrintQueue, &pcMessage, xPrintRate ) == pdPASS )
|
||||
{
|
||||
return pcMessage;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+178
-177
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -49,12 +49,12 @@
|
||||
#include "partest.h"
|
||||
#include "flash.h"
|
||||
|
||||
#define ledSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define ledNUMBER_OF_LEDS ( 3 )
|
||||
#define ledFLASH_RATE_BASE ( ( TickType_t ) 333 )
|
||||
#define ledSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define ledNUMBER_OF_LEDS ( 3 )
|
||||
#define ledFLASH_RATE_BASE ( ( TickType_t ) 333 )
|
||||
|
||||
/* Variable used by the created tasks to calculate the LED number to use, and
|
||||
the rate at which they should flash the LED. */
|
||||
* the rate at which they should flash the LED. */
|
||||
static volatile UBaseType_t uxFlashTaskNumber = 0;
|
||||
|
||||
/* The task that is created three times. */
|
||||
@@ -64,56 +64,55 @@ static portTASK_FUNCTION_PROTO( vLEDFlashTask, pvParameters );
|
||||
|
||||
void vStartLEDFlashTasks( UBaseType_t uxPriority )
|
||||
{
|
||||
BaseType_t xLEDTask;
|
||||
BaseType_t xLEDTask;
|
||||
|
||||
/* Create the three tasks. */
|
||||
for( xLEDTask = 0; xLEDTask < ledNUMBER_OF_LEDS; ++xLEDTask )
|
||||
{
|
||||
/* Spawn the task. */
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
/* Create the three tasks. */
|
||||
for( xLEDTask = 0; xLEDTask < ledNUMBER_OF_LEDS; ++xLEDTask )
|
||||
{
|
||||
/* Spawn the task. */
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static portTASK_FUNCTION( vLEDFlashTask, pvParameters )
|
||||
{
|
||||
TickType_t xFlashRate, xLastFlashTime;
|
||||
UBaseType_t uxLED;
|
||||
TickType_t xFlashRate, xLastFlashTime;
|
||||
UBaseType_t uxLED;
|
||||
|
||||
/* The parameters are not used. */
|
||||
( void ) pvParameters;
|
||||
/* The parameters are not used. */
|
||||
( void ) pvParameters;
|
||||
|
||||
/* Calculate the LED and flash rate. */
|
||||
portENTER_CRITICAL();
|
||||
{
|
||||
/* See which of the eight LED's we should use. */
|
||||
uxLED = uxFlashTaskNumber;
|
||||
/* Calculate the LED and flash rate. */
|
||||
portENTER_CRITICAL();
|
||||
{
|
||||
/* See which of the eight LED's we should use. */
|
||||
uxLED = uxFlashTaskNumber;
|
||||
|
||||
/* Update so the next task uses the next LED. */
|
||||
uxFlashTaskNumber++;
|
||||
}
|
||||
portEXIT_CRITICAL();
|
||||
/* Update so the next task uses the next LED. */
|
||||
uxFlashTaskNumber++;
|
||||
}
|
||||
portEXIT_CRITICAL();
|
||||
|
||||
xFlashRate = ledFLASH_RATE_BASE + ( ledFLASH_RATE_BASE * ( TickType_t ) uxLED );
|
||||
xFlashRate /= portTICK_PERIOD_MS;
|
||||
xFlashRate = ledFLASH_RATE_BASE + ( ledFLASH_RATE_BASE * ( TickType_t ) uxLED );
|
||||
xFlashRate /= portTICK_PERIOD_MS;
|
||||
|
||||
/* We will turn the LED on and off again in the delay period, so each
|
||||
delay is only half the total period. */
|
||||
xFlashRate /= ( TickType_t ) 2;
|
||||
/* We will turn the LED on and off again in the delay period, so each
|
||||
* delay is only half the total period. */
|
||||
xFlashRate /= ( TickType_t ) 2;
|
||||
|
||||
/* We need to initialise xLastFlashTime prior to the first call to
|
||||
vTaskDelayUntil(). */
|
||||
xLastFlashTime = xTaskGetTickCount();
|
||||
/* We need to initialise xLastFlashTime prior to the first call to
|
||||
* vTaskDelayUntil(). */
|
||||
xLastFlashTime = xTaskGetTickCount();
|
||||
|
||||
for(;;)
|
||||
{
|
||||
/* Delay for half the flash period then turn the LED on. */
|
||||
vTaskDelayUntil( &xLastFlashTime, xFlashRate );
|
||||
vParTestToggleLED( uxLED );
|
||||
for( ; ; )
|
||||
{
|
||||
/* Delay for half the flash period then turn the LED on. */
|
||||
vTaskDelayUntil( &xLastFlashTime, xFlashRate );
|
||||
vParTestToggleLED( uxLED );
|
||||
|
||||
/* Delay for half the flash period then turn the LED off. */
|
||||
vTaskDelayUntil( &xLastFlashTime, xFlashRate );
|
||||
vParTestToggleLED( uxLED );
|
||||
}
|
||||
/* Delay for half the flash period then turn the LED off. */
|
||||
vTaskDelayUntil( &xLastFlashTime, xFlashRate );
|
||||
vParTestToggleLED( uxLED );
|
||||
}
|
||||
} /*lint !e715 !e818 !e830 Function definition must be standard for task creation. */
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
#include "flash_timer.h"
|
||||
|
||||
/* The toggle rates are all a multple of ledFLASH_RATE_BASE. */
|
||||
#define ledFLASH_RATE_BASE ( ( ( TickType_t ) 333 ) / portTICK_PERIOD_MS )
|
||||
#define ledFLASH_RATE_BASE ( ( ( TickType_t ) 333 ) / portTICK_PERIOD_MS )
|
||||
|
||||
/* A block time of zero simple means "don't block". */
|
||||
#define ledDONT_BLOCK ( ( TickType_t ) 0 )
|
||||
#define ledDONT_BLOCK ( ( TickType_t ) 0 )
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -57,42 +57,40 @@ static void prvLEDTimerCallback( TimerHandle_t xTimer );
|
||||
|
||||
void vStartLEDFlashTimers( UBaseType_t uxNumberOfLEDs )
|
||||
{
|
||||
UBaseType_t uxLEDTimer;
|
||||
TimerHandle_t xTimer;
|
||||
UBaseType_t uxLEDTimer;
|
||||
TimerHandle_t xTimer;
|
||||
|
||||
/* Create and start the requested number of timers. */
|
||||
for( uxLEDTimer = 0; uxLEDTimer < uxNumberOfLEDs; ++uxLEDTimer )
|
||||
{
|
||||
/* Create the timer. */
|
||||
xTimer = xTimerCreate( "Flasher", /* A text name, purely to help debugging. */
|
||||
ledFLASH_RATE_BASE * ( uxLEDTimer + 1 ),/* The timer period, which is a multiple of ledFLASH_RATE_BASE. */
|
||||
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */
|
||||
( void * ) uxLEDTimer, /* The ID is used to identify the timer within the timer callback function, as each timer uses the same callback. */
|
||||
prvLEDTimerCallback /* Each timer uses the same callback. */
|
||||
);
|
||||
/* Create and start the requested number of timers. */
|
||||
for( uxLEDTimer = 0; uxLEDTimer < uxNumberOfLEDs; ++uxLEDTimer )
|
||||
{
|
||||
/* Create the timer. */
|
||||
xTimer = xTimerCreate( "Flasher", /* A text name, purely to help debugging. */
|
||||
ledFLASH_RATE_BASE * ( uxLEDTimer + 1 ), /* The timer period, which is a multiple of ledFLASH_RATE_BASE. */
|
||||
pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */
|
||||
( void * ) uxLEDTimer, /* The ID is used to identify the timer within the timer callback function, as each timer uses the same callback. */
|
||||
prvLEDTimerCallback /* Each timer uses the same callback. */
|
||||
);
|
||||
|
||||
/* If the timer was created successfully, attempt to start it. If the
|
||||
scheduler has not yet been started then the timer command queue must
|
||||
be long enough to hold each command sent to it until such time that the
|
||||
scheduler is started. The timer command queue length is set by
|
||||
configTIMER_QUEUE_LENGTH in FreeRTOSConfig.h. */
|
||||
if( xTimer != NULL )
|
||||
{
|
||||
xTimerStart( xTimer, ledDONT_BLOCK );
|
||||
}
|
||||
}
|
||||
/* If the timer was created successfully, attempt to start it. If the
|
||||
* scheduler has not yet been started then the timer command queue must
|
||||
* be long enough to hold each command sent to it until such time that the
|
||||
* scheduler is started. The timer command queue length is set by
|
||||
* configTIMER_QUEUE_LENGTH in FreeRTOSConfig.h. */
|
||||
if( xTimer != NULL )
|
||||
{
|
||||
xTimerStart( xTimer, ledDONT_BLOCK );
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvLEDTimerCallback( TimerHandle_t xTimer )
|
||||
{
|
||||
BaseType_t xTimerID;
|
||||
BaseType_t xTimerID;
|
||||
|
||||
/* The timer ID is used to identify the timer that has actually expired as
|
||||
each timer uses the same callback. The ID is then also used as the number
|
||||
of the LED that is to be toggled. */
|
||||
xTimerID = ( BaseType_t ) pvTimerGetTimerID( xTimer );
|
||||
vParTestToggleLED( xTimerID );
|
||||
/* The timer ID is used to identify the timer that has actually expired as
|
||||
* each timer uses the same callback. The ID is then also used as the number
|
||||
* of the LED that is to be toggled. */
|
||||
xTimerID = ( BaseType_t ) pvTimerGetTimerID( xTimer );
|
||||
vParTestToggleLED( xTimerID );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+209
-211
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -32,5 +32,3 @@ void vCreateAbortDelayTasks( void );
|
||||
BaseType_t xAreAbortDelayTestTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vStartBlockingQueueTasks( UBaseType_t uxPriority );
|
||||
BaseType_t xAreBlockingQueuesStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ BaseType_t xAreEventGroupTasksStillRunning( void );
|
||||
void vPeriodicEventGroupsProcessing( void );
|
||||
|
||||
#endif /* EVENT_GROUPS_DEMO_H */
|
||||
|
||||
|
||||
@@ -33,6 +33,3 @@ BaseType_t xAreGenericQueueTasksStillRunning( void );
|
||||
void vMutexISRInteractionTest( void );
|
||||
|
||||
#endif /* GEN_Q_TEST_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,9 +34,3 @@ BaseType_t xFirstTimerHandler( void );
|
||||
BaseType_t xSecondTimerHandler( void );
|
||||
|
||||
#endif /* QUEUE_ACCESS_TEST */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,3 @@ BaseType_t xAreInterruptSemaphoreTasksStillRunning( void );
|
||||
void vInterruptSemaphorePeriodicTest( void );
|
||||
|
||||
#endif /* INT_SEM_TEST_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,7 @@
|
||||
#ifndef MESSAGE_BUFFER_TEST_H
|
||||
#define MESSAGE_BUFFER_TEST_H
|
||||
|
||||
void vStartMessageBufferTasks( configSTACK_DEPTH_TYPE xStackSize );
|
||||
void vStartMessageBufferTasks( configSTACK_DEPTH_TYPE xStackSize );
|
||||
BaseType_t xAreMessageBufferTasksStillRunning( void );
|
||||
|
||||
#endif /* MESSAGE_BUFFER_TEST_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vStartPolledQueueTasks( UBaseType_t uxPriority );
|
||||
BaseType_t xArePollingQueuesStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,3 @@ void vStartQueuePeekTasks( void );
|
||||
BaseType_t xAreQueuePeekTasksStillRunning( void );
|
||||
|
||||
#endif /* Q_PEEK_TEST_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,5 +33,3 @@ BaseType_t xIsQueueOverwriteTaskStillRunning( void );
|
||||
void vQueueOverwritePeriodicISRDemo( void );
|
||||
|
||||
#endif /* QUEUE_OVERWRITE_H */
|
||||
|
||||
|
||||
|
||||
@@ -33,5 +33,3 @@ BaseType_t xAreQueueSetTasksStillRunning( void );
|
||||
void vQueueSetAccessQueueSetFromISR( void );
|
||||
|
||||
#endif /* QUEUE_WAIT_MULTIPLE_H */
|
||||
|
||||
|
||||
|
||||
@@ -33,5 +33,3 @@ BaseType_t xAreQueueSetPollTasksStillRunning( void );
|
||||
void vQueueSetPollingInterruptAccess( void );
|
||||
|
||||
#endif /* QUEUE_SET_POLLING_H */
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,7 @@
|
||||
#ifndef STATIC_ALLOCATION_H
|
||||
#define STATIC_ALLOCATION_H
|
||||
|
||||
void vStartStaticallyAllocatedTasks( void );
|
||||
void vStartStaticallyAllocatedTasks( void );
|
||||
BaseType_t xAreStaticAllocationTasksStillRunning( void );
|
||||
|
||||
#endif /* STATIC_ALLOCATION_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,3 @@ BaseType_t xAreStreamBufferTasksStillRunning( void );
|
||||
void vPeriodicStreamBufferProcessing( void );
|
||||
|
||||
#endif /* STREAM_BUFFER_TEST_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,8 @@
|
||||
#ifndef TASK_NOTIFY_H
|
||||
#define TASK_NOTIFY_H
|
||||
|
||||
void vStartTaskNotifyTask( void );
|
||||
void vStartTaskNotifyTask( void );
|
||||
BaseType_t xAreTaskNotificationTasksStillRunning( void );
|
||||
void xNotifyTaskFromISR( void );
|
||||
|
||||
#endif /* TASK_NOTIFY_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,8 @@
|
||||
#ifndef TASK_NOTIFY_ARRAY_H
|
||||
#define TASK_NOTIFY_ARRAY_H
|
||||
|
||||
void vStartTaskNotifyArrayTask( void );
|
||||
void vStartTaskNotifyArrayTask( void );
|
||||
BaseType_t xAreTaskNotificationArrayTasksStillRunning( void );
|
||||
void xNotifyArrayTaskFromISR( void );
|
||||
|
||||
#endif /* TASK_NOTIFY_ARRAY_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,3 @@ void vTimerPeriodicISRTests( void );
|
||||
void vTimerDemoIncludeBacklogTests( BaseType_t includeBacklogTests );
|
||||
|
||||
#endif /* TIMER_DEMO_H */
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vCreateBlockTimeTasks( void );
|
||||
BaseType_t xAreBlockTimeTestTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,13 @@
|
||||
#ifndef COMTEST_H
|
||||
#define COMTEST_H
|
||||
|
||||
void vAltStartComTestTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED );
|
||||
void vStartComTestTasks( UBaseType_t uxPriority, eCOMPort ePort, eBaud eBaudRate );
|
||||
void vAltStartComTestTasks( UBaseType_t uxPriority,
|
||||
uint32_t ulBaudRate,
|
||||
UBaseType_t uxLED );
|
||||
void vStartComTestTasks( UBaseType_t uxPriority,
|
||||
eCOMPort ePort,
|
||||
eBaud eBaudRate );
|
||||
BaseType_t xAreComTestTasksStillRunning( void );
|
||||
void vComTestUnsuspendTask( void );
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ifndef COMTEST_H */
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
#ifndef COMTEST_H
|
||||
#define COMTEST_H
|
||||
|
||||
void vAltStartComTestTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED );
|
||||
void vAltStartComTestTasks( UBaseType_t uxPriority,
|
||||
uint32_t ulBaudRate,
|
||||
UBaseType_t uxLED );
|
||||
BaseType_t xAreComTestTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
#ifndef COMTEST_STRINGS_H
|
||||
#define COMTEST_STRINGS_H
|
||||
|
||||
void vStartComTestStringsTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED );
|
||||
void vStartComTestStringsTasks( UBaseType_t uxPriority,
|
||||
uint32_t ulBaudRate,
|
||||
UBaseType_t uxLED );
|
||||
BaseType_t xAreComTestTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,4 +32,3 @@ void vStartCountingSemaphoreTasks( void );
|
||||
BaseType_t xAreCountingSemaphoreTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,4 +44,3 @@ void vStartFlashCoRoutines( UBaseType_t uxPriority );
|
||||
BaseType_t xAreFlashCoRoutinesStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -40,4 +40,3 @@ void vStartHookCoRoutines( void );
|
||||
BaseType_t xAreHookCoRoutinesStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vCreateSuicidalTasks( UBaseType_t uxPriority );
|
||||
BaseType_t xIsCreateTaskStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vStartDynamicPriorityTasks( void );
|
||||
BaseType_t xAreDynamicPriorityTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
void vDisplayMessage( const char * const pcMessageToPrint );
|
||||
void vWriteMessageToDisk( const char * const pcMessage );
|
||||
void vWriteBufferToDisk( const char * const pcBuffer, uint32_t ulBufferLength );
|
||||
void vWriteBufferToDisk( const char * const pcBuffer,
|
||||
uint32_t ulBufferLength );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,4 +31,3 @@
|
||||
void vStartLEDFlashTasks( UBaseType_t uxPriority );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
/*
|
||||
* Creates the LED flashing timers. xNumberOfLEDs specifies how many timers to
|
||||
* create, with each timer toggling a different LED. The first LED to be
|
||||
* create, with each timer toggling a different LED. The first LED to be
|
||||
* toggled is LED 0, with subsequent LEDs following on in numerical order. Each
|
||||
* timer uses the exact same callback function, with the timer ID being used
|
||||
* within the callback function to determine which timer has actually expired
|
||||
|
||||
@@ -32,5 +32,3 @@ void vStartMathTasks( UBaseType_t uxPriority );
|
||||
BaseType_t xAreMathsTaskStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vStartIntegerMathTasks( UBaseType_t uxPriority );
|
||||
BaseType_t xAreIntegerMathsTaskStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,5 +32,3 @@ void vStartMultiEventTasks( void );
|
||||
BaseType_t xAreMultiEventTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
#ifndef PARTEST_H
|
||||
#define PARTEST_H
|
||||
|
||||
#define partstDEFAULT_PORT_ADDRESS ( ( uint16_t ) 0x378 )
|
||||
#define partstDEFAULT_PORT_ADDRESS ( ( uint16_t ) 0x378 )
|
||||
|
||||
void vParTestInitialise( void );
|
||||
void vParTestSetLED( UBaseType_t uxLED, BaseType_t xValue );
|
||||
void vParTestSetLED( UBaseType_t uxLED,
|
||||
BaseType_t xValue );
|
||||
void vParTestToggleLED( UBaseType_t uxLED );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
|
||||
void vPrintInitialise( void );
|
||||
void vPrintDisplayMessage( const char * const * pcMessageToSend );
|
||||
const char *pcPrintGetNextMessage( TickType_t xPrintRate );
|
||||
const char * pcPrintGetNextMessage( TickType_t xPrintRate );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -32,4 +32,3 @@ void vStartRecursiveMutexTasks( void );
|
||||
BaseType_t xAreRecursiveMutexTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,4 +32,3 @@ void vStartSemaphoreTasks( UBaseType_t uxPriority );
|
||||
BaseType_t xAreSemaphoreTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,68 +31,79 @@
|
||||
typedef void * xComPortHandle;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
serCOM1,
|
||||
serCOM2,
|
||||
serCOM3,
|
||||
serCOM4,
|
||||
serCOM5,
|
||||
serCOM6,
|
||||
serCOM7,
|
||||
serCOM8
|
||||
{
|
||||
serCOM1,
|
||||
serCOM2,
|
||||
serCOM3,
|
||||
serCOM4,
|
||||
serCOM5,
|
||||
serCOM6,
|
||||
serCOM7,
|
||||
serCOM8
|
||||
} eCOMPort;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
serNO_PARITY,
|
||||
serODD_PARITY,
|
||||
serEVEN_PARITY,
|
||||
serMARK_PARITY,
|
||||
serSPACE_PARITY
|
||||
typedef enum
|
||||
{
|
||||
serNO_PARITY,
|
||||
serODD_PARITY,
|
||||
serEVEN_PARITY,
|
||||
serMARK_PARITY,
|
||||
serSPACE_PARITY
|
||||
} eParity;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
serSTOP_1,
|
||||
serSTOP_2
|
||||
typedef enum
|
||||
{
|
||||
serSTOP_1,
|
||||
serSTOP_2
|
||||
} eStopBits;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
serBITS_5,
|
||||
serBITS_6,
|
||||
serBITS_7,
|
||||
serBITS_8
|
||||
typedef enum
|
||||
{
|
||||
serBITS_5,
|
||||
serBITS_6,
|
||||
serBITS_7,
|
||||
serBITS_8
|
||||
} eDataBits;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ser50,
|
||||
ser75,
|
||||
ser110,
|
||||
ser134,
|
||||
ser150,
|
||||
ser200,
|
||||
ser300,
|
||||
ser600,
|
||||
ser1200,
|
||||
ser1800,
|
||||
ser2400,
|
||||
ser4800,
|
||||
ser9600,
|
||||
ser19200,
|
||||
ser38400,
|
||||
ser57600,
|
||||
ser115200
|
||||
typedef enum
|
||||
{
|
||||
ser50,
|
||||
ser75,
|
||||
ser110,
|
||||
ser134,
|
||||
ser150,
|
||||
ser200,
|
||||
ser300,
|
||||
ser600,
|
||||
ser1200,
|
||||
ser1800,
|
||||
ser2400,
|
||||
ser4800,
|
||||
ser9600,
|
||||
ser19200,
|
||||
ser38400,
|
||||
ser57600,
|
||||
ser115200
|
||||
} eBaud;
|
||||
|
||||
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength );
|
||||
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength );
|
||||
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength );
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime );
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime );
|
||||
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud,
|
||||
unsigned portBASE_TYPE uxQueueLength );
|
||||
xComPortHandle xSerialPortInit( eCOMPort ePort,
|
||||
eBaud eWantedBaud,
|
||||
eParity eWantedParity,
|
||||
eDataBits eWantedDataBits,
|
||||
eStopBits eWantedStopBits,
|
||||
unsigned portBASE_TYPE uxBufferLength );
|
||||
void vSerialPutString( xComPortHandle pxPort,
|
||||
const signed char * const pcString,
|
||||
unsigned short usStringLength );
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort,
|
||||
signed char * pcRxedChar,
|
||||
TickType_t xBlockTime );
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort,
|
||||
signed char cOutChar,
|
||||
TickType_t xBlockTime );
|
||||
portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort );
|
||||
void vSerialClose( xComPortHandle xPort );
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ifndef SERIAL_COMMS_H */
|
||||
|
||||
+3
-3
@@ -10,10 +10,10 @@ FreeRTOS port, and contains its own readme file.
|
||||
|
||||
See [FreeRTOS/SourceOrganization](http://www.freertos.org/a00017.html) for full details of the directory structure and information on locating the files you require.
|
||||
|
||||
The easiest way to use FreeRTOS is to start with one of the pre-configured demo
|
||||
application projects (found in the FreeRTOS/Demo directory). That way you will
|
||||
The easiest way to use FreeRTOS is to start with one of the pre-configured demo
|
||||
application projects (found in the FreeRTOS/Demo directory). That way you will
|
||||
have the correct FreeRTOS source files included, and the correct include paths
|
||||
configured.
|
||||
configured.
|
||||
Once a demo application is building and executing you can remove
|
||||
the demo application file, and start to add in your own application source
|
||||
files.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
eFrameProcessingResult_t publicProcessIPPacket( IPPacket_t * const pxIPPacket, NetworkBufferDescriptor_t * const pxNetworkBuffer ) {
|
||||
prvProcessIPPacket(pxIPPacket, pxNetworkBuffer);
|
||||
eFrameProcessingResult_t publicProcessIPPacket( IPPacket_t * const pxIPPacket,
|
||||
NetworkBufferDescriptor_t * const pxNetworkBuffer )
|
||||
{
|
||||
prvProcessIPPacket( pxIPPacket, pxNetworkBuffer );
|
||||
}
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
int32_t publicTCPPrepareSend( FreeRTOS_Socket_t *pxSocket, NetworkBufferDescriptor_t **ppxNetworkBuffer, UBaseType_t uxOptionsLength ) {
|
||||
prvTCPPrepareSend( pxSocket, ppxNetworkBuffer, uxOptionsLength );
|
||||
int32_t publicTCPPrepareSend( FreeRTOS_Socket_t * pxSocket,
|
||||
NetworkBufferDescriptor_t ** ppxNetworkBuffer,
|
||||
UBaseType_t uxOptionsLength )
|
||||
{
|
||||
prvTCPPrepareSend( pxSocket, ppxNetworkBuffer, uxOptionsLength );
|
||||
}
|
||||
|
||||
BaseType_t publicTCPHandleState( FreeRTOS_Socket_t *pxSocket, NetworkBufferDescriptor_t **ppxNetworkBuffer ) {
|
||||
prvTCPHandleState(pxSocket, ppxNetworkBuffer);
|
||||
BaseType_t publicTCPHandleState( FreeRTOS_Socket_t * pxSocket,
|
||||
NetworkBufferDescriptor_t ** ppxNetworkBuffer )
|
||||
{
|
||||
prvTCPHandleState( pxSocket, ppxNetworkBuffer );
|
||||
}
|
||||
|
||||
void publicTCPReturnPacket( FreeRTOS_Socket_t *pxSocket, NetworkBufferDescriptor_t *pxNetworkBuffer,
|
||||
uint32_t ulLen, BaseType_t xReleaseAfterSend ) {
|
||||
prvTCPReturnPacket(pxSocket, pxNetworkBuffer, ulLen, xReleaseAfterSend );
|
||||
void publicTCPReturnPacket( FreeRTOS_Socket_t * pxSocket,
|
||||
NetworkBufferDescriptor_t * pxNetworkBuffer,
|
||||
uint32_t ulLen,
|
||||
BaseType_t xReleaseAfterSend )
|
||||
{
|
||||
prvTCPReturnPacket( pxSocket, pxNetworkBuffer, ulLen, xReleaseAfterSend );
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
#include "NetworkInterface.h"
|
||||
|
||||
/*
|
||||
* CBMC models a pointer as an object id and an offset into that
|
||||
* object. The top bits of a pointer encode the object id and the
|
||||
* remaining bits encode the offset. This means there is a bound on
|
||||
* the maximum offset into an object in CBMC, and hence a bound on the
|
||||
* size of objects in CBMC.
|
||||
*/
|
||||
* CBMC models a pointer as an object id and an offset into that
|
||||
* object. The top bits of a pointer encode the object id and the
|
||||
* remaining bits encode the offset. This means there is a bound on
|
||||
* the maximum offset into an object in CBMC, and hence a bound on the
|
||||
* size of objects in CBMC.
|
||||
*/
|
||||
#define CBMC_BITS 7
|
||||
#define CBMC_MAX_OBJECT_SIZE ( 0xFFFFFFFF >> ( CBMC_BITS + 1 ) )
|
||||
|
||||
@@ -70,19 +70,19 @@ enum CBMC_LOOP_CONDITION
|
||||
#define __CPROVER_printf2_ptr( str, exp ) { uint8_t * ValueOf_ ## str = ( uint8_t * ) ( exp ); }
|
||||
|
||||
/*
|
||||
* An assertion that pvPortMalloc returns NULL when asked to allocate 0 bytes.
|
||||
* This assertion is used in some of the TaskPool proofs.
|
||||
*/
|
||||
* An assertion that pvPortMalloc returns NULL when asked to allocate 0 bytes.
|
||||
* This assertion is used in some of the TaskPool proofs.
|
||||
*/
|
||||
#define __CPROVER_assert_zero_allocation() \
|
||||
__CPROVER_assert( pvPortMalloc( 0 ) == NULL, \
|
||||
"pvPortMalloc allows zero-allocated memory." )
|
||||
|
||||
/*
|
||||
* A stub for pvPortMalloc that nondeterministically chooses to return
|
||||
* either NULL or an allocation of the requested space. The stub is
|
||||
* guaranteed to return NULL when asked to allocate 0 bytes.
|
||||
* This stub is used in some of the TaskPool proofs.
|
||||
*/
|
||||
* A stub for pvPortMalloc that nondeterministically chooses to return
|
||||
* either NULL or an allocation of the requested space. The stub is
|
||||
* guaranteed to return NULL when asked to allocate 0 bytes.
|
||||
* This stub is used in some of the TaskPool proofs.
|
||||
*/
|
||||
void * pvPortMalloc( size_t xWantedSize )
|
||||
{
|
||||
if( xWantedSize == 0 )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user