Skip to content

Commit e921c4f

Browse files
stm32h745 port using GNU Tools for STM32 (#28)
1 parent b62f30b commit e921c4f

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

FreeRTOS-Plus-POSIX/include/portable/FreeRTOS_POSIX_portable_default.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@
140140
#ifndef posixconfigENABLE_PTHREAD_BARRIER_T
141141
#define posixconfigENABLE_PTHREAD_BARRIER_T 1 /**< pthread_barrier_t in sys/types.h */
142142
#endif
143+
#ifndef posixconfigENABLE_SCHED_PARAM
144+
#define posixconfigENABLE_SCHED_PARAM 1 /**< sched_param in sched.h */
145+
#endif
143146
/**@} */
144147

145148
#endif /* ifndef _FREERTOS_POSIX_PORTABLE_DEFAULT_H_ */
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Amazon FreeRTOS+POSIX V1.0.4
3+
* Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
* this software and associated documentation files (the "Software"), to deal in
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so,
10+
* subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* http://aws.amazon.com/freertos
23+
* http://www.FreeRTOS.org
24+
*/
25+
26+
/**
27+
* @file FreeRTOS_POSIX_portable.h
28+
* @brief STM32 + GNU tools Port-specific configuration of FreeRTOS+POSIX.
29+
*/
30+
31+
#ifndef _FREERTOS_POSIX_PORTABLE_H_
32+
#define _FREERTOS_POSIX_PORTABLE_H_
33+
34+
/*
35+
* GNU Tools for STM32 already defines timespec and itimerspec.
36+
*/
37+
#define posixconfigENABLE_TIMESPEC 0
38+
#include <sys/_timespec.h>
39+
40+
#define posixconfigENABLE_ITIMERSPEC 0
41+
#include <sys/timespec.h>
42+
43+
/*
44+
* GNU Tools for STM32 already defines mode_t and clockit_t.
45+
*/
46+
#define posixconfigENABLE_MODE_T 0
47+
#define posixconfigENABLE_CLOCKID_T 0
48+
49+
/* Disable timer_t from GNU Tools to avoid compilation warnings
50+
* of pointer to integer conversion.
51+
*/
52+
#define __timer_t_defined 1
53+
54+
/* Define _SYS__PTHREADTYPES_H_ to disable GNU Tools for STM32
55+
* definitions that differ from FreeRTOS+POSIX implementation.
56+
*/
57+
#define _SYS__PTHREADTYPES_H_
58+
#include <sys/types.h>
59+
60+
/* Define posixconfigENABLE_SCHED_PARAM to skip our sched_param.
61+
* Excluding the entire header with _FREERTOS_POSIX_SCHED_H_
62+
* would miss sched_get_priority_max/min and sched_yield.
63+
*/
64+
#define posixconfigENABLE_SCHED_PARAM 0
65+
#include <sys/sched.h>
66+
67+
68+
#endif /* _FREERTOS_POSIX_PORTABLE_H_ */

include/FreeRTOS_POSIX/sched.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ extern "C" {
4848
* @brief Scheduling parameters required for implementation of each supported
4949
* scheduling policy.
5050
*/
51+
#if !defined( posixconfigENABLE_SCHED_PARAM ) || ( posixconfigENABLE_SCHED_PARAM == 1 )
5152
struct sched_param
5253
{
5354
int sched_priority; /**< Process or thread execution scheduling priority. */
5455
};
56+
#endif
5557

5658
/**
5759
* @brief Get priority limit (max).

0 commit comments

Comments
 (0)