Verified Commit 814a48c8 authored by Vincent Coubard's avatar Vincent Coubard
Browse files

Convert remaining AWS libraries to CMSIS RTOS


Signed-off-by: Vincent Coubard's avatarVincent Coubard <vincent.coubard@arm.com>
parent d410272c
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -23,10 +24,9 @@
* http://www.FreeRTOS.org
*/
#include "RTOS_config.h"
/* Default configuration for all demos. Individual demos can override these below */
#ifndef democonfigDEMO_STACKSIZE
# define democonfigDEMO_STACKSIZE ( configMINIMAL_STACK_SIZE * 8 )
#endif
#define democonfigNETWORK_TYPES ( AWSIOT_NETWORK_TYPE_ETH )
......
/*
* Amazon FreeRTOS V1.1.4
* Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -32,14 +33,9 @@
#ifndef _AWS_PKCS11_CONFIG_H_
#define _AWS_PKCS11_CONFIG_H_
#include "FreeRTOS.h"
#include "RTOS_config.h"
#include "logging_levels.h"
// needed for pkcs psa source to compile
#include "semphr.h"
#include "task.h"
//#include "FreeRTOSConfig.h"
#include "iot_logging.h"
extern void vLoggingPrintf( const char * pcFormat,
... );
......
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -30,7 +31,7 @@
#ifndef _IOT_BLE_NUMERIC_COMPARISON_H_
#define _IOT_BLE_NUMERIC_COMPARISON_H_
#include "FreeRTOS.h"
#include "cmsis_os2.h"
#include "iot_ble.h"
......
/*
* Amazon FreeRTOS V1.4.8
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -26,29 +27,15 @@
#ifndef IOT_CONFIG_H
#define IOT_CONFIG_H
// #include "FreeRTOS.h"
// #include "iot_platform_types_freertos.h"
// #include "aws_clientcredential_keys.h"
#define configPLATFORM_NAME "AN547"
// /* Certificate for the device.*/
// #define IOT_DEVICE_CERTIFICATE keyCLIENT_CERTIFICATE_PEM
// #define IOT_NETWORK_RECEIVE_TASK_STACK_SIZE configMINIMAL_STACK_SIZE*3
// #define IOT_NETWORK_RECEIVE_TASK_PRIORITY configMAX_PRIORITIES-2
// this needed because core_pkcs11_mbedtls.c did not compile
//#define MBEDTLS_THREADING_C 1
// FIXME:
// as I understand this files is for configuring AWS SDK and other libraries
// for startes configuration was taken from amazon-freertos\tests\include\iot_config_common.h
/* FreeRTOS include. */
#include "FreeRTOS.h"
#include "cmsis_os2.h"
#include "RTOS_config.h"
/* Credentials include. */
#include <aws_clientcredential.h>
......@@ -245,12 +232,12 @@ extern int snprintf( char *,
#define IOT_THREAD_DEFAULT_STACK_SIZE 2048
#endif
#ifndef IOT_THREAD_DEFAULT_PRIORITY
#define IOT_THREAD_DEFAULT_PRIORITY tskIDLE_PRIORITY
#define IOT_THREAD_DEFAULT_PRIORITY osPriorityNormal
#endif
/* Platform network configuration. */
#ifndef IOT_NETWORK_RECEIVE_TASK_PRIORITY
#define IOT_NETWORK_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define IOT_NETWORK_RECEIVE_TASK_PRIORITY osPriorityNormal1
#endif
#ifndef IOT_NETWORK_RECEIVE_TASK_STACK_SIZE
#define IOT_NETWORK_RECEIVE_TASK_STACK_SIZE IOT_THREAD_DEFAULT_STACK_SIZE
......@@ -310,46 +297,6 @@ typedef struct IotNetworkCredentials IotTestNetworkCredentials_t;
#define IotTestNetwork_Init() IOT_NETWORK_SUCCESS
#define IotTestNetwork_Cleanup()
// // FIXME!!!
// // added from aws_demo.h so MQTT demo will compile
// #include "platform/iot_network.h"
// #include "platform/iot_threads.h"
// /**
// * @brief All C SDK demo functions have this signature.
// */
// typedef int (* demoFunction_t)( bool awsIotMqttMode,
// const char * pIdentifier,
// void * pNetworkServerInfo,
// void * pNetworkCredentialInfo,
// const IotNetworkInterface_t * pNetworkInterface );
// typedef void (* networkConnectedCallback_t)( bool awsIotMqttMode,
// const char * pIdentifier,
// void * pNetworkServerInfo,
// void * pNetworkCredentialInfo,
// const IotNetworkInterface_t * pNetworkInterface );
// typedef void (* networkDisconnectedCallback_t)( const IotNetworkInterface_t * pNetworkInteface );
// //void runDemoTask( void * pArgument );
// //void DEMO_RUNNER_RunDemos( void );
// typedef struct demoContext
// {
// /* Network types for the demo */
// uint32_t networkTypes;
// /* Function pointers to be set by the implementations for the demo */
// demoFunction_t demoFunction;
// networkConnectedCallback_t networkConnectedCallback;
// networkDisconnectedCallback_t networkDisconnectedCallback;
// } demoContext_t;
#define iotconfigUSE_PORT_SPECIFIC_HOOKS 0
#endif /* IOT_CONFIG_H */
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -29,7 +30,7 @@
#define IOT_CONFIG_COMMON_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
#include "cmsis_os2.h"
/* Use platform types on FreeRTOS. */
#include "platform/iot_platform_types_freertos.h"
......
/*
* FreeRTOS HTTPS Client V1.2.0
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -185,7 +186,7 @@
#define IOT_HTTPS_MAX_ALPN_PROTOCOLS_LENGTH ( 255 ) /* The maximum alpn protocols length is chosen arbitrarily. */
#endif
#ifndef IOT_HTTPS_QUEUE_RECV_TICKS
#define IOT_HTTPS_QUEUE_RECV_TICKS ( portMAX_DELAY ) /* The ticks to wait for a #xQueueReceive to complete. */
#define IOT_HTTPS_QUEUE_RECV_TICKS ( osWaitForever ) /* The ticks to wait for a #xQueueReceive to complete. */
#endif
#ifndef IOT_HTTPS_QUEUE_SEND_TICKS
#define IOT_HTTPS_QUEUE_SEND_TICKS ( 0U ) /* The ticks to wait for a #xQueueSendToBack to complete. */
......
/*
* FreeRTOS MQTT V2.3.1
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -35,8 +36,7 @@
#define _AWS_MQTT_AGENT_CONFIG_DEFAULTS_H_
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "cmsis_os2.h"
/**
* @brief Controls whether or not to report usage metrics to the
......
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -29,7 +30,7 @@
*/
/* FreeRTOS include. */
#include "FreeRTOS.h"
#include "RTOS_config.h"
/*-----------------------------------------------------------*/
......
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -331,7 +332,7 @@ void runDemoTask( void * pArgument )
/* Give a chance to drain the logging queue to increase the probability
* of the following messages used by the test framework not getting
* dropped. */
vTaskDelay( pdMS_TO_TICKS( 1000 ) );
osDelay( pdMS_TO_TICKS( 1000 ) );
/* Log the demo status. */
if( status == EXIT_SUCCESS )
......
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -38,9 +39,7 @@
#include <string.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
#include "cmsis_os2.h"
/* PKCS#11 includes. */
#include "core_pkcs11_config.h"
......
/*
* FreeRTOS V202012.00
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -29,10 +30,7 @@
*/
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "cmsis_os2.h"
#include "iot_demo_logging.h"
#include "iot_network_manager_private.h"
......@@ -91,7 +89,7 @@
/**
* @brief Priority of the network manager task.
*/
#define NETWORK_MANAGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
#define NETWORK_MANAGER_TASK_PRIORITY ( osPriorityNormal )
/**
* @brief Stack size for network manager task.
......@@ -148,9 +146,9 @@ typedef struct IotNetworkManager
IotNMNetwork_t * pNetworks;
size_t numNetworks;
IotNMSubscription_t subscriptions[ NETWORK_MANAGER_MAX_SUBSCRIPTIONS ];
QueueHandle_t eventQueue;
SemaphoreHandle_t globalMutex;
SemaphoreHandle_t subscriptionsMutex;
osMessageQueueId_t eventQueue;
osMutexId_t globalMutex;
osMutexId_t subscriptionsMutex;
} IotNetworkManagerInfo_t;
#if BLE_ENABLED
......@@ -483,16 +481,16 @@ static IotNetworkManagerInfo_t networkManager;
IotLogInfo( "BLE Connected to remote device, connId = %d\n", connectionID );
IotBle_StopAdv( NULL );
event.eventType = IOT_NETWORK_EVENT_CONNECTED;
sendStatus = xQueueSend( networkManager.eventQueue, &event, ( TickType_t ) 1U );
configASSERT( sendStatus == pdTRUE );
sendStatus = osMessageQueuePut( networkManager.eventQueue, &event, 0, ( uint32_t ) 1U );
configASSERT( sendStatus == true );
}
else
{
IotLogInfo( "BLE disconnected with remote device, connId = %d \n", connectionID );
( void ) IotBle_StartAdv( NULL );
event.eventType = IOT_NETWORK_EVENT_DISCONNECTED;
sendStatus = xQueueSend( networkManager.eventQueue, &event, ( TickType_t ) 1U );
configASSERT( sendStatus == pdTRUE );
sendStatus = osMessageQueuePut( networkManager.eventQueue, &event, 0, ( uint32_t ) 1U );
configASSERT( sendStatus == true );
}
}
......@@ -727,15 +725,15 @@ static IotNetworkManagerInfo_t networkManager;
pucIpAddr = ( uint8_t * ) ( &pxEvent->xInfo.xIPReady.xIPAddress.ulAddress[ 0 ] );
IotLogInfo( "Connected to WiFi access point, ip address: %d.%d.%d.%d.", pucIpAddr[ 0 ], pucIpAddr[ 1 ], pucIpAddr[ 2 ], pucIpAddr[ 3 ] );
event.eventType = IOT_NETWORK_EVENT_CONNECTED;
status = xQueueSend( networkManager.eventQueue, &event, ( TickType_t ) 1U );
configASSERT( status == pdTRUE );
status = osMessageQueuePut( networkManager.eventQueue, &event, 0, ( uint32_t ) 1U );
configASSERT( status == osOK );
}
else if( pxEvent->xEventType == eWiFiEventDisconnected )
{
IotLogInfo( "Disconnected from WiFi access point, reason code: %d.", pxEvent->xInfo.xDisconnected.xReason );
event.eventType = IOT_NETWORK_EVENT_DISCONNECTED;
status = xQueueSend( networkManager.eventQueue, &event, ( TickType_t ) 1U );
configASSERT( status == pdTRUE );
status = osMessageQueuePut( networkManager.eventQueue, &event, 0, ( uint32_t ) 1U );
configASSERT( status == osOK );
}
}
......@@ -828,15 +826,15 @@ static void prvNetworkManagerTask( void * pvParams )
for( ; ; )
{
status = xQueueReceive( networkManager.eventQueue, &event, portMAX_DELAY );
status = osMessageQueueGet( networkManager.eventQueue, &event, NULL, osWaitForever );
if( status == pdTRUE )
if( status == osOK )
{
stateChange = false;
pNetwork = prvGetNetworkInstance( event.networkType );
configASSERT( pNetwork != NULL );
xSemaphoreTake( networkManager.globalMutex, portMAX_DELAY );
osMutexAcquire( networkManager.globalMutex, osWaitForever );
if( ( pNetwork->state == eNetworkStateEnabled ) && ( event.eventType == IOT_NETWORK_EVENT_CONNECTED ) )
{
......@@ -849,13 +847,13 @@ static void prvNetworkManagerTask( void * pvParams )
stateChange = true;
}
xSemaphoreGive( networkManager.globalMutex );
osMutexRelease( networkManager.globalMutex );
if( stateChange )
{
xSemaphoreTake( networkManager.subscriptionsMutex, portMAX_DELAY );
osMutexAcquire( networkManager.subscriptionsMutex, osWaitForever );
prvDispatch( event.networkType, pNetwork->state );
xSemaphoreGive( networkManager.subscriptionsMutex );
osMutexRelease( networkManager.subscriptionsMutex );
}
}
}
......@@ -903,7 +901,7 @@ BaseType_t AwsIotNetworkManager_Init( void )
memset( &networkManager, 0x00, sizeof( IotNetworkManagerInfo_t ) );
networkManager.globalMutex = xSemaphoreCreateMutex();
networkManager.globalMutex = osMutexNew( NULL );
if( networkManager.globalMutex == NULL )
{
......@@ -913,7 +911,7 @@ BaseType_t AwsIotNetworkManager_Init( void )
if( status == pdTRUE )
{
networkManager.subscriptionsMutex = xSemaphoreCreateMutex();
networkManager.subscriptionsMutex = osMutexNew( NULL );
if( networkManager.subscriptionsMutex == NULL )
{
......@@ -924,7 +922,7 @@ BaseType_t AwsIotNetworkManager_Init( void )
if( status == pdTRUE )
{
networkManager.eventQueue = xQueueCreate( NETWORK_MANAGER_EVENT_QUEUE_SIZE, sizeof( IotNetworkEvent_t ) );
networkManager.eventQueue = osMessageQueueNew( NETWORK_MANAGER_EVENT_QUEUE_SIZE, sizeof( IotNetworkEvent_t ), NULL );
if( networkManager.eventQueue == NULL )
{
......@@ -935,13 +933,20 @@ BaseType_t AwsIotNetworkManager_Init( void )
if( status == pdTRUE )
{
if( ( status = xTaskCreate( prvNetworkManagerTask,
"NetworkManager",
NETWORK_MANAGER_TASK_STACK_SIZE,
NULL,
NETWORK_MANAGER_TASK_PRIORITY,
NULL ) ) != pdPASS )
osThreadAttr_t attr = {
.name = "NetworkManager",
.stack_size = NETWORK_MANAGER_TASK_STACK_SIZE,
.priority = NETWORK_MANAGER_TASK_PRIORITY
};
osThreadId_t thread_id = osThreadNew( prvNetworkManagerTask, NULL, &attr );
if( thread_id != NULL )
{
status = pdTRUE;
}
else
{
status = pdFALSE;
IotLogError( "Failed to create network manager task." );
}
}
......@@ -966,7 +971,7 @@ BaseType_t AwsIotNetworkManager_SubscribeForStateChange( uint32_t networkTypes,
size_t index;
IotNMSubscription_t * pSubscription = NULL;
xSemaphoreTake( networkManager.subscriptionsMutex, portMAX_DELAY );
osMutexAcquire( networkManager.subscriptionsMutex, osWaitForever );
for( index = 0; index < NETWORK_MANAGER_MAX_SUBSCRIPTIONS; index++ )
{
......@@ -984,7 +989,7 @@ BaseType_t AwsIotNetworkManager_SubscribeForStateChange( uint32_t networkTypes,
}
}
xSemaphoreGive( networkManager.subscriptionsMutex );
osMutexRelease( networkManager.subscriptionsMutex );
if( ret == pdFALSE )
{
......@@ -1000,7 +1005,7 @@ BaseType_t AwsIotNetworkManager_RemoveSubscription( IotNetworkManagerSubscriptio
size_t index;
IotNMSubscription_t * pSubscription = NULL;
xSemaphoreTake( networkManager.subscriptionsMutex, portMAX_DELAY );
osMutexAcquire( networkManager.subscriptionsMutex, osWaitForever );
for( index = 0; index < NETWORK_MANAGER_MAX_SUBSCRIPTIONS; index++ )
{
......@@ -1014,7 +1019,7 @@ BaseType_t AwsIotNetworkManager_RemoveSubscription( IotNetworkManagerSubscriptio
}
}
xSemaphoreGive( networkManager.subscriptionsMutex );
osMutexRelease( networkManager.subscriptionsMutex );
if( ret == pdFALSE )
{
......@@ -1073,7 +1078,7 @@ uint32_t AwsIotNetworkManager_EnableNetwork( uint32_t networkTypes )
{
uint32_t enabled = AWSIOT_NETWORK_TYPE_NONE;
xSemaphoreTake( networkManager.globalMutex, portMAX_DELAY );
osMutexAcquire( networkManager.globalMutex, osWaitForever );
#if BLE_ENABLED
if( ( networkTypes & AWSIOT_NETWORK_TYPE_BLE ) == AWSIOT_NETWORK_TYPE_BLE )
......@@ -1105,7 +1110,7 @@ uint32_t AwsIotNetworkManager_EnableNetwork( uint32_t networkTypes )
}
#endif
xSemaphoreGive( networkManager.globalMutex );
osMutexRelease( networkManager.globalMutex );
return enabled;
}
......@@ -1117,7 +1122,7 @@ uint32_t AwsIotNetworkManager_DisableNetwork( uint32_t networkTypes )
/* Unused parameter when no networks enabled */
( void ) networkTypes;
xSemaphoreTake( networkManager.globalMutex, portMAX_DELAY );
osMutexAcquire( networkManager.globalMutex, osWaitForever );
#if WIFI_ENABLED
if( ( networkTypes & AWSIOT_NETWORK_TYPE_WIFI ) == AWSIOT_NETWORK_TYPE_WIFI )
......@@ -1149,7 +1154,7 @@ uint32_t AwsIotNetworkManager_DisableNetwork( uint32_t networkTypes )
}
#endif
xSemaphoreGive( networkManager.globalMutex );
osMutexRelease( networkManager.globalMutex );
return disabled;
......
/*
* FreeRTOS Crypto V1.1.2
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -26,7 +27,7 @@
#ifndef __AWS_CRYPTO__H__
#define __AWS_CRYPTO__H__
#include "FreeRTOS.h"
#include "RTOS_config.h"
/**
* @brief Commonly used buffer sizes for storing cryptographic hash computation
......
/*
* FreeRTOS Common V1.1.3
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -31,9 +32,8 @@
#ifndef AWS_LOGGING_TASK_H
#define AWS_LOGGING_TASK_H
#ifndef INC_FREERTOS_H
#error "include FreeRTOS.h must appear in source files before include iot_logging_task.h"
#endif
#include "cmsis_os2.h"
#include "RTOS_config.h"
/**
* @brief Initialization function for logging task.
......
......@@ -31,8 +31,6 @@
/* Include header for logging level macros. */
#include "logging_levels.h"
/* FreeRTOS Include. */
#include "FreeRTOS.h"
#include "iot_logging_task.h"
/* Standard Include. */
......
/*
* FreeRTOS Common V1.1.3
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
......@@ -24,10 +25,7 @@
*/
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "cmsis_os2.h"
/* Logging includes. */
#include "iot_logging_task.h"
......@@ -38,17 +36,10 @@
#include <stdarg.h>
#include <string.h>
/* Sanity check all the definitions required by this file are set. */
#ifndef configPRINT_STRING
#error configPRINT_STRING( x ) must be defined in FreeRTOSConfig.h to use this logging file. Set configPRINT_STRING( x ) to a function that outputs a string, where X is the string. For example, #define configPRINT_STRING( x ) MyUARTWriteString( X )
#endif
#ifndef configLOGGING_MAX_MESSAGE_LENGTH
#error configLOGGING_MAX_MESSAGE_LENGTH must be defined in FreeRTOSConfig.h to use this logging file. configLOGGING_MAX_MESSAGE_LENGTH sets the size of the buffer into which formatted text is written, so also sets the maximum log message length.
#endif
#define configLOGGING_MAX_MESSAGE_LENGTH 200
#ifndef configLOGGING_INCLUDE_TIME_AND_TASK_NAME
#error configLOGGING_INCLUDE_TIME_AND_TASK_NAME must be defined in FreeRTOSConfig.h to use this logging file. Set configLOGGING_INCLUDE_TIME_AND_TASK_NAME to 1 to prepend a time stamp, message number and the name of the calling task to each logged message. Otherwise set to 0.
#error configLOGGING_INCLUDE_TIME_AND_TASK_NAME must be defined to use this logging file. Set configLOGGING_INCLUDE_TIME_AND_TASK_NAME to 1 to prepend a time stamp, message number and the name of the calling task to each logged message. Otherwise set to 0.
#endif
/* A block time of 0 just means don't block. */
......@@ -111,7 +102,7 @@ static void prvLoggingTask( void * pvParameters );
* The queue used to pass pointers to log messages from the task that created
* the message to the task that will performs the output.
*/
static QueueHandle_t xQueue = NULL;
static osMessageQueueId_t xQueue = NULL;
/*-----------------------------------------------------------*/
......@@ -169,29 +160,33 @@ BaseType_t xLoggingTaskInitialize( uint16_t usStackSize,
UBaseType_t uxPriority,
UBaseType_t uxQueueLength )
{
BaseType_t xReturn = pdFAIL;
osStatus_t xReturn = osError;
const osThreadAttr_t threadAttr = {
.name = "Logging",
.stack_size = usStackSize,
.priority = uxPriority