Skip to content

Commit 5c53abf

Browse files
authored
Merge pull request arduino#68 from bcmi-labs/freertos-santiago
[Arduino FreeRTOS] Add support for Uno R4 WiFi and Minima Former-commit-id: bda4a18
2 parents 737e610 + aabf6af commit 5c53abf

File tree

7 files changed

+23
-9
lines changed

7 files changed

+23
-9
lines changed

libraries/Arduino_FreeRTOS/examples/FreeRTOS-Blink/FreeRTOS-Blink.ino

+8
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ void setup()
1919
Serial.begin(115200);
2020
while (!Serial) { }
2121

22+
#if defined(ARDUINO_PORTENTA_H33)
23+
/* Only the Portenta C33 has an RGB LED. */
2224
pinMode(LEDR, OUTPUT);
2325
digitalWrite(LEDR, LOW);
26+
#endif
2427

2528
/* Init a task that calls 'loop'
2629
* since after the call to
@@ -69,7 +72,12 @@ void setup()
6972

7073
void loop()
7174
{
75+
#if defined(ARDUINO_PORTENTA_H33)
76+
/* Only the Portenta C33 has an RGB LED. */
7277
digitalWrite(LEDR, !digitalRead(LEDR));
78+
#else
79+
Serial.println(millis());
80+
#endif
7381
vTaskDelay(configTICK_RATE_HZ/4);
7482
}
7583

libraries/Arduino_FreeRTOS/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name=Arduino_FreeRTOS
22
version=1.0.0
33
author=Arduino
44
maintainer=Arduino <[email protected]>
5-
sentence=This library provides FreeRTOS for the Portenta C33.
5+
sentence=This library provides FreeRTOS for the Portenta C33, Uno R4 Minima / WiFi.
66
paragraph=
77
category=Other
88
url=

libraries/Arduino_FreeRTOS/src/Arduino_FreeRTOS.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#pragma once
1212

13-
#ifndef ARDUINO_PORTENTA_H33
14-
# error "FreeRTOS is currently only supported for the Portenta C33."
13+
#if !defined(ARDUINO_PORTENTA_H33) && !defined(ARDUINO_SANTIAGO) && !defined(ARDUINO_SANTIAGO_COMPOSTA)
14+
# error "FreeRTOS is currently only supported for the Portenta C33, Arduino Uno R4 Minima and Arduino Uno R4 WiFi."
1515
#endif
1616

1717
#ifdef __cplusplus

libraries/Arduino_FreeRTOS/src/FreeRTOSConfig.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ FSP_HEADER
117117
#define configSUPPORT_DYNAMIC_ALLOCATION (1)
118118
#endif
119119
#ifndef configTOTAL_HEAP_SIZE
120-
#define configTOTAL_HEAP_SIZE (0x8000)
120+
# if defined(ARDUINO_PORTENTA_H33)
121+
# define configTOTAL_HEAP_SIZE (0x8000)
122+
# elif (defined(ARDUINO_SANTIAGO) || defined(ARDUINO_SANTIAGO_COMPOSTA))
123+
# define configTOTAL_HEAP_SIZE (0x2000) /* R7FA4M1AB has 32 kByte RAM total, so we only allocate 8 kByte RAM for FreeRTOS heap. */
124+
# else
125+
# error "Define the total allowed heap size dependent on your MCU's available RAM."
126+
# endif
121127
#endif
122128
#ifndef configAPPLICATION_ALLOCATED_HEAP
123129
#define configAPPLICATION_ALLOCATED_HEAP (4)

libraries/Arduino_FreeRTOS/src/lib/FreeRTOS-Kernel-v10.5.1/portable.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
* included here. In this case the path to the correct portmacro.h header file
5151
* must be set in the compiler's include path. */
5252
#ifndef portENTER_CRITICAL
53-
#include "../../portable/GCC/RA6M5/portmacro.h"
53+
#include "../../portable/FSP/portmacro.h"
5454
#endif
5555

5656
#if portBYTE_ALIGNMENT == 32

libraries/Arduino_FreeRTOS/src/portable/GCC/RA6M5/port.c renamed to libraries/Arduino_FreeRTOS/src/portable/FSP/port.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
/* Scheduler includes. */
3131
#include "bsp_api.h"
3232
#include "FreeRTOSConfig.h"
33-
#include "../../../lib/FreeRTOS-Kernel-v10.5.1/FreeRTOS.h"
34-
#include "../../../lib/FreeRTOS-Kernel-v10.5.1/task.h"
33+
#include "../../lib/FreeRTOS-Kernel-v10.5.1/FreeRTOS.h"
34+
#include "../../lib/FreeRTOS-Kernel-v10.5.1/task.h"
3535

3636
#if BSP_TZ_NONSECURE_BUILD
3737
#include "tz_context.h"

libraries/Arduino_FreeRTOS/src/portable/GCC/RA6M5/portmacro.h renamed to libraries/Arduino_FreeRTOS/src/portable/FSP/portmacro.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ extern "C" {
3636
* is defined correctly and privileged functions are placed in correct sections. */
3737
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
3838

39-
#include "../../../lib/FreeRTOS-Kernel-v10.5.1/mpu_wrappers.h"
39+
#include "../../lib/FreeRTOS-Kernel-v10.5.1/mpu_wrappers.h"
4040

4141
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE is needed to be defined only for the
4242
* header files. */
4343
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
4444

4545
/* Needed for definitions of pdFALSE and pdTRUE. */
46-
#include "../../../lib/FreeRTOS-Kernel-v10.5.1/projdefs.h"
46+
#include "../../lib/FreeRTOS-Kernel-v10.5.1/projdefs.h"
4747

4848
/*-----------------------------------------------------------
4949
* Port specific definitions.

0 commit comments

Comments
 (0)