mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Compare commits
45 Commits
update
...
331a278cb8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
331a278cb8 | ||
|
|
40655a9501 | ||
|
|
a5560ae4ea | ||
|
|
867f1fcb0d | ||
|
|
02580dab2e | ||
|
|
17f15bca98 | ||
|
|
35fd2f545f | ||
|
|
b036da9dcc | ||
|
|
2679a791d9 | ||
|
|
4b340c52bc | ||
|
|
e667189f45 | ||
|
|
a132d37dc6 | ||
|
|
fcb1b3785f | ||
|
|
a2734eed9e | ||
|
|
e79687e1e8 | ||
|
|
ae21be2913 | ||
|
|
fa3d4d49d5 | ||
|
|
693c1a3f2f | ||
|
|
f21630eb79 | ||
|
|
4634fa8ba7 | ||
|
|
6ad0b65bff | ||
|
|
69493ba212 | ||
|
|
e6a3f380e1 | ||
|
|
56b91ac13c | ||
|
|
0d74f773b2 | ||
|
|
51e08f3992 | ||
|
|
e9117269ef | ||
|
|
c776390ac3 | ||
|
|
a626d5a9c1 | ||
|
|
c8c36d29bf | ||
|
|
b772e1dc26 | ||
|
|
8514edfdea | ||
|
|
f5d6d8b1af | ||
|
|
da28492f00 | ||
|
|
6ef1fbd46a | ||
|
|
6e53d85b32 | ||
|
|
31ff398150 | ||
|
|
a2615a57b8 | ||
|
|
e327be5bd8 | ||
|
|
a306de5c37 | ||
|
|
2c5d2a08ed | ||
|
|
5ea42a8bbf | ||
|
|
a3b7abbf0e | ||
|
|
1521b5ea31 | ||
|
|
653a0803e2 |
1
.github/workflows/push.yml
vendored
1
.github/workflows/push.yml
vendored
@@ -26,6 +26,7 @@ jobs:
|
||||
"S60",
|
||||
"S60P",
|
||||
"T55",
|
||||
"S99",
|
||||
"TS101",
|
||||
]
|
||||
fail-fast: true
|
||||
|
||||
@@ -104,7 +104,7 @@ This can be used for checking performance of the movement detection code.
|
||||
|
||||
This indicates the tip resistance that the device is currently using. For devices with multiple possible values to choose from (Pinecil V2), the appropriate value is automatically detected at every boot-up. Tip should be installed before boot-up or reading can not be done.
|
||||
|
||||
### Tip R
|
||||
### Tip uV
|
||||
|
||||
This is the raw tip reading in μV. Tip must be installed or reading will be high/inaccurate. At cool, the range of 700-1000 is normal for larger tips and ~1500 for smaller tips (TS80). This is used to evaluate the calibration routines.
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -52,7 +52,7 @@ DOCKER_CMD=$(DOCKER_BIN) -f $(DOCKER_YML) run --rm builder
|
||||
MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml
|
||||
|
||||
# supported models
|
||||
MODELS=TS100 TS80 TS80P Pinecil MHP30 Pinecilv2 S60 TS101 S60P T55 # target names & dir names
|
||||
MODELS=TS100 TS80 TS80P Pinecil MHP30 Pinecilv2 S60 TS101 S60P T55 S99 # target names & dir names
|
||||
MODELS_ML=Pinecil Pinecilv2 # target names
|
||||
MODELS_MULTILANG=Pinecil_multi-lang Pinecilv2_multi-lang # dir names
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ _This firmware does **NOT** support the USB port while running for changing sett
|
||||
| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
|
||||
| Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. |
|
||||
| Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. |
|
||||
| Sequre S60P | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. |
|
||||
| Sequre S60P | ✔️ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. |
|
||||
| Sequre S99 | ✔️ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. |
|
||||
| Sequre T55 | ❌ | ❌ | ✔️ | ❌ | ❌ | N/A | ✔️ | Full OLED resolution not yet supported. |
|
||||
| Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | |
|
||||
| Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌\*\* | |
|
||||
|
||||
@@ -163,7 +163,7 @@ def get_debug_menu() -> List[str]:
|
||||
"UpTime ",
|
||||
"Move ",
|
||||
"Tip Res",
|
||||
"Tip R ",
|
||||
"Tip uV ",
|
||||
"Tip O ",
|
||||
"HW G ",
|
||||
"HW M ",
|
||||
|
||||
@@ -19,37 +19,37 @@
|
||||
"message": "USB-PD\nnon détecté !"
|
||||
},
|
||||
"LockingKeysString": {
|
||||
"message": "VERROUIL"
|
||||
"message": "VERROUILLÉ"
|
||||
},
|
||||
"UnlockingKeysString": {
|
||||
"message": "DEVERROU"
|
||||
"message": "DEVERROUILLÉ"
|
||||
},
|
||||
"WarningKeysLockedString": {
|
||||
"message": "! VERR. !"
|
||||
},
|
||||
"WarningThermalRunaway": {
|
||||
"message": "Emballement\nthermique"
|
||||
"message": "Surchauffe\ncritique"
|
||||
},
|
||||
"WarningTipShorted": {
|
||||
"message": "!Tip Shorted!"
|
||||
"message": "!Court-circuit Panne!"
|
||||
},
|
||||
"SettingsCalibrationWarning": {
|
||||
"message": "Avant de redémarrer, assurez-vous que la panne et la poignée sont à température ambiante !"
|
||||
},
|
||||
"CJCCalibrating": {
|
||||
"message": "Etalonnage\n"
|
||||
"message": "Étalonnage\n"
|
||||
},
|
||||
"SettingsResetWarning": {
|
||||
"message": "Voulez-vous vraiment réinitialiser les paramètres aux valeurs par défaut ?"
|
||||
},
|
||||
"UVLOWarningString": {
|
||||
"message": "DC FAIBL"
|
||||
"message": "TENSION FAIBLE"
|
||||
},
|
||||
"UndervoltageString": {
|
||||
"message": "Sous-tension\n"
|
||||
},
|
||||
"InputVoltageString": {
|
||||
"message": "V d'entrée: \n"
|
||||
"message": "Tension d'entrée:\n"
|
||||
},
|
||||
"SleepingAdvancedString": {
|
||||
"message": "En veille...\n"
|
||||
@@ -58,10 +58,10 @@
|
||||
"message": "Panne: \n"
|
||||
},
|
||||
"ProfilePreheatString": {
|
||||
"message": "Preheat\n"
|
||||
"message": "Préchauffage\n"
|
||||
},
|
||||
"ProfileCooldownString": {
|
||||
"message": "Cooldown\n"
|
||||
"message": "Refroidissement\n"
|
||||
},
|
||||
"DeviceFailedValidationWarning": {
|
||||
"message": "Votre appareil semble être une contrefaçon !"
|
||||
@@ -107,22 +107,22 @@
|
||||
},
|
||||
"menuValues": {
|
||||
"USBPDModeDefault": {
|
||||
"displayText": "Default\nMode"
|
||||
"displayText": "Mode\npar Défaut"
|
||||
},
|
||||
"USBPDModeNoDynamic": {
|
||||
"displayText": "No\nDynamic"
|
||||
"displayText": "Non\nDynamique"
|
||||
},
|
||||
"USBPDModeSafe": {
|
||||
"displayText": "Safe\nMode"
|
||||
"displayText": "Mode\nSafe"
|
||||
},
|
||||
"TipTypeAuto": {
|
||||
"displayText": "Auto\nSense"
|
||||
"displayText": "Détéction\nAuto."
|
||||
},
|
||||
"TipTypeT12Long": {
|
||||
"displayText": "TS100\nLong"
|
||||
},
|
||||
"TipTypeT12Short": {
|
||||
"displayText": "Pine\nShort"
|
||||
"displayText": "Pine\nCourt"
|
||||
},
|
||||
"TipTypeT12PTS": {
|
||||
"displayText": "PTS\n200"
|
||||
@@ -137,7 +137,7 @@
|
||||
"menuOptions": {
|
||||
"DCInCutoff": {
|
||||
"displayText": "Source\nd'alim.",
|
||||
"description": "Source d'alimentation. Règle la tension de coupure (DC 10V) (S 3.3V par cellules, désactive la limite de puissance)"
|
||||
"description": "Source d'alimentation. Définit la tension de coupure (DC 10V) (S 3.3V par cellule, désactive la limite de puissance)"
|
||||
},
|
||||
"MinVolCell": {
|
||||
"displayText": "Tension\nminimale",
|
||||
@@ -149,18 +149,18 @@
|
||||
},
|
||||
"PDNegTimeout": {
|
||||
"displayText": "Délai\nexpir. PD",
|
||||
"description": "Délai de la negociation PD par étapes de 100ms pour la compatiblité avec certains chargeurs QC"
|
||||
"description": "Délai de négociation PD par paliers de 100ms pour la compatibilité avec certains chargeurs QC"
|
||||
},
|
||||
"USBPDMode": {
|
||||
"displayText": "PD\nMode",
|
||||
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
|
||||
"displayText": "Mode\nPD",
|
||||
"description": "Aucune dynamique ne désactive EPR & PPS, le mode sécurisé n'utilise pas de résistance de protection"
|
||||
},
|
||||
"BoostTemperature": {
|
||||
"displayText": "Temp.\nboost",
|
||||
"description": "Température utilisée en \"mode boost\""
|
||||
},
|
||||
"AutoStart": {
|
||||
"displayText": "Chauffer au\ndémarrage",
|
||||
"displayText": "Chauffer audémarrage",
|
||||
"description": "A=activé | V=mode veille | O=mode veille à température ambiante"
|
||||
},
|
||||
"TempChangeShortStep": {
|
||||
@@ -177,23 +177,23 @@
|
||||
},
|
||||
"ProfilePhases": {
|
||||
"displayText": "Profile\nPhases",
|
||||
"description": "Number of phases in profile mode"
|
||||
"description": "Nombre de phases dans le mode de profile"
|
||||
},
|
||||
"ProfilePreheatTemp": {
|
||||
"displayText": "Preheat\nTemp",
|
||||
"description": "Preheat to this temperature at the start of profile mode"
|
||||
"displayText": "Temp.\nPréchauffage",
|
||||
"description": "Préchauffer à cette température au début du mode de profile"
|
||||
},
|
||||
"ProfilePreheatSpeed": {
|
||||
"displayText": "Preheat\nSpeed",
|
||||
"description": "Preheat at this rate (degrees per second)"
|
||||
"displayText": "Vitesse\nPréchauffage",
|
||||
"description": "Préchauffer à cette vitesse (degrés par seconde)"
|
||||
},
|
||||
"ProfilePhase1Temp": {
|
||||
"displayText": "Phase 1\nTemp",
|
||||
"description": "Target temperature for the end of this phase"
|
||||
"displayText": "Temp.\nPhase 1",
|
||||
"description": "Température séléctionnée pour la fin de cette phase"
|
||||
},
|
||||
"ProfilePhase1Duration": {
|
||||
"displayText": "Phase 1\nDuration",
|
||||
"description": "Target duration of this phase (seconds)"
|
||||
"displayText": "Durée\nPhase 1",
|
||||
"description": "Durée séléctionnée pour cette phase (secondes)"
|
||||
},
|
||||
"ProfilePhase2Temp": {
|
||||
"displayText": "Phase 2\nTemp",
|
||||
@@ -228,12 +228,12 @@
|
||||
"description": ""
|
||||
},
|
||||
"ProfileCooldownSpeed": {
|
||||
"displayText": "Cooldown\nSpeed",
|
||||
"description": "Cooldown at this rate at the end of profile mode (degrees per second)"
|
||||
"displayText": "Vitesse de\nRefroidissement",
|
||||
"description": "Refroidissement à ce rythme à la fin du mode profil (degrés par seconde)"
|
||||
},
|
||||
"MotionSensitivity": {
|
||||
"displayText": "Sensibilité\nau mouvement",
|
||||
"description": "1=peu sensible | ... | 9=très sensible"
|
||||
"description": "1=très peu sensible | ... | 9=extrêmement sensible"
|
||||
},
|
||||
"SleepTemperature": {
|
||||
"displayText": "Temp.\nveille",
|
||||
@@ -252,15 +252,15 @@
|
||||
"description": "Sensibilité du capteur à effet Hall pour la mise en veille (1=peu sensible | ... | 9=très sensible)"
|
||||
},
|
||||
"HallEffSleepTimeout": {
|
||||
"displayText": "HallSensor\nSleepTime",
|
||||
"displayText": "TempsVeille\nCapteurHall",
|
||||
"description": "Intervalle avant le démarrage du \"mode veille\" lorsque l'effet Hall est supérieur au seuil"
|
||||
},
|
||||
"TemperatureUnit": {
|
||||
"displayText": "Unité de\ntempérature",
|
||||
"displayText": "Unité de température",
|
||||
"description": "C=Celsius | F=Fahrenheit"
|
||||
},
|
||||
"DisplayRotation": {
|
||||
"displayText": "Orientation\nde l'écran",
|
||||
"displayText": "Orientation de l'écran",
|
||||
"description": "D=droitier | G=gaucher | A=automatique"
|
||||
},
|
||||
"CooldownBlink": {
|
||||
@@ -268,7 +268,7 @@
|
||||
"description": "Faire clignoter la température lors du refroidissement tant que la panne est chaude"
|
||||
},
|
||||
"ScrollingSpeed": {
|
||||
"displayText": "Vitesse de\ndéfilement",
|
||||
"displayText": "Vitesse de défilement",
|
||||
"description": "Vitesse de défilement du texte (R=rapide | L=lent)"
|
||||
},
|
||||
"ReverseButtonTempChange": {
|
||||
@@ -276,7 +276,7 @@
|
||||
"description": "Inverser les boutons d'ajustement de température"
|
||||
},
|
||||
"AnimSpeed": {
|
||||
"displayText": "Vitesse\nanim. icônes",
|
||||
"displayText": "Vitesse anim. icônes",
|
||||
"description": "Vitesse des animations des icônes dans le menu (L=lente | M=moyenne | R=rapide)"
|
||||
},
|
||||
"AnimLoop": {
|
||||
@@ -340,8 +340,8 @@
|
||||
"description": ""
|
||||
},
|
||||
"SolderingTipType": {
|
||||
"displayText": "Soldering\nTip Type",
|
||||
"description": "Select the tip type fitted"
|
||||
"displayText": "Soudure\nType de panne",
|
||||
"description": "Séléctionner le type de panne utilisé"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
},
|
||||
{
|
||||
"id": "NoPowerDeliveryMessage",
|
||||
"include": ["POW_PD"],
|
||||
"include": ["POW_PD", "POW_PD_EXT"],
|
||||
"description": "The IC required for USB-PD could not be communicated with. This is an error warning that USB-PD WILL NOT FUNCTION. Generally indicative of either a hardware or software issues."
|
||||
},
|
||||
{
|
||||
@@ -264,14 +264,14 @@
|
||||
"id": "PDNegTimeout",
|
||||
"maxLen": 8,
|
||||
"maxLen2": 15,
|
||||
"include": ["POW_PD"],
|
||||
"include": ["POW_PD", "POW_PD_EXT"],
|
||||
"description": "How long until firmware stops trying to negotiate for USB-PD and tries QC instead. Longer times may help dodgy / old PD adapters, faster times move onto PD quickly. Units of 100ms. Recommended to keep small values."
|
||||
},
|
||||
{
|
||||
"id": "USBPDMode",
|
||||
"maxLen": 7,
|
||||
"maxLen2": 15,
|
||||
"include": ["POW_PD"],
|
||||
"include": ["POW_PD", "POW_PD_EXT"],
|
||||
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Default Reference Distro for development env & deploy:
|
||||
# * Alpine Linux, version 3.21 *
|
||||
# * Alpine Linux, version 3.19 *
|
||||
|
||||
FROM alpine:3.21
|
||||
FROM alpine:3.19
|
||||
LABEL maintainer="Ben V. Brown <ralim@ralimtek.com>"
|
||||
|
||||
# Default current dir when container starts
|
||||
|
||||
@@ -105,12 +105,12 @@ extern uint32_t SystemCoreClock;
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
|
||||
#define configMAX_TASK_NAME_LEN (32)
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configUSE_TIMERS 0
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2 /*Bump this to 2 during development and bug hunting*/
|
||||
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
#define PROFILE_SUPPORT
|
||||
#define OLED_96x16 1
|
||||
#define POW_PD 1
|
||||
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
#define POW_PD_EXT 0
|
||||
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
|
||||
#define TEMP_NTC
|
||||
|
||||
@@ -105,12 +105,12 @@ extern uint32_t SystemCoreClock;
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
|
||||
#define configMAX_TASK_NAME_LEN (32)
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configUSE_TIMERS 0
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2 /*Bump this to 2 during development and bug hunting*/
|
||||
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
#define ADC_VDD_MV 3300 // ADC max reading millivolts
|
||||
|
||||
#define POW_PD_EXT 0
|
||||
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
|
||||
// Deriving the Voltage div:
|
||||
// Vin_max = (3.3*(r1+r2))/(r2)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define configMAX_PRIORITIES (4)
|
||||
#define configMINIMAL_STACK_SIZE ((unsigned short)128)
|
||||
#define configMAX_TASK_NAME_LEN 24
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 0
|
||||
#define configUSE_TASK_NOTIFICATIONS 1
|
||||
#define configUSE_MUTEXES 1
|
||||
@@ -21,7 +22,6 @@
|
||||
#define configUSE_TIME_SLICING 1
|
||||
#define configUSE_NEWLIB_REENTRANT 0
|
||||
#define configENABLE_BACKWARD_COMPATIBILITY 0
|
||||
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
|
||||
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
|
||||
@@ -149,6 +149,7 @@
|
||||
#define POW_PD 1
|
||||
#define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */
|
||||
#define POW_PD_EXT 0
|
||||
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
#define POW_QC 1
|
||||
#define POW_DC 1
|
||||
#define POW_QC_20V 1
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 8)
|
||||
#define configMAX_TASK_NAME_LEN (24)
|
||||
#define configUSE_TRACE_FACILITY 0
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configIDLE_SHOULD_YIELD 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
@@ -29,7 +30,6 @@
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
||||
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
|
||||
#define configUSE_TICKLESS_IDLE 0
|
||||
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
|
||||
@@ -133,8 +133,6 @@ int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_att
|
||||
memcpy(buf, &temp, sizeof(temp));
|
||||
return sizeof(temp);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
MSG((char *)"Unhandled attr read %d | %d\n", (uint32_t)attr->uuid, uuid_value);
|
||||
return 0;
|
||||
@@ -152,7 +150,7 @@ int ble_char_read_bulk_value_callback(struct bt_conn *conn, const struct bt_gatt
|
||||
// Bulk data
|
||||
{
|
||||
uint32_t bulkData[] = {
|
||||
(uint32_t)TipThermoModel::getTipInC(), // 0 - Current temp
|
||||
TipThermoModel::getTipInC(), // 0 - Current temp
|
||||
getSettingValue(SettingsOptions::SolderingTemp), // 1 - Setpoint
|
||||
getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0), // 2 - Input voltage
|
||||
getHandleTemperature(0), // 3 - Handle X10 Temp in C
|
||||
@@ -161,9 +159,9 @@ int ble_char_read_bulk_value_callback(struct bt_conn *conn, const struct bt_gatt
|
||||
getTipResistanceX10(), // 6 - Tip resistance
|
||||
xTaskGetTickCount() / TICKS_100MS, // 7 - uptime in deciseconds
|
||||
lastMovementTime / TICKS_100MS, // 8 - last movement time (deciseconds)
|
||||
(uint32_t)TipThermoModel::getTipMaxInC(), // 9 - max temp
|
||||
TipThermoModel::getTipMaxInC(), // 9 - max temp
|
||||
TipThermoModel::convertTipRawADCTouV(getTipRawTemp(0), true), // 10 - Raw tip in μV
|
||||
(uint32_t)abs(getRawHallEffect()), // 11 - hall sensor
|
||||
abs(getRawHallEffect()), // 11 - hall sensor
|
||||
(uint32_t)currentOperatingMode, // 12 - Operating mode
|
||||
x10WattHistory.average(), // 13 - Estimated Wattage *10
|
||||
};
|
||||
|
||||
@@ -148,6 +148,7 @@
|
||||
#define POW_PD 1 // Supported features
|
||||
#define USB_PD_EPR_WATTAGE 140 // USB PD EPR Wattage
|
||||
#define POW_PD_EXT 0 // Future-proof macro for other models with other PD modes
|
||||
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
#define POW_QC 1 // Supported features
|
||||
#define POW_DC 1 // Supported features
|
||||
#define POW_QC_20V 1 // Supported features
|
||||
|
||||
@@ -126,77 +126,7 @@ void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) {
|
||||
}
|
||||
}
|
||||
|
||||
void unstick_I2C() {
|
||||
#ifdef SCL_Pin
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
int timeout = 100;
|
||||
int timeout_cnt = 0;
|
||||
|
||||
// 1. Clear PE bit.
|
||||
hi2c1.Instance->CR1 &= ~(0x0001);
|
||||
/**I2C1 GPIO Configuration
|
||||
PB6 ------> I2C1_SCL
|
||||
PB7 ------> I2C1_SDA
|
||||
*/
|
||||
// 2. Configure the SCL and SDA I/Os as General Purpose Output Open-Drain, High level (Write 1 to GPIOx_ODR).
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
||||
GPIO_InitStruct.Pin = SCL_Pin;
|
||||
HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET);
|
||||
|
||||
GPIO_InitStruct.Pin = SDA_Pin;
|
||||
HAL_GPIO_Init(SDA_GPIO_Port, &GPIO_InitStruct);
|
||||
HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET);
|
||||
|
||||
while (GPIO_PIN_SET != HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin)) {
|
||||
// Move clock to release I2C
|
||||
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET);
|
||||
asm("nop");
|
||||
asm("nop");
|
||||
asm("nop");
|
||||
asm("nop");
|
||||
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET);
|
||||
|
||||
timeout_cnt++;
|
||||
if (timeout_cnt > timeout) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 12. Configure the SCL and SDA I/Os as Alternate function Open-Drain.
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
|
||||
GPIO_InitStruct.Pin = SCL_Pin;
|
||||
HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = SDA_Pin;
|
||||
HAL_GPIO_Init(SDA_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET);
|
||||
HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET);
|
||||
|
||||
// 13. Set SWRST bit in I2Cx_CR1 register.
|
||||
hi2c1.Instance->CR1 |= 0x8000;
|
||||
|
||||
asm("nop");
|
||||
|
||||
// 14. Clear SWRST bit in I2Cx_CR1 register.
|
||||
hi2c1.Instance->CR1 &= ~0x8000;
|
||||
|
||||
asm("nop");
|
||||
|
||||
// 15. Enable the I2C peripheral by setting the PE bit in I2Cx_CR1 register
|
||||
hi2c1.Instance->CR1 |= 0x0001;
|
||||
|
||||
// Call initialization function.
|
||||
HAL_I2C_Init(&hi2c1);
|
||||
#endif
|
||||
}
|
||||
void unstick_I2C() {}
|
||||
|
||||
uint8_t getButtonA() { return HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0; }
|
||||
uint8_t getButtonB() { return HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ? 1 : 0; }
|
||||
|
||||
@@ -105,12 +105,12 @@ extern uint32_t SystemCoreClock;
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)256)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
|
||||
#define configMAX_TASK_NAME_LEN (32)
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 8
|
||||
#define configUSE_TIMERS 0
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 2 /*Bump this to 2 during development and bug hunting*/
|
||||
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
|
||||
|
||||
/* Co-routine definitions. */
|
||||
#define configUSE_CO_ROUTINES 0
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Author: Ralim
|
||||
*/
|
||||
|
||||
#ifndef BSP_MINIWARE_PINS_H_
|
||||
#define BSP_MINIWARE_PINS_H_
|
||||
#ifndef BSP_SEQURE_PINS_H_
|
||||
#define BSP_SEQURE_PINS_H_
|
||||
#include "configuration.h"
|
||||
|
||||
#ifdef MODEL_S60
|
||||
@@ -65,6 +65,45 @@
|
||||
#define SCL2_GPIO_Port GPIOB
|
||||
#define SDA2_Pin GPIO_PIN_7
|
||||
#define SDA2_GPIO_Port GPIOB
|
||||
#define SCL_Pin GPIO_PIN_11
|
||||
#define SCL_GPIO_Port GPIOB
|
||||
#define SDA_Pin GPIO_PIN_10
|
||||
#define SDA_GPIO_Port GPIOB
|
||||
// Pin gets pulled high on movement
|
||||
#define MOVEMENT_Pin GPIO_PIN_3
|
||||
#define MOVEMENT_GPIO_Port GPIOA
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef MODEL_S99
|
||||
|
||||
#define KEY_B_Pin GPIO_PIN_1
|
||||
#define KEY_B_GPIO_Port GPIOB
|
||||
#define TMP36_INPUT_Pin GPIO_PIN_5
|
||||
#define TMP36_INPUT_GPIO_Port GPIOA
|
||||
#define TMP36_ADC1_CHANNEL ADC_CHANNEL_5
|
||||
#define TMP36_ADC2_CHANNEL ADC_CHANNEL_5
|
||||
#define TIP_TEMP_Pin GPIO_PIN_0
|
||||
#define TIP_TEMP_GPIO_Port GPIOA
|
||||
#define TIP_TEMP_ADC1_CHANNEL ADC_CHANNEL_0
|
||||
#define TIP_TEMP_ADC2_CHANNEL ADC_CHANNEL_0
|
||||
#define VIN_Pin GPIO_PIN_4
|
||||
#define VIN_GPIO_Port GPIOA
|
||||
#define VIN_ADC1_CHANNEL ADC_CHANNEL_4
|
||||
#define VIN_ADC2_CHANNEL ADC_CHANNEL_4
|
||||
#define KEY_A_Pin GPIO_PIN_0
|
||||
#define KEY_A_GPIO_Port GPIOB
|
||||
#define PWM_Out_Pin GPIO_PIN_8
|
||||
#define PWM_Out_GPIO_Port GPIOB
|
||||
#define PWM_Out_CHANNEL TIM_CHANNEL_3 // Timer 4; channel 3
|
||||
#define SCL2_Pin GPIO_PIN_6
|
||||
#define SCL2_GPIO_Port GPIOB
|
||||
#define SDA2_Pin GPIO_PIN_7
|
||||
#define SDA2_GPIO_Port GPIOB
|
||||
#define SCL_Pin GPIO_PIN_11
|
||||
#define SCL_GPIO_Port GPIOB
|
||||
#define SDA_Pin GPIO_PIN_10
|
||||
#define SDA_GPIO_Port GPIOB
|
||||
// Pin gets pulled high on movement
|
||||
#define MOVEMENT_Pin GPIO_PIN_3
|
||||
#define MOVEMENT_GPIO_Port GPIOA
|
||||
@@ -98,4 +137,4 @@
|
||||
|
||||
#endif // MODEL_T55
|
||||
|
||||
#endif /* BSP_MINIWARE_PINS_H_ */
|
||||
#endif /* BSP_SEQURE_PINS_H_ */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "BSP.h"
|
||||
#include "BSP_Power.h"
|
||||
#include "FS2711.hpp"
|
||||
#include "Pins.h"
|
||||
#include "QC3.h"
|
||||
#include "Settings.h"
|
||||
@@ -16,9 +17,26 @@ void power_check() {
|
||||
return; // We are using PD
|
||||
}
|
||||
#endif
|
||||
#if POW_PD_EXT == 2
|
||||
if (FS2711::has_run_selection()) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef POW_QC
|
||||
QC_resync();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool getIsPoweredByDCIN() { return false; }
|
||||
bool getIsPoweredByDCIN() {
|
||||
#if POW_PD_EXT == 2 && defined(POW_DC)
|
||||
if (!FS2711::has_run_selection()) {
|
||||
return true;
|
||||
} else if (FS2711::debug_get_state().source_voltage > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# BSP section for STM32F103 based Miniware products
|
||||
# BSP section for STM32F103 based Sequre products
|
||||
|
||||
This folder contains the hardware abstractions required for the TS100, TS80 and probably TS80P soldering irons.
|
||||
This folder contains the hardware abstractions required for the S60, S60P and S99 soldering irons.
|
||||
|
||||
## Main abstractions
|
||||
|
||||
|
||||
@@ -5,19 +5,32 @@
|
||||
* Author: Ralim
|
||||
*/
|
||||
|
||||
#ifndef BSP_MINIWARE_SOFTWARE_I2C_H_
|
||||
#define BSP_MINIWARE_SOFTWARE_I2C_H_
|
||||
#ifndef BSP_SEQURE_SOFTWARE_I2C_H_
|
||||
#define BSP_SEQURE_SOFTWARE_I2C_H_
|
||||
#include "BSP.h"
|
||||
#include "configuration.h"
|
||||
#include "stm32f1xx_hal.h"
|
||||
#ifdef I2C_SOFT_BUS_2
|
||||
|
||||
#ifdef I2C_SOFT_BUS_1
|
||||
#define SOFT_SCL1_HIGH() HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET)
|
||||
#define SOFT_SCL1_LOW() HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET)
|
||||
#define SOFT_SDA1_HIGH() HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET)
|
||||
#define SOFT_SDA1_LOW() HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_RESET)
|
||||
#define SOFT_SDA1_READ() (HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin) == GPIO_PIN_SET ? 1 : 0)
|
||||
#define SOFT_SCL1_READ() (HAL_GPIO_ReadPin(SCL_GPIO_Port, SCL_Pin) == GPIO_PIN_SET ? 1 : 0)
|
||||
|
||||
#endif /* I2C_SOFT_BUS_1 */
|
||||
|
||||
#ifdef I2C_SOFT_BUS_2
|
||||
#define SOFT_SCL2_HIGH() HAL_GPIO_WritePin(SCL2_GPIO_Port, SCL2_Pin, GPIO_PIN_SET)
|
||||
#define SOFT_SCL2_LOW() HAL_GPIO_WritePin(SCL2_GPIO_Port, SCL2_Pin, GPIO_PIN_RESET)
|
||||
#define SOFT_SDA2_HIGH() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_SET)
|
||||
#define SOFT_SDA2_LOW() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_RESET)
|
||||
#define SOFT_SDA2_READ() (HAL_GPIO_ReadPin(SDA2_GPIO_Port, SDA2_Pin) == GPIO_PIN_SET ? 1 : 0)
|
||||
#define SOFT_SCL2_READ() (HAL_GPIO_ReadPin(SCL2_GPIO_Port, SCL2_Pin) == GPIO_PIN_SET ? 1 : 0)
|
||||
|
||||
#endif /* I2C_SOFT_BUS_2 */
|
||||
|
||||
// clang-format off
|
||||
#define SOFT_I2C_DELAY() \
|
||||
{ \
|
||||
@@ -27,7 +40,6 @@
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
#endif
|
||||
// 40 ~= 100kHz; 15 gives around 250kHz or so which is fast _and_ stable
|
||||
|
||||
#endif /* BSP_MINIWARE_SOFTWARE_I2C_H_ */
|
||||
#endif /* BSP_SEQURE_SOFTWARE_I2C_H_ */
|
||||
|
||||
@@ -83,3 +83,10 @@ TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) {
|
||||
#ifdef TEMP_uV_LOOKUP_S60
|
||||
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; }
|
||||
#endif // TEMP_uV_LOOKUP_S60
|
||||
|
||||
#ifdef TEMP_uV_LOOKUP_S99
|
||||
// 42.85 uV / K -> 1/42.85 K/uV = 20/857
|
||||
// TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 20) / 857; }
|
||||
// Measurement is probably with heating element in series, thats why the reading differs from the approx 42.85 uV/K
|
||||
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 1) / 30; }
|
||||
#endif // TEMP_uV_LOOKUP_S99
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
// Vin_max = (3.3*(r1+r2))/(r2)
|
||||
// vdiv = (32768*4)/(vin_max*10)
|
||||
|
||||
#if defined(MODEL_S60) + defined(MODEL_S60P) + defined(MODEL_T55) == 0
|
||||
#if defined(MODEL_S60) + defined(MODEL_S60P) + defined(MODEL_T55) + defined(MODEL_S99) == 0
|
||||
#error "No model defined!"
|
||||
#endif
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
|
||||
#define THERMAL_RUNAWAY_TIME_SEC 20
|
||||
#define THERMAL_RUNAWAY_TEMP_C 3
|
||||
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
|
||||
#define HARDWARE_MAX_WATTAGE_X10 600
|
||||
|
||||
@@ -168,6 +169,7 @@
|
||||
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
|
||||
#define THERMAL_RUNAWAY_TIME_SEC 20
|
||||
#define THERMAL_RUNAWAY_TEMP_C 3
|
||||
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
|
||||
#define HARDWARE_MAX_WATTAGE_X10 600
|
||||
|
||||
@@ -180,10 +182,13 @@
|
||||
#define GPIO_VIBRATION
|
||||
#define POW_PD_EXT 2
|
||||
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
|
||||
#define POW_DC
|
||||
#define DEBUG_POWER_MENU_BUTTON_B 1
|
||||
#define HAS_POWER_DEBUG_MENU
|
||||
#define TEMP_NTC
|
||||
#define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues
|
||||
#define I2C_PROBE_POW_PD // For now we are doing software I2C to get around hardware chip issues
|
||||
#define I2C_SOFT_BUS_1 // For now we are doing software I2C to get around hardware chip issues
|
||||
#define OLED_I2CBB2
|
||||
#define FILTER_DISPLAYED_TIP_TEMP 4 // Filtering for GUI display
|
||||
|
||||
@@ -206,6 +211,8 @@
|
||||
#define OP_AMP_GAIN_STAGE 1
|
||||
#define TEMP_uV_LOOKUP_PT1000
|
||||
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
|
||||
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
|
||||
#define NO_DISPLAY_ROTATE // Disable OLED rotation by accel
|
||||
#define MAX_TEMP_C 350 // Max soldering temp selectable °C
|
||||
#define MAX_TEMP_F 660 // Max soldering temp selectable °F
|
||||
@@ -239,6 +246,44 @@
|
||||
#define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place
|
||||
#endif /* T55 */
|
||||
|
||||
#ifdef MODEL_S99
|
||||
#define VOLTAGE_DIV 460 // Default divider scaler
|
||||
#define CALIBRATION_OFFSET 200 // Default adc offset in uV
|
||||
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
|
||||
#define POWER_LIMIT 0 // 0 watts default limit
|
||||
#define MAX_POWER_LIMIT 70
|
||||
#define POWER_LIMIT_STEPS 5
|
||||
#define OP_AMP_GAIN_STAGE 237 // Two sequential op-amps 1st: 1+(9k29/997R)=10.31 2nd: 1+(22k/1k)=23 -> 10.31*23=237
|
||||
#define TEMP_uV_LOOKUP_S99
|
||||
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
|
||||
#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms
|
||||
|
||||
#define HARDWARE_MAX_WATTAGE_X10 1300
|
||||
|
||||
#define TIP_THERMAL_MASS 8 // X10 watts to raise 1 deg C in 1 second
|
||||
#define TIP_THERMAL_INERTIA 128 // We use a large inertia value to smooth out the drive to the tip since its stupidly sensitive
|
||||
#define THERMAL_RUNAWAY_TIME_SEC 20
|
||||
#define THERMAL_RUNAWAY_TEMP_C 10
|
||||
|
||||
#define TIP_RESISTANCE 20 //(actually 2.5 ish but we need to be more conservative on pwm'ing watt limit) x10 ohms
|
||||
|
||||
#define OLED_128x32
|
||||
#define GPIO_VIBRATION
|
||||
#define POW_PD_EXT 2
|
||||
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
|
||||
#define POW_DC
|
||||
#define DEBUG_POWER_MENU_BUTTON_B 1
|
||||
#define HAS_POWER_DEBUG_MENU
|
||||
#define TEMP_NTC
|
||||
#define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues
|
||||
#define I2C_PROBE_POW_PD // For now we are doing software I2C to get around hardware chip issues
|
||||
#define I2C_SOFT_BUS_1 // For now we are doing software I2C to get around hardware chip issues
|
||||
#define OLED_I2CBB2
|
||||
#define FILTER_DISPLAYED_TIP_TEMP 4 // Filtering for GUI display
|
||||
|
||||
#define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place
|
||||
#endif /* S99 */
|
||||
|
||||
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
|
||||
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
|
||||
|
||||
|
||||
@@ -6,10 +6,14 @@
|
||||
*/
|
||||
|
||||
#include "BSP.h"
|
||||
#include "I2CBB1.hpp"
|
||||
#include "I2CBB2.hpp"
|
||||
#include "Pins.h"
|
||||
#include "Setup.h"
|
||||
#include <I2C_Wrapper.hpp>
|
||||
#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2
|
||||
#include "FS2711.hpp"
|
||||
#endif
|
||||
|
||||
void preRToSInit() {
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
|
||||
@@ -17,7 +21,14 @@ void preRToSInit() {
|
||||
HAL_Init();
|
||||
Setup_HAL(); // Setup all the HAL objects
|
||||
BSPInit();
|
||||
#ifdef I2C_SOFT_BUS_1
|
||||
I2CBB1::init();
|
||||
#endif /* I2C_SOFT_BUS_1 */
|
||||
#ifdef I2C_SOFT_BUS_2
|
||||
I2CBB2::init();
|
||||
#endif
|
||||
#endif /* I2C_SOFT_BUS_2 */
|
||||
#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2
|
||||
// Detect and set FS2711 I2C bus num
|
||||
FS2711::detect_i2c_bus_num();
|
||||
#endif /* defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 */
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
#include "BSP.h"
|
||||
#include "FS2711.hpp"
|
||||
#include "FS2711_defines.h"
|
||||
#include "I2CBB1.hpp"
|
||||
#include "I2CBB2.hpp"
|
||||
#include "Settings.h"
|
||||
#include "Utils.h"
|
||||
#include "cmsis_os.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -15,31 +17,61 @@
|
||||
#error Max PD Voltage must be defined
|
||||
#endif
|
||||
|
||||
#define PROTOCOL_TIMEOUT 100 // ms
|
||||
|
||||
extern int32_t powerSupplyWattageLimit;
|
||||
|
||||
uint8_t I2C_PORT = 2;
|
||||
|
||||
fs2711_state_t FS2711::state;
|
||||
|
||||
inline void i2c_write(uint8_t addr, uint8_t data) { I2CBB2::Mem_Write(FS2711_ADDR, addr, &data, 1); }
|
||||
void i2c_write(uint8_t addr, uint8_t data) {
|
||||
if (I2C_PORT == 2) {
|
||||
I2CBB2::Mem_Write(FS2711_ADDR, addr, &data, 1);
|
||||
} else if (I2C_PORT == 1) {
|
||||
I2CBB1::Mem_Write(FS2711_ADDR, addr, &data, 1);
|
||||
}
|
||||
}
|
||||
|
||||
inline uint8_t i2c_read(uint8_t addr) {
|
||||
uint8_t i2c_read(uint8_t addr) {
|
||||
uint8_t data = 0;
|
||||
if (I2C_PORT == 2) {
|
||||
I2CBB2::Mem_Read(FS2711_ADDR, addr, &data, 1);
|
||||
} else if (I2C_PORT == 1) {
|
||||
I2CBB1::Mem_Read(FS2711_ADDR, addr, &data, 1);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
inline bool i2c_probe(uint8_t addr) { return I2CBB2::probe(addr); }
|
||||
bool i2c_probe(uint8_t addr) {
|
||||
bool probing_state = false;
|
||||
if (I2C_PORT == 2) {
|
||||
probing_state = I2CBB2::probe(addr);
|
||||
} else if (I2C_PORT == 1) {
|
||||
probing_state = I2CBB1::probe(addr);
|
||||
}
|
||||
return probing_state;
|
||||
}
|
||||
|
||||
uint8_t FS2711::detect_i2c_bus_num() {
|
||||
I2CBB2::probe(88);
|
||||
I2CBB2::probe(89);
|
||||
if (I2CBB2::probe(FS2711_ADDR)) {
|
||||
I2C_PORT = 2;
|
||||
} else {
|
||||
I2C_PORT = 1;
|
||||
}
|
||||
return I2C_PORT;
|
||||
}
|
||||
|
||||
void FS2711::start() {
|
||||
memset(&state, 0, sizeof(fs2711_state_t));
|
||||
state.req_pdo_num = 0xFF;
|
||||
|
||||
enable_protocol(false);
|
||||
osDelay(PROTOCOL_TIMEOUT);
|
||||
// PDNegTimeout is in 100ms, so x100 for ms
|
||||
osDelay(getSettingValue(SettingsOptions::PDNegTimeout) * 100);
|
||||
select_protocol(FS2711_PROTOCOL_PD);
|
||||
enable_protocol(true);
|
||||
osDelay(PROTOCOL_TIMEOUT);
|
||||
osDelay(getSettingValue(SettingsOptions::PDNegTimeout) * 100);
|
||||
}
|
||||
|
||||
uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); }
|
||||
@@ -163,6 +195,11 @@ void FS2711::negotiate() {
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
|
||||
tip_resistance += 5;
|
||||
}
|
||||
#ifdef MODEL_HAS_DCDC
|
||||
// If this device has step down DC/DC inductor to smooth out current spikes
|
||||
// We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit
|
||||
tip_resistance = 255; // (Push to 25.5 ohms to effectively disable this check)
|
||||
#endif
|
||||
|
||||
uint16_t pdo_min_mv = 0, pdo_max_mv = 0, pdo_max_curr = 0, pdo_type = 0;
|
||||
|
||||
@@ -228,7 +265,7 @@ bool FS2711::has_run_selection() { return state.req_pdo_num != 0xFF; }
|
||||
|
||||
uint16_t FS2711::source_voltage() { return state.source_voltage / 1000; }
|
||||
|
||||
// FS2711 does current in mV so it needs to be converted to x100 intead of x1000
|
||||
// FS2711 does current in mA so it needs to be converted to x100 intead of x1000
|
||||
uint16_t FS2711::source_currentx100() { return state.source_current / 10; }
|
||||
|
||||
uint16_t FS2711::debug_pdo_max_voltage(uint8_t pdoid) { return state.pdo_max_volt[pdoid]; }
|
||||
|
||||
@@ -19,6 +19,8 @@ typedef struct {
|
||||
|
||||
class FS2711 {
|
||||
public:
|
||||
static uint8_t detect_i2c_bus_num();
|
||||
|
||||
static bool probe();
|
||||
|
||||
static void start();
|
||||
|
||||
@@ -93,8 +93,8 @@
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x30, 0x0C, 0x02, 0xF1, 0xF1, 0xF1, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xC0, 0xB0, 0x8C, 0x83, 0x80, 0x80, 0x80, 0x80, 0xB3, 0xB3, 0xB3, 0x80, 0x80, 0x80, 0x80, 0x83, 0x8C, 0xB0, 0xC0, 0x00, 0x00};
|
||||
|
||||
#if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_TS101) || defined(MODEL_T55)
|
||||
#if defined(MODEL_S60) || defined(MODEL_S60P)
|
||||
#if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_TS101) || defined(MODEL_T55) || defined(MODEL_S99)
|
||||
#if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_S99)
|
||||
const uint8_t buttonA[] = {
|
||||
// width = 56
|
||||
// height = 32
|
||||
|
||||
@@ -14,6 +14,7 @@ void I2CBB2::init() {
|
||||
// Set GPIO's to output open drain
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
|
||||
GPIO_InitStruct.Pin = SDA2_Pin;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
|
||||
|
||||
@@ -87,7 +87,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
||||
{ 0, 9, 1, 0}, // AccelMissingWarningCounter
|
||||
{ 0, 9, 1, 0}, // PDMissingWarningCounter
|
||||
{ 0, 0xFFFF, 0, 41431 /*EN*/}, // UILanguage
|
||||
{ 0, 50, 1, 20}, // PDNegTimeout
|
||||
{ 0, 50, 1, USB_PD_TIMEOUT}, // PDNegTimeout
|
||||
{ 0, 1, 1, 0}, // OLEDInversion
|
||||
{ MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness
|
||||
{ 0, 6, 1, 1}, // LOGOTime
|
||||
|
||||
@@ -26,7 +26,7 @@ static void displayInputMinVRange(void);
|
||||
static void displayQCInputV(void);
|
||||
#endif /* POW_QC */
|
||||
|
||||
#ifdef POW_PD
|
||||
#if defined(POW_PD) || POW_PD_EXT == 2
|
||||
static void displayPDNegTimeout(void);
|
||||
static void displayUSBPDMode(void);
|
||||
#endif /* POW_PD */
|
||||
@@ -123,9 +123,9 @@ static bool showSolderingTipType(void);
|
||||
|
||||
// Menu functions
|
||||
|
||||
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
|
||||
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || defined(POW_PD) || POW_PD_EXT == 2
|
||||
static void displayPowerMenu(void);
|
||||
#endif /* POW_DC or POW_QC */
|
||||
#endif /* POW_DC or POW_QC or POW_PD or POD_PD_EXT 2*/
|
||||
|
||||
static void displaySolderingMenu(void);
|
||||
static void displayPowerSavingMenu(void);
|
||||
@@ -236,7 +236,7 @@ const menuitem rootSettingsMenu[] {
|
||||
/* ^^^^ end of menu marker. DO NOT REMOVE ^^^^ */
|
||||
};
|
||||
|
||||
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
|
||||
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2
|
||||
const menuitem powerMenu[] = {
|
||||
/*
|
||||
* Power Source
|
||||
@@ -255,7 +255,7 @@ const menuitem powerMenu[] = {
|
||||
/* Voltage input */
|
||||
{SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), nullptr, displayQCInputV, nullptr, SettingsOptions::QCIdealVoltage, SettingsItemIndex::QCMaxVoltage, 4},
|
||||
#endif
|
||||
#ifdef POW_PD
|
||||
#if defined(POW_PD) || POW_PD_EXT == 2
|
||||
/* PD timeout setup */
|
||||
{SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 6},
|
||||
/* Toggle PPS & EPR */
|
||||
@@ -451,7 +451,7 @@ const menuitem advancedMenu[] = {
|
||||
/* clang-format on */
|
||||
|
||||
const menuitem *subSettingsMenus[] {
|
||||
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
|
||||
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2
|
||||
powerMenu,
|
||||
#endif
|
||||
solderingMenu, PowerSavingMenu, UIMenu, advancedMenu,
|
||||
@@ -536,7 +536,7 @@ static void displayQCInputV(void) {
|
||||
|
||||
#endif /* POW_QC */
|
||||
|
||||
#ifdef POW_PD /* POW_PD */
|
||||
#if defined(POW_PD) || POW_PD_EXT == 2 /* POW_PD */
|
||||
|
||||
static void displayPDNegTimeout(void) {
|
||||
auto value = getSettingValue(SettingsOptions::PDNegTimeout);
|
||||
|
||||
@@ -23,6 +23,10 @@ extern "C" {
|
||||
#include "USBPD.h"
|
||||
#include "pd.h"
|
||||
#endif
|
||||
#if POW_PD_EXT == 2
|
||||
#include "FS2711.hpp"
|
||||
#include "FS2711_defines.h"
|
||||
#endif
|
||||
|
||||
enum class OperatingMode {
|
||||
StartupLogo=10, // Showing the startup logo
|
||||
|
||||
@@ -63,6 +63,13 @@ int8_t getPowerSourceNumber(void) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if POW_PD_EXT == 2
|
||||
if (FS2711::has_run_selection()) {
|
||||
poweredbyPD = true;
|
||||
// FS2711IC has VBUS always connected
|
||||
pdHasVBUSConnected = true;
|
||||
}
|
||||
#endif
|
||||
if (poweredbyPD) {
|
||||
if (pdHasVBUSConnected) {
|
||||
|
||||
@@ -6,7 +6,7 @@ ALL_MINIWARE_MODELS=TS100 TS80 TS80P TS101
|
||||
ALL_PINECIL_MODELS=Pinecil
|
||||
ALL_PINECIL_V2_MODELS=Pinecilv2
|
||||
ALL_MHP30_MODELS=MHP30
|
||||
ALL_SEQURE_MODELS=S60 S60P T55
|
||||
ALL_SEQURE_MODELS=S60 S60P T55 S99
|
||||
ALL_MODELS=$(ALL_MINIWARE_MODELS) $(ALL_PINECIL_MODELS) $(ALL_MHP30_MODELS) $(ALL_PINECIL_V2_MODELS) $(ALL_SEQURE_MODELS)
|
||||
|
||||
ifneq ($(model),$(filter $(model),$(ALL_MODELS)))
|
||||
@@ -145,6 +145,9 @@ flash_size=62k
|
||||
ifeq ($(model), S60P)
|
||||
bootldr_size=0x5000
|
||||
DEVICE_DFU_ADDRESS=0x08005000
|
||||
else ifeq ($(model), S99)
|
||||
bootldr_size=0x4c00
|
||||
DEVICE_DFU_ADDRESS=0x08004c00
|
||||
else
|
||||
# S60 or T55
|
||||
bootldr_size=0x4400
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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 +28,7 @@
|
||||
#include "task.h"
|
||||
#include "croutine.h"
|
||||
|
||||
/* Remove the whole file if co-routines are not being used. */
|
||||
/* Remove the whole file is co-routines are not being used. */
|
||||
#if ( configUSE_CO_ROUTINES != 0 )
|
||||
|
||||
/*
|
||||
@@ -43,19 +41,17 @@
|
||||
|
||||
|
||||
/* Lists for ready and blocked co-routines. --------------------*/
|
||||
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /**< Prioritised ready co-routines. */
|
||||
static List_t xDelayedCoRoutineList1; /**< Delayed co-routines. */
|
||||
static List_t xDelayedCoRoutineList2; /**< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
|
||||
static List_t * pxDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used. */
|
||||
static List_t * pxOverflowDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
|
||||
static List_t xPendingReadyCoRoutineList; /**< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
|
||||
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
|
||||
static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
|
||||
static List_t xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */
|
||||
static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */
|
||||
static List_t * pxOverflowDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */
|
||||
static List_t xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */
|
||||
|
||||
/* Other file private variables. --------------------------------*/
|
||||
CRCB_t * pxCurrentCoRoutine = NULL;
|
||||
static UBaseType_t uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
|
||||
static TickType_t xCoRoutineTickCount = ( TickType_t ) 0U;
|
||||
static TickType_t xLastTickCount = ( TickType_t ) 0U;
|
||||
static TickType_t xPassedTicks = ( TickType_t ) 0U;
|
||||
static UBaseType_t uxTopCoRoutineReadyPriority = 0;
|
||||
static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
|
||||
|
||||
/* The initial state of the co-routine when it is created. */
|
||||
#define corINITIAL_STATE ( 0 )
|
||||
@@ -68,13 +64,13 @@
|
||||
* used from within an ISR.
|
||||
*/
|
||||
#define prvAddCoRoutineToReadyQueue( pxCRCB ) \
|
||||
do { \
|
||||
if( ( pxCRCB )->uxPriority > uxTopCoRoutineReadyPriority ) \
|
||||
{ \
|
||||
uxTopCoRoutineReadyPriority = ( pxCRCB )->uxPriority; \
|
||||
if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \
|
||||
{ \
|
||||
uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \
|
||||
} \
|
||||
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ ( pxCRCB )->uxPriority ] ), &( ( pxCRCB )->xGenericListItem ) ); \
|
||||
} while( 0 )
|
||||
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \
|
||||
}
|
||||
|
||||
/*
|
||||
* Utility to ready all the lists used by the scheduler. This is called
|
||||
@@ -109,12 +105,7 @@
|
||||
BaseType_t xReturn;
|
||||
CRCB_t * pxCoRoutine;
|
||||
|
||||
traceENTER_xCoRoutineCreate( pxCoRoutineCode, uxPriority, uxIndex );
|
||||
|
||||
/* Allocate the memory that will store the co-routine control block. */
|
||||
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
|
||||
|
||||
if( pxCoRoutine )
|
||||
@@ -163,8 +154,6 @@
|
||||
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
|
||||
}
|
||||
|
||||
traceRETURN_xCoRoutineCreate( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -174,8 +163,6 @@
|
||||
{
|
||||
TickType_t xTimeToWake;
|
||||
|
||||
traceENTER_vCoRoutineAddToDelayedList( xTicksToDelay, pxEventList );
|
||||
|
||||
/* Calculate the time to wake - this may overflow but this is
|
||||
* not a problem. */
|
||||
xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
|
||||
@@ -207,8 +194,6 @@
|
||||
* function must be called with interrupts disabled. */
|
||||
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
|
||||
}
|
||||
|
||||
traceRETURN_vCoRoutineAddToDelayedList();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -296,8 +281,6 @@
|
||||
|
||||
void vCoRoutineSchedule( void )
|
||||
{
|
||||
traceENTER_vCoRoutineSchedule();
|
||||
|
||||
/* Only run a co-routine after prvInitialiseCoRoutineLists() has been
|
||||
* called. prvInitialiseCoRoutineLists() is called automatically when a
|
||||
* co-routine is created. */
|
||||
@@ -328,8 +311,6 @@
|
||||
/* Call the co-routine. */
|
||||
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
|
||||
}
|
||||
|
||||
traceRETURN_vCoRoutineSchedule();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -358,8 +339,6 @@
|
||||
CRCB_t * pxUnblockedCRCB;
|
||||
BaseType_t xReturn;
|
||||
|
||||
traceENTER_xCoRoutineRemoveFromEventList( pxEventList );
|
||||
|
||||
/* This function is called from within an interrupt. It can only access
|
||||
* event lists and the pending ready list. This function assumes that a
|
||||
* check has already been made to ensure pxEventList is not empty. */
|
||||
@@ -376,30 +355,7 @@
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
|
||||
traceRETURN_xCoRoutineRemoveFromEventList( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Reset state in this file. This state is normally initialized at start up.
|
||||
* This function must be called by the application before restarting the
|
||||
* scheduler.
|
||||
*/
|
||||
void vCoRoutineResetState( void )
|
||||
{
|
||||
/* Lists for ready and blocked co-routines. */
|
||||
pxDelayedCoRoutineList = NULL;
|
||||
pxOverflowDelayedCoRoutineList = NULL;
|
||||
|
||||
/* Other file private variables. */
|
||||
pxCurrentCoRoutine = NULL;
|
||||
uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
|
||||
xCoRoutineTickCount = ( TickType_t ) 0U;
|
||||
xLastTickCount = ( TickType_t ) 0U;
|
||||
xPassedTicks = ( TickType_t ) 0U;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#endif /* configUSE_CO_ROUTINES == 0 */
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -40,28 +38,38 @@
|
||||
#include "timers.h"
|
||||
#include "event_groups.h"
|
||||
|
||||
/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
|
||||
/* Lint e961, e750 and e9021 are suppressed as a MISRA exception justified
|
||||
* because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
|
||||
* for the header files above, but not in this file, in order to generate the
|
||||
* correct privileged Vs unprivileged linkage and placement. */
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021 See comment above. */
|
||||
|
||||
/* This entire source file will be skipped if the application is not configured
|
||||
* to include event groups functionality. This #if is closed at the very bottom
|
||||
* of this file. If you want to include event groups then ensure
|
||||
* configUSE_EVENT_GROUPS is set to 1 in FreeRTOSConfig.h. */
|
||||
#if ( configUSE_EVENT_GROUPS == 1 )
|
||||
/* The following bit fields convey control information in a task's event list
|
||||
* item value. It is important they don't clash with the
|
||||
* taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
|
||||
#if configUSE_16_BIT_TICKS == 1
|
||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
|
||||
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
|
||||
#define eventWAIT_FOR_ALL_BITS 0x0400U
|
||||
#define eventEVENT_BITS_CONTROL_BYTES 0xff00U
|
||||
#else
|
||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x01000000UL
|
||||
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x02000000UL
|
||||
#define eventWAIT_FOR_ALL_BITS 0x04000000UL
|
||||
#define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL
|
||||
#endif
|
||||
|
||||
typedef struct EventGroupDef_t
|
||||
{
|
||||
EventBits_t uxEventBits;
|
||||
List_t xTasksWaitingForBits; /**< List of tasks waiting for a bit to be set. */
|
||||
List_t xTasksWaitingForBits; /*< List of tasks waiting for a bit to be set. */
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxEventGroupNumber;
|
||||
#endif
|
||||
|
||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
uint8_t ucStaticallyAllocated; /**< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
|
||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the event group is statically allocated to ensure no attempt is made to free the memory. */
|
||||
#endif
|
||||
} EventGroup_t;
|
||||
|
||||
@@ -87,8 +95,6 @@
|
||||
{
|
||||
EventGroup_t * pxEventBits;
|
||||
|
||||
traceENTER_xEventGroupCreateStatic( pxEventGroupBuffer );
|
||||
|
||||
/* A StaticEventGroup_t object must be provided. */
|
||||
configASSERT( pxEventGroupBuffer );
|
||||
|
||||
@@ -99,14 +105,11 @@
|
||||
* event group structure. */
|
||||
volatile size_t xSize = sizeof( StaticEventGroup_t );
|
||||
configASSERT( xSize == sizeof( EventGroup_t ) );
|
||||
}
|
||||
} /*lint !e529 xSize is referenced if configASSERT() is defined. */
|
||||
#endif /* configASSERT_DEFINED */
|
||||
|
||||
/* The user has provided a statically allocated event group - use it. */
|
||||
/* MISRA Ref 11.3.1 [Misaligned access] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
|
||||
/* coverity[misra_c_2012_rule_11_3_violation] */
|
||||
pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer;
|
||||
pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 !e9087 EventGroup_t and StaticEventGroup_t are deliberately aliased for data hiding purposes and guaranteed to have the same size and alignment requirement - checked by configASSERT(). */
|
||||
|
||||
if( pxEventBits != NULL )
|
||||
{
|
||||
@@ -132,8 +135,6 @@
|
||||
traceEVENT_GROUP_CREATE_FAILED();
|
||||
}
|
||||
|
||||
traceRETURN_xEventGroupCreateStatic( pxEventBits );
|
||||
|
||||
return pxEventBits;
|
||||
}
|
||||
|
||||
@@ -146,12 +147,20 @@
|
||||
{
|
||||
EventGroup_t * pxEventBits;
|
||||
|
||||
traceENTER_xEventGroupCreate();
|
||||
|
||||
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) );
|
||||
/* Allocate the event group. Justification for MISRA deviation as
|
||||
* follows: pvPortMalloc() always ensures returned memory blocks are
|
||||
* aligned per the requirements of the MCU stack. In this case
|
||||
* pvPortMalloc() must return a pointer that is guaranteed to meet the
|
||||
* alignment requirements of the EventGroup_t structure - which (if you
|
||||
* follow it through) is the alignment requirements of the TickType_t type
|
||||
* (EventBits_t being of TickType_t itself). Therefore, whenever the
|
||||
* stack alignment requirements are greater than or equal to the
|
||||
* TickType_t alignment requirements the cast is safe. In other cases,
|
||||
* where the natural word size of the architecture is less than
|
||||
* sizeof( TickType_t ), the TickType_t variables will be accessed in two
|
||||
* or more reads operations, and the alignment requirements is only that
|
||||
* of each individual read. */
|
||||
pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) ); /*lint !e9087 !e9079 see comment above. */
|
||||
|
||||
if( pxEventBits != NULL )
|
||||
{
|
||||
@@ -171,11 +180,9 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
traceEVENT_GROUP_CREATE_FAILED();
|
||||
traceEVENT_GROUP_CREATE_FAILED(); /*lint !e9063 Else branch only exists to allow tracing and does not generate code if trace macros are not defined. */
|
||||
}
|
||||
|
||||
traceRETURN_xEventGroupCreate( pxEventBits );
|
||||
|
||||
return pxEventBits;
|
||||
}
|
||||
|
||||
@@ -192,8 +199,6 @@
|
||||
BaseType_t xAlreadyYielded;
|
||||
BaseType_t xTimeoutOccurred = pdFALSE;
|
||||
|
||||
traceENTER_xEventGroupSync( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTicksToWait );
|
||||
|
||||
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
|
||||
configASSERT( uxBitsToWaitFor != 0 );
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
@@ -251,7 +256,7 @@
|
||||
{
|
||||
if( xAlreadyYielded == pdFALSE )
|
||||
{
|
||||
taskYIELD_WITHIN_API();
|
||||
portYIELD_WITHIN_API();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -303,8 +308,6 @@
|
||||
/* Prevent compiler warnings when trace macros are not used. */
|
||||
( void ) xTimeoutOccurred;
|
||||
|
||||
traceRETURN_xEventGroupSync( uxReturn );
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -320,8 +323,6 @@
|
||||
BaseType_t xWaitConditionMet, xAlreadyYielded;
|
||||
BaseType_t xTimeoutOccurred = pdFALSE;
|
||||
|
||||
traceENTER_xEventGroupWaitBits( xEventGroup, uxBitsToWaitFor, xClearOnExit, xWaitForAllBits, xTicksToWait );
|
||||
|
||||
/* Check the user is not attempting to wait on the bits used by the kernel
|
||||
* itself, and that at least one bit is being requested. */
|
||||
configASSERT( xEventGroup );
|
||||
@@ -407,7 +408,7 @@
|
||||
{
|
||||
if( xAlreadyYielded == pdFALSE )
|
||||
{
|
||||
taskYIELD_WITHIN_API();
|
||||
portYIELD_WITHIN_API();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -463,8 +464,6 @@
|
||||
/* Prevent compiler warnings when trace macros are not used. */
|
||||
( void ) xTimeoutOccurred;
|
||||
|
||||
traceRETURN_xEventGroupWaitBits( uxReturn );
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -475,8 +474,6 @@
|
||||
EventGroup_t * pxEventBits = xEventGroup;
|
||||
EventBits_t uxReturn;
|
||||
|
||||
traceENTER_xEventGroupClearBits( xEventGroup, uxBitsToClear );
|
||||
|
||||
/* Check the user is not attempting to clear the bits used by the kernel
|
||||
* itself. */
|
||||
configASSERT( xEventGroup );
|
||||
@@ -495,8 +492,6 @@
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
traceRETURN_xEventGroupClearBits( uxReturn );
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -508,12 +503,8 @@
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
|
||||
traceENTER_xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear );
|
||||
|
||||
traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );
|
||||
xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL );
|
||||
|
||||
traceRETURN_xEventGroupClearBitsFromISR( xReturn );
|
||||
xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
@@ -527,43 +518,33 @@
|
||||
EventGroup_t const * const pxEventBits = xEventGroup;
|
||||
EventBits_t uxReturn;
|
||||
|
||||
traceENTER_xEventGroupGetBitsFromISR( xEventGroup );
|
||||
|
||||
/* MISRA Ref 4.7.1 [Return value shall be checked] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#dir-47 */
|
||||
/* coverity[misra_c_2012_directive_4_7_violation] */
|
||||
uxSavedInterruptStatus = taskENTER_CRITICAL_FROM_ISR();
|
||||
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
{
|
||||
uxReturn = pxEventBits->uxEventBits;
|
||||
}
|
||||
taskEXIT_CRITICAL_FROM_ISR( uxSavedInterruptStatus );
|
||||
|
||||
traceRETURN_xEventGroupGetBitsFromISR( uxReturn );
|
||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
} /*lint !e818 EventGroupHandle_t is a typedef used in other functions to so can't be pointer to const. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet )
|
||||
{
|
||||
ListItem_t * pxListItem;
|
||||
ListItem_t * pxNext;
|
||||
ListItem_t * pxListItem, * pxNext;
|
||||
ListItem_t const * pxListEnd;
|
||||
List_t const * pxList;
|
||||
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
|
||||
EventGroup_t * pxEventBits = xEventGroup;
|
||||
BaseType_t xMatchFound = pdFALSE;
|
||||
|
||||
traceENTER_xEventGroupSetBits( xEventGroup, uxBitsToSet );
|
||||
|
||||
/* Check the user is not attempting to set the bits used by the kernel
|
||||
* itself. */
|
||||
configASSERT( xEventGroup );
|
||||
configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
|
||||
|
||||
pxList = &( pxEventBits->xTasksWaitingForBits );
|
||||
pxListEnd = listGET_END_MARKER( pxList );
|
||||
pxListEnd = listGET_END_MARKER( pxList ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||
vTaskSuspendAll();
|
||||
{
|
||||
traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
|
||||
@@ -638,8 +619,6 @@
|
||||
}
|
||||
( void ) xTaskResumeAll();
|
||||
|
||||
traceRETURN_xEventGroupSetBits( pxEventBits->uxEventBits );
|
||||
|
||||
return pxEventBits->uxEventBits;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -647,13 +626,7 @@
|
||||
void vEventGroupDelete( EventGroupHandle_t xEventGroup )
|
||||
{
|
||||
EventGroup_t * pxEventBits = xEventGroup;
|
||||
const List_t * pxTasksWaitingForBits;
|
||||
|
||||
traceENTER_vEventGroupDelete( xEventGroup );
|
||||
|
||||
configASSERT( pxEventBits );
|
||||
|
||||
pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
|
||||
const List_t * pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
|
||||
|
||||
vTaskSuspendAll();
|
||||
{
|
||||
@@ -666,8 +639,6 @@
|
||||
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
|
||||
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
|
||||
}
|
||||
}
|
||||
( void ) xTaskResumeAll();
|
||||
|
||||
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
|
||||
{
|
||||
@@ -689,86 +660,26 @@
|
||||
}
|
||||
}
|
||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
|
||||
traceRETURN_vEventGroupDelete();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
|
||||
StaticEventGroup_t ** ppxEventGroupBuffer )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
EventGroup_t * pxEventBits = xEventGroup;
|
||||
|
||||
traceENTER_xEventGroupGetStaticBuffer( xEventGroup, ppxEventGroupBuffer );
|
||||
|
||||
configASSERT( pxEventBits );
|
||||
configASSERT( ppxEventGroupBuffer );
|
||||
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
{
|
||||
/* Check if the event group was statically allocated. */
|
||||
if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdTRUE )
|
||||
{
|
||||
/* MISRA Ref 11.3.1 [Misaligned access] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
|
||||
/* coverity[misra_c_2012_rule_11_3_violation] */
|
||||
*ppxEventGroupBuffer = ( StaticEventGroup_t * ) pxEventBits;
|
||||
xReturn = pdTRUE;
|
||||
( void ) xTaskResumeAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
}
|
||||
#else /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
{
|
||||
/* Event group must have been statically allocated. */
|
||||
/* MISRA Ref 11.3.1 [Misaligned access] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
|
||||
/* coverity[misra_c_2012_rule_11_3_violation] */
|
||||
*ppxEventGroupBuffer = ( StaticEventGroup_t * ) pxEventBits;
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
|
||||
traceRETURN_xEventGroupGetStaticBuffer( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* For internal use only - execute a 'set bits' command that was pended from
|
||||
* an interrupt. */
|
||||
void vEventGroupSetBitsCallback( void * pvEventGroup,
|
||||
uint32_t ulBitsToSet )
|
||||
const uint32_t ulBitsToSet )
|
||||
{
|
||||
traceENTER_vEventGroupSetBitsCallback( pvEventGroup, ulBitsToSet );
|
||||
|
||||
/* MISRA Ref 11.5.4 [Callback function parameter] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet );
|
||||
|
||||
traceRETURN_vEventGroupSetBitsCallback();
|
||||
( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* For internal use only - execute a 'clear bits' command that was pended from
|
||||
* an interrupt. */
|
||||
void vEventGroupClearBitsCallback( void * pvEventGroup,
|
||||
uint32_t ulBitsToClear )
|
||||
const uint32_t ulBitsToClear )
|
||||
{
|
||||
traceENTER_vEventGroupClearBitsCallback( pvEventGroup, ulBitsToClear );
|
||||
|
||||
/* MISRA Ref 11.5.4 [Callback function parameter] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear );
|
||||
|
||||
traceRETURN_vEventGroupClearBitsCallback();
|
||||
( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear ); /*lint !e9079 Can't avoid cast to void* as a generic timer callback prototype. Callback casts back to original type so safe. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -817,12 +728,8 @@
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
|
||||
traceENTER_xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken );
|
||||
|
||||
traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet );
|
||||
xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken );
|
||||
|
||||
traceRETURN_xEventGroupSetBitsFromISR( xReturn );
|
||||
xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken ); /*lint !e9087 Can't avoid cast to void* as a generic callback function not specific to this use case. Callback casts back to original type so safe. */
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
@@ -835,13 +742,7 @@
|
||||
UBaseType_t uxEventGroupGetNumber( void * xEventGroup )
|
||||
{
|
||||
UBaseType_t xReturn;
|
||||
|
||||
/* MISRA Ref 11.5.2 [Opaque pointer] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
EventGroup_t const * pxEventBits = ( EventGroup_t * ) xEventGroup;
|
||||
|
||||
traceENTER_uxEventGroupGetNumber( xEventGroup );
|
||||
EventGroup_t const * pxEventBits = ( EventGroup_t * ) xEventGroup; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */
|
||||
|
||||
if( xEventGroup == NULL )
|
||||
{
|
||||
@@ -852,8 +753,6 @@
|
||||
xReturn = pxEventBits->uxEventGroupNumber;
|
||||
}
|
||||
|
||||
traceRETURN_uxEventGroupGetNumber( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
@@ -865,20 +764,8 @@
|
||||
void vEventGroupSetNumber( void * xEventGroup,
|
||||
UBaseType_t uxEventGroupNumber )
|
||||
{
|
||||
traceENTER_vEventGroupSetNumber( xEventGroup, uxEventGroupNumber );
|
||||
|
||||
/* MISRA Ref 11.5.2 [Opaque pointer] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber;
|
||||
|
||||
traceRETURN_vEventGroupSetNumber();
|
||||
( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber; /*lint !e9087 !e9079 EventGroupHandle_t is a pointer to an EventGroup_t, but EventGroupHandle_t is kept opaque outside of this file for data hiding purposes. */
|
||||
}
|
||||
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* This entire source file will be skipped if the application is not configured
|
||||
* to include event groups functionality. If you want to include event groups
|
||||
* then ensure configUSE_EVENT_GROUPS is set to 1 in FreeRTOSConfig.h. */
|
||||
#endif /* configUSE_EVENT_GROUPS == 1 */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -28,7 +26,7 @@
|
||||
|
||||
|
||||
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
|
||||
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in a future release.
|
||||
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
|
||||
#endif
|
||||
|
||||
#include "stack_macros.h"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -33,14 +31,6 @@
|
||||
* This file implements atomic functions by disabling interrupts globally.
|
||||
* Implementations with architecture specific atomic instructions can be
|
||||
* provided under each compiler directory.
|
||||
*
|
||||
* The atomic interface can be used in FreeRTOS tasks on all FreeRTOS ports. It
|
||||
* can also be used in Interrupt Service Routines (ISRs) on FreeRTOS ports that
|
||||
* support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 1). The
|
||||
* atomic interface must not be used in ISRs on FreeRTOS ports that do not
|
||||
* support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0)
|
||||
* because ISRs on these ports cannot be interrupted and therefore, do not need
|
||||
* atomics in ISRs.
|
||||
*/
|
||||
|
||||
#ifndef ATOMIC_H
|
||||
@@ -67,7 +57,7 @@
|
||||
* ATOMIC_ENTER_CRITICAL().
|
||||
*
|
||||
*/
|
||||
#if ( portHAS_NESTED_INTERRUPTS == 1 )
|
||||
#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
|
||||
|
||||
/* Nested interrupt scheme is supported in this port. */
|
||||
#define ATOMIC_ENTER_CRITICAL() \
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -47,28 +45,28 @@
|
||||
typedef void * CoRoutineHandle_t;
|
||||
|
||||
/* Defines the prototype to which co-routine functions must conform. */
|
||||
typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t xHandle,
|
||||
UBaseType_t uxIndex );
|
||||
typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t,
|
||||
UBaseType_t );
|
||||
|
||||
typedef struct corCoRoutineControlBlock
|
||||
{
|
||||
crCOROUTINE_CODE pxCoRoutineFunction;
|
||||
ListItem_t xGenericListItem; /**< List item used to place the CRCB in ready and blocked queues. */
|
||||
ListItem_t xEventListItem; /**< List item used to place the CRCB in event lists. */
|
||||
UBaseType_t uxPriority; /**< The priority of the co-routine in relation to other co-routines. */
|
||||
UBaseType_t uxIndex; /**< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
|
||||
uint16_t uxState; /**< Used internally by the co-routine implementation. */
|
||||
ListItem_t xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */
|
||||
ListItem_t xEventListItem; /*< List item used to place the CRCB in event lists. */
|
||||
UBaseType_t uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
|
||||
UBaseType_t uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
|
||||
uint16_t uxState; /*< Used internally by the co-routine implementation. */
|
||||
} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with TCB_t. */
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xCoRoutineCreate(
|
||||
* crCOROUTINE_CODE pxCoRoutineCode,
|
||||
* UBaseType_t uxPriority,
|
||||
* UBaseType_t uxIndex
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Create a new co-routine and add it to the list of co-routines that are
|
||||
* ready to run.
|
||||
@@ -88,7 +86,7 @@ typedef struct corCoRoutineControlBlock
|
||||
* list, otherwise an error code defined with ProjDefs.h.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Co-routine to be created.
|
||||
* void vFlashCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
* {
|
||||
@@ -129,7 +127,7 @@ typedef struct corCoRoutineControlBlock
|
||||
* xCoRoutineCreate( vFlashCoRoutine, 0, uxIndex );
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xCoRoutineCreate xCoRoutineCreate
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
@@ -140,9 +138,9 @@ BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vCoRoutineSchedule( void );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Run a co-routine.
|
||||
*
|
||||
@@ -156,7 +154,7 @@ BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
||||
* hook).
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // This idle task hook will schedule a co-routine each time it is called.
|
||||
* // The rest of the idle task will execute between co-routine calls.
|
||||
* void vApplicationIdleHook( void )
|
||||
@@ -174,7 +172,7 @@ BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
||||
* vCoRoutineSchedule();
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup vCoRoutineSchedule vCoRoutineSchedule
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
@@ -182,14 +180,14 @@ void vCoRoutineSchedule( void );
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crSTART( CoRoutineHandle_t xHandle );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This macro MUST always be called at the start of a co-routine function.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Co-routine to be created.
|
||||
* void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
* {
|
||||
@@ -207,7 +205,7 @@ void vCoRoutineSchedule( void );
|
||||
* // Must end every co-routine with a call to crEND();
|
||||
* crEND();
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crSTART crSTART
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
@@ -217,14 +215,14 @@ void vCoRoutineSchedule( void );
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crEND();
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This macro MUST always be called at the end of a co-routine function.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Co-routine to be created.
|
||||
* void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
* {
|
||||
@@ -242,7 +240,7 @@ void vCoRoutineSchedule( void );
|
||||
* // Must end every co-routine with a call to crEND();
|
||||
* crEND();
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crSTART crSTART
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
@@ -261,9 +259,9 @@ void vCoRoutineSchedule( void );
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crDELAY( CoRoutineHandle_t xHandle, TickType_t xTicksToDelay );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Delay a co-routine for a fixed period of time.
|
||||
*
|
||||
@@ -280,7 +278,7 @@ void vCoRoutineSchedule( void );
|
||||
* can be used to convert ticks to milliseconds.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Co-routine to be created.
|
||||
* void vACoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
* {
|
||||
@@ -303,21 +301,19 @@ void vCoRoutineSchedule( void );
|
||||
* // Must end every co-routine with a call to crEND();
|
||||
* crEND();
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crDELAY crDELAY
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
#define crDELAY( xHandle, xTicksToDelay ) \
|
||||
do { \
|
||||
if( ( xTicksToDelay ) > 0 ) \
|
||||
{ \
|
||||
vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
|
||||
} \
|
||||
crSET_STATE0( ( xHandle ) ); \
|
||||
} while( 0 )
|
||||
crSET_STATE0( ( xHandle ) );
|
||||
|
||||
/**
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crQUEUE_SEND(
|
||||
* CoRoutineHandle_t xHandle,
|
||||
* QueueHandle_t pxQueue,
|
||||
@@ -325,7 +321,7 @@ void vCoRoutineSchedule( void );
|
||||
* TickType_t xTicksToWait,
|
||||
* BaseType_t *pxResult
|
||||
* )
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
|
||||
* equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
|
||||
@@ -365,7 +361,7 @@ void vCoRoutineSchedule( void );
|
||||
* error defined within ProjDefs.h.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Co-routine function that blocks for a fixed period then posts a number onto
|
||||
* // a queue.
|
||||
* static void prvCoRoutineFlashTask( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
@@ -397,12 +393,12 @@ void vCoRoutineSchedule( void );
|
||||
* // Co-routines must end with a call to crEND().
|
||||
* crEND();
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crQUEUE_SEND crQUEUE_SEND
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
|
||||
do { \
|
||||
{ \
|
||||
*( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
|
||||
if( *( pxResult ) == errQUEUE_BLOCKED ) \
|
||||
{ \
|
||||
@@ -414,11 +410,11 @@ void vCoRoutineSchedule( void );
|
||||
crSET_STATE1( ( xHandle ) ); \
|
||||
*pxResult = pdPASS; \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crQUEUE_RECEIVE(
|
||||
* CoRoutineHandle_t xHandle,
|
||||
* QueueHandle_t pxQueue,
|
||||
@@ -426,7 +422,7 @@ void vCoRoutineSchedule( void );
|
||||
* TickType_t xTicksToWait,
|
||||
* BaseType_t *pxResult
|
||||
* )
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
|
||||
* equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
|
||||
@@ -465,7 +461,7 @@ void vCoRoutineSchedule( void );
|
||||
* an error code as defined within ProjDefs.h.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A co-routine receives the number of an LED to flash from a queue. It
|
||||
* // blocks on the queue until the number is received.
|
||||
* static void prvCoRoutineFlashWorkTask( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
@@ -491,12 +487,12 @@ void vCoRoutineSchedule( void );
|
||||
*
|
||||
* crEND();
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
|
||||
do { \
|
||||
{ \
|
||||
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
|
||||
if( *( pxResult ) == errQUEUE_BLOCKED ) \
|
||||
{ \
|
||||
@@ -508,17 +504,17 @@ void vCoRoutineSchedule( void );
|
||||
crSET_STATE1( ( xHandle ) ); \
|
||||
*( pxResult ) = pdPASS; \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crQUEUE_SEND_FROM_ISR(
|
||||
* QueueHandle_t pxQueue,
|
||||
* void *pvItemToQueue,
|
||||
* BaseType_t xCoRoutinePreviouslyWoken
|
||||
* )
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
|
||||
* co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
|
||||
@@ -553,7 +549,7 @@ void vCoRoutineSchedule( void );
|
||||
* the ISR.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A co-routine that blocks on a queue waiting for characters to be received.
|
||||
* static void vReceivingCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
* {
|
||||
@@ -602,7 +598,7 @@ void vCoRoutineSchedule( void );
|
||||
* xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
@@ -612,13 +608,13 @@ void vCoRoutineSchedule( void );
|
||||
|
||||
/**
|
||||
* croutine. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* crQUEUE_SEND_FROM_ISR(
|
||||
* QueueHandle_t pxQueue,
|
||||
* void *pvBuffer,
|
||||
* BaseType_t * pxCoRoutineWoken
|
||||
* )
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
|
||||
* co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
|
||||
@@ -653,7 +649,7 @@ void vCoRoutineSchedule( void );
|
||||
* pdFALSE.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A co-routine that posts a character to a queue then blocks for a fixed
|
||||
* // period. The character is incremented each time.
|
||||
* static void vSendingCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )
|
||||
@@ -718,7 +714,7 @@ void vCoRoutineSchedule( void );
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR
|
||||
* \ingroup Tasks
|
||||
*/
|
||||
@@ -746,13 +742,6 @@ void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
|
||||
*/
|
||||
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
|
||||
|
||||
|
||||
/*
|
||||
* This function resets the internal state of the coroutine module. It must be
|
||||
* called by the application before restarting the scheduler.
|
||||
*/
|
||||
void vCoRoutineResetState( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
40
source/Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h
vendored
Normal file
40
source/Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DEPRECATED_DEFINITIONS_H
|
||||
#define DEPRECATED_DEFINITIONS_H
|
||||
|
||||
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
||||
* pre-processor definition was used to ensure the pre-processor found the correct
|
||||
* portmacro.h file for the port being used. That scheme was deprecated in favour
|
||||
* of setting the compiler's include path such that it found the correct
|
||||
* portmacro.h file - removing the need for the constant and allowing the
|
||||
* portmacro.h file to be located anywhere in relation to the port being used. The
|
||||
* definitions below remain in the code for backward compatibility only. New
|
||||
* projects should not use them. */
|
||||
#include "portmacro.h"
|
||||
|
||||
#endif /* DEPRECATED_DEFINITIONS_H */
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -36,26 +34,6 @@
|
||||
/* FreeRTOS includes. */
|
||||
#include "timers.h"
|
||||
|
||||
/* The following bit fields convey control information in a task's event list
|
||||
* item value. It is important they don't clash with the
|
||||
* taskEVENT_LIST_ITEM_VALUE_IN_USE definition. */
|
||||
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
|
||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint16_t ) 0x0100U )
|
||||
#define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint16_t ) 0x0200U )
|
||||
#define eventWAIT_FOR_ALL_BITS ( ( uint16_t ) 0x0400U )
|
||||
#define eventEVENT_BITS_CONTROL_BYTES ( ( uint16_t ) 0xff00U )
|
||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
|
||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint32_t ) 0x01000000U )
|
||||
#define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint32_t ) 0x02000000U )
|
||||
#define eventWAIT_FOR_ALL_BITS ( ( uint32_t ) 0x04000000U )
|
||||
#define eventEVENT_BITS_CONTROL_BYTES ( ( uint32_t ) 0xff000000U )
|
||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
|
||||
#define eventCLEAR_EVENTS_ON_EXIT_BIT ( ( uint64_t ) 0x0100000000000000U )
|
||||
#define eventUNBLOCKED_DUE_TO_BIT_SET ( ( uint64_t ) 0x0200000000000000U )
|
||||
#define eventWAIT_FOR_ALL_BITS ( ( uint64_t ) 0x0400000000000000U )
|
||||
#define eventEVENT_BITS_CONTROL_BYTES ( ( uint64_t ) 0xff00000000000000U )
|
||||
#endif /* if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS ) */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -85,6 +63,8 @@
|
||||
* be set and then tested atomically - as is the case where event groups are
|
||||
* used to create a synchronisation point between multiple tasks (a
|
||||
* 'rendezvous').
|
||||
*
|
||||
* \defgroup EventGroup
|
||||
*/
|
||||
|
||||
|
||||
@@ -104,8 +84,8 @@ typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||
|
||||
/*
|
||||
* The type that holds event bits always matches TickType_t - therefore the
|
||||
* number of bits it holds is set by configTICK_TYPE_WIDTH_IN_BITS (16 bits if set to 0,
|
||||
* 32 bits if set to 1, 64 bits if set to 2.
|
||||
* number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
|
||||
* 32 bits if set to 0.
|
||||
*
|
||||
* \defgroup EventBits_t EventBits_t
|
||||
* \ingroup EventGroup
|
||||
@@ -114,40 +94,36 @@ typedef TickType_t EventBits_t;
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventGroupHandle_t xEventGroupCreate( void );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Create a new event group.
|
||||
*
|
||||
* Internally, within the FreeRTOS implementation, event groups use a [small]
|
||||
* block of memory, in which the event group's structure is stored. If an event
|
||||
* groups is created using xEventGroupCreate() then the required memory is
|
||||
* groups is created using xEventGropuCreate() then the required memory is
|
||||
* automatically dynamically allocated inside the xEventGroupCreate() function.
|
||||
* (see https://www.FreeRTOS.org/a00111.html). If an event group is created
|
||||
* using xEventGroupCreateStatic() then the application writer must instead
|
||||
* using xEventGropuCreateStatic() then the application writer must instead
|
||||
* provide the memory that will get used by the event group.
|
||||
* xEventGroupCreateStatic() therefore allows an event group to be created
|
||||
* without using any dynamic memory allocation.
|
||||
*
|
||||
* Although event groups are not related to ticks, for internal implementation
|
||||
* reasons the number of bits available for use in an event group is dependent
|
||||
* on the configTICK_TYPE_WIDTH_IN_BITS setting in FreeRTOSConfig.h. If
|
||||
* configTICK_TYPE_WIDTH_IN_BITS is 0 then each event group contains 8 usable bits (bit
|
||||
* 0 to bit 7). If configTICK_TYPE_WIDTH_IN_BITS is set to 1 then each event group has
|
||||
* 24 usable bits (bit 0 to bit 23). If configTICK_TYPE_WIDTH_IN_BITS is set to 2 then
|
||||
* each event group has 56 usable bits (bit 0 to bit 53). The EventBits_t type
|
||||
* is used to store event bits within an event group.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupCreate()
|
||||
* to be available.
|
||||
* on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
|
||||
* configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
|
||||
* 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
|
||||
* 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
|
||||
* event bits within an event group.
|
||||
*
|
||||
* @return If the event group was created then a handle to the event group is
|
||||
* returned. If there was insufficient FreeRTOS heap available to create the
|
||||
* event group then NULL is returned. See https://www.FreeRTOS.org/a00111.html
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Declare a variable to hold the created event group.
|
||||
* EventGroupHandle_t xCreatedEventGroup;
|
||||
*
|
||||
@@ -164,7 +140,7 @@ typedef TickType_t EventBits_t;
|
||||
* {
|
||||
* // The event group was created.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupCreate xEventGroupCreate
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -174,33 +150,29 @@ typedef TickType_t EventBits_t;
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventGroupHandle_t xEventGroupCreateStatic( EventGroupHandle_t * pxEventGroupBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Create a new event group.
|
||||
*
|
||||
* Internally, within the FreeRTOS implementation, event groups use a [small]
|
||||
* block of memory, in which the event group's structure is stored. If an event
|
||||
* groups is created using xEventGroupCreate() then the required memory is
|
||||
* groups is created using xEventGropuCreate() then the required memory is
|
||||
* automatically dynamically allocated inside the xEventGroupCreate() function.
|
||||
* (see https://www.FreeRTOS.org/a00111.html). If an event group is created
|
||||
* using xEventGroupCreateStatic() then the application writer must instead
|
||||
* using xEventGropuCreateStatic() then the application writer must instead
|
||||
* provide the memory that will get used by the event group.
|
||||
* xEventGroupCreateStatic() therefore allows an event group to be created
|
||||
* without using any dynamic memory allocation.
|
||||
*
|
||||
* Although event groups are not related to ticks, for internal implementation
|
||||
* reasons the number of bits available for use in an event group is dependent
|
||||
* on the configTICK_TYPE_WIDTH_IN_BITS setting in FreeRTOSConfig.h. If
|
||||
* configTICK_TYPE_WIDTH_IN_BITS is 0 then each event group contains 8 usable bits (bit
|
||||
* 0 to bit 7). If configTICK_TYPE_WIDTH_IN_BITS is set to 1 then each event group has
|
||||
* 24 usable bits (bit 0 to bit 23). If configTICK_TYPE_WIDTH_IN_BITS is set to 2 then
|
||||
* each event group has 56 usable bits (bit 0 to bit 53). The EventBits_t type
|
||||
* is used to store event bits within an event group.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupCreateStatic()
|
||||
* to be available.
|
||||
* on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
|
||||
* configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
|
||||
* 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
|
||||
* 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
|
||||
* event bits within an event group.
|
||||
*
|
||||
* @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type
|
||||
* StaticEventGroup_t, which will be then be used to hold the event group's data
|
||||
@@ -210,7 +182,7 @@ typedef TickType_t EventBits_t;
|
||||
* returned. If pxEventGroupBuffer was NULL then NULL is returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // StaticEventGroup_t is a publicly accessible structure that has the same
|
||||
* // size and alignment requirements as the real event group structure. It is
|
||||
* // provided as a mechanism for applications to know the size of the event
|
||||
@@ -223,7 +195,7 @@ typedef TickType_t EventBits_t;
|
||||
*
|
||||
* // Create the event group without dynamically allocating any memory.
|
||||
* xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
||||
@@ -231,22 +203,19 @@ typedef TickType_t EventBits_t;
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
* const EventBits_t uxBitsToWaitFor,
|
||||
* const BaseType_t xClearOnExit,
|
||||
* const BaseType_t xWaitForAllBits,
|
||||
* const TickType_t xTicksToWait );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* [Potentially] block to wait for one or more bits to be set within a
|
||||
* previously created event group.
|
||||
*
|
||||
* This function cannot be called from an interrupt.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupWaitBits()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group in which the bits are being tested. The
|
||||
* event group must have previously been created using a call to
|
||||
* xEventGroupCreate().
|
||||
@@ -272,8 +241,7 @@ typedef TickType_t EventBits_t;
|
||||
*
|
||||
* @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait
|
||||
* for one/all (depending on the xWaitForAllBits value) of the bits specified by
|
||||
* uxBitsToWaitFor to become set. A value of portMAX_DELAY can be used to block
|
||||
* indefinitely (provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
|
||||
* uxBitsToWaitFor to become set.
|
||||
*
|
||||
* @return The value of the event group at the time either the bits being waited
|
||||
* for became set, or the block time expired. Test the return value to know
|
||||
@@ -285,9 +253,9 @@ typedef TickType_t EventBits_t;
|
||||
* pdTRUE.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* #define BIT_0 ( 1 << 0 )
|
||||
* #define BIT_4 ( 1 << 4 )
|
||||
* <pre>
|
||||
#define BIT_0 ( 1 << 0 )
|
||||
#define BIT_4 ( 1 << 4 )
|
||||
*
|
||||
* void aFunction( EventGroupHandle_t xEventGroup )
|
||||
* {
|
||||
@@ -321,7 +289,7 @@ typedef TickType_t EventBits_t;
|
||||
* // without either BIT_0 or BIT_4 becoming set.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupWaitBits xEventGroupWaitBits
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -333,16 +301,13 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Clear bits within an event group. This function cannot be called from an
|
||||
* interrupt.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupClearBits()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group in which the bits are to be cleared.
|
||||
*
|
||||
* @param uxBitsToClear A bitwise value that indicates the bit or bits to clear
|
||||
@@ -352,9 +317,9 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
* @return The value of the event group before the specified bits were cleared.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* #define BIT_0 ( 1 << 0 )
|
||||
* #define BIT_4 ( 1 << 4 )
|
||||
* <pre>
|
||||
#define BIT_0 ( 1 << 0 )
|
||||
#define BIT_4 ( 1 << 4 )
|
||||
*
|
||||
* void aFunction( EventGroupHandle_t xEventGroup )
|
||||
* {
|
||||
@@ -385,7 +350,7 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
* // Neither bit 0 nor bit 4 were set in the first place.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupClearBits xEventGroupClearBits
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -394,9 +359,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* A version of xEventGroupClearBits() that can be called from an interrupt.
|
||||
*
|
||||
@@ -410,12 +375,6 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
* timer task to have the clear operation performed in the context of the timer
|
||||
* task.
|
||||
*
|
||||
* @note If this function returns pdPASS then the timer task is ready to run
|
||||
* and a portYIELD_FROM_ISR(pdTRUE) should be executed to perform the needed
|
||||
* clear on the event group. This behavior is different from
|
||||
* xEventGroupSetBitsFromISR because the parameter xHigherPriorityTaskWoken is
|
||||
* not present.
|
||||
*
|
||||
* @param xEventGroup The event group in which the bits are to be cleared.
|
||||
*
|
||||
* @param uxBitsToClear A bitwise value that indicates the bit or bits to clear.
|
||||
@@ -427,9 +386,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
* if the timer service queue was full.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* #define BIT_0 ( 1 << 0 )
|
||||
* #define BIT_4 ( 1 << 4 )
|
||||
* <pre>
|
||||
#define BIT_0 ( 1 << 0 )
|
||||
#define BIT_4 ( 1 << 4 )
|
||||
*
|
||||
* // An event group which it is assumed has already been created by a call to
|
||||
* // xEventGroupCreate().
|
||||
@@ -445,10 +404,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
* if( xResult == pdPASS )
|
||||
* {
|
||||
* // The message was posted successfully.
|
||||
* portYIELD_FROM_ISR(pdTRUE);
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -457,14 +415,14 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) \
|
||||
xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) ( xEventGroup ), ( uint32_t ) ( uxBitsToClear ), NULL )
|
||||
xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Set bits within an event group.
|
||||
* This function cannot be called from an interrupt. xEventGroupSetBitsFromISR()
|
||||
@@ -473,9 +431,6 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
* Setting bits in an event group will automatically unblock tasks that are
|
||||
* blocked waiting for the bits.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupSetBits()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group in which the bits are to be set.
|
||||
*
|
||||
* @param uxBitsToSet A bitwise value that indicates the bit or bits to set.
|
||||
@@ -493,9 +448,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
* event group value before the call to xEventGroupSetBits() returns.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* #define BIT_0 ( 1 << 0 )
|
||||
* #define BIT_4 ( 1 << 4 )
|
||||
* <pre>
|
||||
#define BIT_0 ( 1 << 0 )
|
||||
#define BIT_4 ( 1 << 4 )
|
||||
*
|
||||
* void aFunction( EventGroupHandle_t xEventGroup )
|
||||
* {
|
||||
@@ -531,7 +486,7 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
* // cleared as the task left the Blocked state.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupSetBits xEventGroupSetBits
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -540,9 +495,9 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* A version of xEventGroupSetBits() that can be called from an interrupt.
|
||||
*
|
||||
@@ -575,9 +530,9 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
* if the timer service queue was full.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* #define BIT_0 ( 1 << 0 )
|
||||
* #define BIT_4 ( 1 << 4 )
|
||||
* <pre>
|
||||
#define BIT_0 ( 1 << 0 )
|
||||
#define BIT_4 ( 1 << 4 )
|
||||
*
|
||||
* // An event group which it is assumed has already been created by a call to
|
||||
* // xEventGroupCreate().
|
||||
@@ -606,7 +561,7 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -616,17 +571,17 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) \
|
||||
xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) ( xEventGroup ), ( uint32_t ) ( uxBitsToSet ), ( pxHigherPriorityTaskWoken ) )
|
||||
xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||
* const EventBits_t uxBitsToSet,
|
||||
* const EventBits_t uxBitsToWaitFor,
|
||||
* TickType_t xTicksToWait );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Atomically set bits within an event group, then wait for a combination of
|
||||
* bits to be set within the same event group. This functionality is typically
|
||||
@@ -640,9 +595,6 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
* this case all the bits specified by uxBitsToWait will be automatically
|
||||
* cleared before the function returns.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupSync()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group in which the bits are being tested. The
|
||||
* event group must have previously been created using a call to
|
||||
* xEventGroupCreate().
|
||||
@@ -668,13 +620,13 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
* automatically cleared.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // Bits used by the three tasks.
|
||||
* #define TASK_0_BIT ( 1 << 0 )
|
||||
* #define TASK_1_BIT ( 1 << 1 )
|
||||
* #define TASK_2_BIT ( 1 << 2 )
|
||||
#define TASK_0_BIT ( 1 << 0 )
|
||||
#define TASK_1_BIT ( 1 << 1 )
|
||||
#define TASK_2_BIT ( 1 << 2 )
|
||||
*
|
||||
* #define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
|
||||
#define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
|
||||
*
|
||||
* // Use an event group to synchronise three tasks. It is assumed this event
|
||||
* // group has already been created elsewhere.
|
||||
@@ -742,7 +694,7 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xEventGroupSync xEventGroupSync
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
@@ -754,16 +706,13 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Returns the current value of the bits in an event group. This function
|
||||
* cannot be used from an interrupt.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupGetBits()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group being queried.
|
||||
*
|
||||
* @return The event group bits at the time xEventGroupGetBits() was called.
|
||||
@@ -771,19 +720,16 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||
* \defgroup xEventGroupGetBits xEventGroupGetBits
|
||||
* \ingroup EventGroup
|
||||
*/
|
||||
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( ( xEventGroup ), 0 )
|
||||
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* A version of xEventGroupGetBits() that can be called from an ISR.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupGetBitsFromISR()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group being queried.
|
||||
*
|
||||
* @return The event group bits at the time xEventGroupGetBitsFromISR() was called.
|
||||
@@ -795,51 +741,23 @@ EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEG
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void xEventGroupDelete( EventGroupHandle_t xEventGroup );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Delete an event group that was previously created by a call to
|
||||
* xEventGroupCreate(). Tasks that are blocked on the event group will be
|
||||
* unblocked and obtain 0 as the event group's value.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for vEventGroupDelete()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group being deleted.
|
||||
*/
|
||||
void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* event_groups.h
|
||||
* @code{c}
|
||||
* BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
|
||||
* StaticEventGroup_t ** ppxEventGroupBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* Retrieve a pointer to a statically created event groups's data structure
|
||||
* buffer. It is the same buffer that is supplied at the time of creation.
|
||||
*
|
||||
* The configUSE_EVENT_GROUPS configuration constant must be set to 1 for xEventGroupGetStaticBuffer()
|
||||
* to be available.
|
||||
*
|
||||
* @param xEventGroup The event group for which to retrieve the buffer.
|
||||
*
|
||||
* @param ppxEventGroupBuffer Used to return a pointer to the event groups's
|
||||
* data structure buffer.
|
||||
*
|
||||
* @return pdTRUE if the buffer was retrieved, pdFALSE otherwise.
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
|
||||
StaticEventGroup_t ** ppxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/* For internal use only. */
|
||||
void vEventGroupSetBitsCallback( void * pvEventGroup,
|
||||
uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
|
||||
const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
|
||||
void vEventGroupClearBitsCallback( void * pvEventGroup,
|
||||
uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
|
||||
const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
|
||||
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -33,7 +31,7 @@
|
||||
*
|
||||
* list_ts can only store pointers to list_item_ts. Each ListItem_t contains a
|
||||
* numeric value (xItemValue). Most of the time the lists are sorted in
|
||||
* ascending item value order.
|
||||
* descending item value order.
|
||||
*
|
||||
* Lists are created already containing one list item. The value of this
|
||||
* item is the maximum possible that can be stored, it is therefore always at
|
||||
@@ -143,39 +141,35 @@
|
||||
struct xLIST;
|
||||
struct xLIST_ITEM
|
||||
{
|
||||
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
configLIST_VOLATILE TickType_t xItemValue; /**< The value being listed. In most cases this is used to sort the list in ascending order. */
|
||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /**< Pointer to the next ListItem_t in the list. */
|
||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /**< Pointer to the previous ListItem_t in the list. */
|
||||
void * pvOwner; /**< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
|
||||
struct xLIST * configLIST_VOLATILE pxContainer; /**< Pointer to the list in which this list item is placed (if any). */
|
||||
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
|
||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
|
||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
|
||||
void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
|
||||
struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
|
||||
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
};
|
||||
typedef struct xLIST_ITEM ListItem_t;
|
||||
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
|
||||
|
||||
#if ( configUSE_MINI_LIST_ITEM == 1 )
|
||||
struct xMINI_LIST_ITEM
|
||||
{
|
||||
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
configLIST_VOLATILE TickType_t xItemValue;
|
||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext;
|
||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
|
||||
};
|
||||
typedef struct xMINI_LIST_ITEM MiniListItem_t;
|
||||
#else
|
||||
typedef struct xLIST_ITEM MiniListItem_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definition of the type of queue used by the scheduler.
|
||||
*/
|
||||
typedef struct xLIST
|
||||
{
|
||||
listFIRST_LIST_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
configLIST_VOLATILE UBaseType_t uxNumberOfItems;
|
||||
ListItem_t * configLIST_VOLATILE pxIndex; /**< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
|
||||
MiniListItem_t xListEnd; /**< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
|
||||
listSECOND_LIST_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
volatile UBaseType_t uxNumberOfItems;
|
||||
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
|
||||
MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
|
||||
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
} List_t;
|
||||
|
||||
/*
|
||||
@@ -198,7 +192,7 @@ typedef struct xLIST
|
||||
|
||||
/*
|
||||
* Access macro to set the value of the list item. In most cases the value is
|
||||
* used to sort the list in ascending order.
|
||||
* used to sort the list in descending order.
|
||||
*
|
||||
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
|
||||
* \ingroup LinkedList
|
||||
@@ -282,107 +276,19 @@ typedef struct xLIST
|
||||
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#if ( configNUMBER_OF_CORES == 1 )
|
||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||
do { \
|
||||
{ \
|
||||
List_t * const pxConstList = ( pxList ); \
|
||||
/* Increment the index to the next item and return the item, ensuring */ \
|
||||
/* we don't return the marker used at the end of the list. */ \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||
if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
|
||||
{ \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->xListEnd.pxNext; \
|
||||
( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
|
||||
} \
|
||||
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
|
||||
} while( 0 )
|
||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||
}
|
||||
|
||||
/* This function is not required in SMP. FreeRTOS SMP scheduler doesn't use
|
||||
* pxIndex and it should always point to the xListEnd. Not defining this macro
|
||||
* here to prevent updating pxIndex.
|
||||
*/
|
||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||
|
||||
/*
|
||||
* Version of uxListRemove() that does not return a value. Provided as a slight
|
||||
* optimisation for xTaskIncrementTick() by being inline.
|
||||
*
|
||||
* Remove an item from a list. The list item has a pointer to the list that
|
||||
* it is in, so only the list item need be passed into the function.
|
||||
*
|
||||
* @param uxListRemove The item to be removed. The item will remove itself from
|
||||
* the list pointed to by it's pxContainer parameter.
|
||||
*
|
||||
* @return The number of items that remain in the list after the list item has
|
||||
* been removed.
|
||||
*
|
||||
* \page listREMOVE_ITEM listREMOVE_ITEM
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listREMOVE_ITEM( pxItemToRemove ) \
|
||||
do { \
|
||||
/* The list item knows which list it is in. Obtain the list from the list \
|
||||
* item. */ \
|
||||
List_t * const pxList = ( pxItemToRemove )->pxContainer; \
|
||||
\
|
||||
( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
|
||||
( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
|
||||
/* Make sure the index is left pointing to a valid item. */ \
|
||||
if( pxList->pxIndex == ( pxItemToRemove ) ) \
|
||||
{ \
|
||||
pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
|
||||
} \
|
||||
\
|
||||
( pxItemToRemove )->pxContainer = NULL; \
|
||||
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) - 1U ); \
|
||||
} while( 0 )
|
||||
|
||||
/*
|
||||
* Inline version of vListInsertEnd() to provide slight optimisation for
|
||||
* xTaskIncrementTick().
|
||||
*
|
||||
* Insert a list item into a list. The item will be inserted in a position
|
||||
* such that it will be the last item within the list returned by multiple
|
||||
* calls to listGET_OWNER_OF_NEXT_ENTRY.
|
||||
*
|
||||
* The list member pxIndex is used to walk through a list. Calling
|
||||
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list.
|
||||
* Placing an item in a list using vListInsertEnd effectively places the item
|
||||
* in the list position pointed to by pxIndex. This means that every other
|
||||
* item within the list will be returned by listGET_OWNER_OF_NEXT_ENTRY before
|
||||
* the pxIndex parameter again points to the item being inserted.
|
||||
*
|
||||
* @param pxList The list into which the item is to be inserted.
|
||||
*
|
||||
* @param pxNewListItem The list item to be inserted into the list.
|
||||
*
|
||||
* \page listINSERT_END listINSERT_END
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listINSERT_END( pxList, pxNewListItem ) \
|
||||
do { \
|
||||
ListItem_t * const pxIndex = ( pxList )->pxIndex; \
|
||||
\
|
||||
/* Only effective when configASSERT() is also defined, these tests may catch \
|
||||
* the list data structures being overwritten in memory. They will not catch \
|
||||
* data errors caused by incorrect configuration or use of FreeRTOS. */ \
|
||||
listTEST_LIST_INTEGRITY( ( pxList ) ); \
|
||||
listTEST_LIST_ITEM_INTEGRITY( ( pxNewListItem ) ); \
|
||||
\
|
||||
/* Insert a new list item into ( pxList ), but rather than sort the list, \
|
||||
* makes the new list item the last item to be removed by a call to \
|
||||
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
|
||||
( pxNewListItem )->pxNext = pxIndex; \
|
||||
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
|
||||
\
|
||||
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
|
||||
pxIndex->pxPrevious = ( pxNewListItem ); \
|
||||
\
|
||||
/* Remember which list the item is in. */ \
|
||||
( pxNewListItem )->pxContainer = ( pxList ); \
|
||||
\
|
||||
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) + 1U ); \
|
||||
} while( 0 )
|
||||
|
||||
/*
|
||||
* Access function to obtain the owner of the first entry in a list. Lists
|
||||
@@ -453,7 +359,7 @@ void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Insert a list item into a list. The item will be inserted into the list in
|
||||
* a position determined by its item value (ascending item value order).
|
||||
* a position determined by its item value (descending item value order).
|
||||
*
|
||||
* @param pxList The list into which the item is to be inserted.
|
||||
*
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -80,19 +78,18 @@
|
||||
* Type by which message buffers are referenced. For example, a call to
|
||||
* xMessageBufferCreate() returns an MessageBufferHandle_t variable that can
|
||||
* then be used as a parameter to xMessageBufferSend(), xMessageBufferReceive(),
|
||||
* etc. Message buffer is essentially built as a stream buffer hence its handle
|
||||
* is also set to same type as a stream buffer handle.
|
||||
* etc.
|
||||
*/
|
||||
typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
typedef void * MessageBufferHandle_t;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* MessageBufferHandle_t xMessageBufferCreate( size_t xBufferSizeBytes );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new message buffer using dynamically allocated memory. See
|
||||
* xMessageBufferCreateStatic() for a version that uses statically allocated
|
||||
@@ -100,8 +97,6 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
*
|
||||
* configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
|
||||
* FreeRTOSConfig.h for xMessageBufferCreate() to be available.
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferCreate() to be available.
|
||||
*
|
||||
* @param xBufferSizeBytes The total number of bytes (not messages) the message
|
||||
* buffer will be able to hold at any one time. When a message is written to
|
||||
@@ -110,18 +105,6 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* 32-bit architecture, so on most 32-bit architectures a 10 byte message will
|
||||
* take up 14 bytes of message buffer space.
|
||||
*
|
||||
* @param pxSendCompletedCallback Callback invoked when a send operation to the
|
||||
* message buffer is complete. If the parameter is NULL or xMessageBufferCreate()
|
||||
* is called without the parameter, then it will use the default implementation
|
||||
* provided by sbSEND_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @param pxReceiveCompletedCallback Callback invoked when a receive operation from
|
||||
* the message buffer is complete. If the parameter is NULL or xMessageBufferCreate()
|
||||
* is called without the parameter, it will use the default implementation provided
|
||||
* by sbRECEIVE_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @return If NULL is returned, then the message buffer cannot be created
|
||||
* because there is insufficient heap memory available for FreeRTOS to allocate
|
||||
* the message buffer data structures and storage area. A non-NULL value being
|
||||
@@ -130,7 +113,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* buffer.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* void vAFunction( void )
|
||||
* {
|
||||
@@ -140,7 +123,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // Create a message buffer that can hold 100 bytes. The memory used to hold
|
||||
* // both the message buffer structure and the messages themselves is allocated
|
||||
* // dynamically. Each message added to the buffer consumes an additional 4
|
||||
* // bytes which are used to hold the length of the message.
|
||||
* // bytes which are used to hold the lengh of the message.
|
||||
* xMessageBuffer = xMessageBufferCreate( xMessageBufferSizeBytes );
|
||||
*
|
||||
* if( xMessageBuffer == NULL )
|
||||
@@ -153,32 +136,24 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // The message buffer was created successfully and can now be used.
|
||||
* }
|
||||
*
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xMessageBufferCreate xMessageBufferCreate
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferCreate( xBufferSizeBytes ) \
|
||||
xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, sbTYPE_MESSAGE_BUFFER, NULL, NULL )
|
||||
|
||||
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
|
||||
#define xMessageBufferCreateWithCallback( xBufferSizeBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
|
||||
xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( size_t ) 0, sbTYPE_MESSAGE_BUFFER, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
|
||||
#endif
|
||||
( MessageBufferHandle_t ) xStreamBufferGenericCreate( xBufferSizeBytes, ( size_t ) 0, pdTRUE )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* MessageBufferHandle_t xMessageBufferCreateStatic( size_t xBufferSizeBytes,
|
||||
* uint8_t *pucMessageBufferStorageArea,
|
||||
* StaticMessageBuffer_t *pxStaticMessageBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
* Creates a new message buffer using statically allocated memory. See
|
||||
* xMessageBufferCreate() for a version that uses dynamically allocated memory.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferCreateStatic() to be available.
|
||||
*
|
||||
* @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
|
||||
* pucMessageBufferStorageArea parameter. When a message is written to the
|
||||
* message buffer an additional sizeof( size_t ) bytes are also written to store
|
||||
@@ -188,29 +163,19 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* stored in the message buffer is actually (xBufferSizeBytes - 1).
|
||||
*
|
||||
* @param pucMessageBufferStorageArea Must point to a uint8_t array that is at
|
||||
* least xBufferSizeBytes big. This is the array to which messages are
|
||||
* least xBufferSizeBytes + 1 big. This is the array to which messages are
|
||||
* copied when they are written to the message buffer.
|
||||
*
|
||||
* @param pxStaticMessageBuffer Must point to a variable of type
|
||||
* StaticMessageBuffer_t, which will be used to hold the message buffer's data
|
||||
* structure.
|
||||
*
|
||||
* @param pxSendCompletedCallback Callback invoked when a new message is sent to the message buffer.
|
||||
* If the parameter is NULL or xMessageBufferCreate() is called without the parameter, then it will use the default
|
||||
* implementation provided by sbSEND_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @param pxReceiveCompletedCallback Callback invoked when a message is read from a
|
||||
* message buffer. If the parameter is NULL or xMessageBufferCreate() is called without the parameter, it will
|
||||
* use the default implementation provided by sbRECEIVE_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @return If the message buffer is created successfully then a handle to the
|
||||
* created message buffer is returned. If either pucMessageBufferStorageArea or
|
||||
* pxStaticmessageBuffer are NULL then NULL is returned.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* // Used to dimension the array used to hold the messages. The available space
|
||||
* // will actually be one less than this, so 999.
|
||||
@@ -227,8 +192,8 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* {
|
||||
* MessageBufferHandle_t xMessageBuffer;
|
||||
*
|
||||
* xMessageBuffer = xMessageBufferCreateStatic( sizeof( ucStorageBuffer ),
|
||||
* ucStorageBuffer,
|
||||
* xMessageBuffer = xMessageBufferCreateStatic( sizeof( ucBufferStorage ),
|
||||
* ucBufferStorage,
|
||||
* &xMessageBufferStruct );
|
||||
*
|
||||
* // As neither the pucMessageBufferStorageArea or pxStaticMessageBuffer
|
||||
@@ -238,61 +203,22 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // Other code that uses the message buffer can go here.
|
||||
* }
|
||||
*
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xMessageBufferCreateStatic xMessageBufferCreateStatic
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferCreateStatic( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer ) \
|
||||
xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, sbTYPE_MESSAGE_BUFFER, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), NULL, NULL )
|
||||
|
||||
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
|
||||
#define xMessageBufferCreateStaticWithCallback( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
|
||||
xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), 0, sbTYPE_MESSAGE_BUFFER, ( pucMessageBufferStorageArea ), ( pxStaticMessageBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
|
||||
#endif
|
||||
( MessageBufferHandle_t ) xStreamBufferGenericCreateStatic( xBufferSizeBytes, 0, pdTRUE, pucMessageBufferStorageArea, pxStaticMessageBuffer )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferGetStaticBuffers( MessageBufferHandle_t xMessageBuffer,
|
||||
* uint8_t ** ppucMessageBufferStorageArea,
|
||||
* StaticMessageBuffer_t ** ppxStaticMessageBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* Retrieve pointers to a statically created message buffer's data structure
|
||||
* buffer and storage area buffer. These are the same buffers that are supplied
|
||||
* at the time of creation.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferGetStaticBuffers() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The message buffer for which to retrieve the buffers.
|
||||
*
|
||||
* @param ppucMessageBufferStorageArea Used to return a pointer to the
|
||||
* message buffer's storage area buffer.
|
||||
*
|
||||
* @param ppxStaticMessageBuffer Used to return a pointer to the message
|
||||
* buffer's data structure buffer.
|
||||
*
|
||||
* @return pdTRUE if buffers were retrieved, pdFALSE otherwise..
|
||||
*
|
||||
* \defgroup xMessageBufferGetStaticBuffers xMessageBufferGetStaticBuffers
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
#define xMessageBufferGetStaticBuffers( xMessageBuffer, ppucMessageBufferStorageArea, ppxStaticMessageBuffer ) \
|
||||
xStreamBufferGetStaticBuffers( ( xMessageBuffer ), ( ppucMessageBufferStorageArea ), ( ppxStaticMessageBuffer ) )
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xMessageBufferSend( MessageBufferHandle_t xMessageBuffer,
|
||||
* const void *pvTxData,
|
||||
* size_t xDataLengthBytes,
|
||||
* TickType_t xTicksToWait );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Sends a discrete message to the message buffer. The message can be any
|
||||
* length that fits within the buffer's free space, and is copied into the
|
||||
@@ -317,9 +243,6 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* xMessageBufferSendFromISR() to write to a message buffer from an interrupt
|
||||
* service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferSend() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer to which a message is
|
||||
* being sent.
|
||||
*
|
||||
@@ -352,7 +275,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* time out then xDataLengthBytes is returned.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vAFunction( MessageBufferHandle_t xMessageBuffer )
|
||||
* {
|
||||
* size_t xBytesSent;
|
||||
@@ -380,22 +303,22 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // not enough free space in the buffer.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xMessageBufferSend xMessageBufferSend
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferSend( xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait ) \
|
||||
xStreamBufferSend( ( xMessageBuffer ), ( pvTxData ), ( xDataLengthBytes ), ( xTicksToWait ) )
|
||||
xStreamBufferSend( ( StreamBufferHandle_t ) xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xMessageBufferSendFromISR( MessageBufferHandle_t xMessageBuffer,
|
||||
* const void *pvTxData,
|
||||
* size_t xDataLengthBytes,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Interrupt safe version of the API function that sends a discrete message to
|
||||
* the message buffer. The message can be any length that fits within the
|
||||
@@ -420,9 +343,6 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* xMessageBufferSendFromISR() to write to a message buffer from an interrupt
|
||||
* service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferSendFromISR() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer to which a message is
|
||||
* being sent.
|
||||
*
|
||||
@@ -456,7 +376,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* then 0 is returned, otherwise xDataLengthBytes is returned.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A message buffer that has already been created.
|
||||
* MessageBufferHandle_t xMessageBuffer;
|
||||
*
|
||||
@@ -488,22 +408,22 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // documentation for the port in use for port specific instructions.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xMessageBufferSendFromISR xMessageBufferSendFromISR
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferSendFromISR( xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken ) \
|
||||
xStreamBufferSendFromISR( ( xMessageBuffer ), ( pvTxData ), ( xDataLengthBytes ), ( pxHigherPriorityTaskWoken ) )
|
||||
xStreamBufferSendFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xMessageBufferReceive( MessageBufferHandle_t xMessageBuffer,
|
||||
* void *pvRxData,
|
||||
* size_t xBufferLengthBytes,
|
||||
* TickType_t xTicksToWait );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Receives a discrete message from a message buffer. Messages can be of
|
||||
* variable length and are copied out of the buffer.
|
||||
@@ -527,9 +447,6 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* xMessageBufferReceiveFromISR() to read from a message buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferReceive() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer from which a message
|
||||
* is being received.
|
||||
*
|
||||
@@ -559,7 +476,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* zero is returned.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vAFunction( MessageBuffer_t xMessageBuffer )
|
||||
* {
|
||||
* uint8_t ucRxData[ 20 ];
|
||||
@@ -580,23 +497,23 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // the message here....
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xMessageBufferReceive xMessageBufferReceive
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferReceive( xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait ) \
|
||||
xStreamBufferReceive( ( xMessageBuffer ), ( pvRxData ), ( xBufferLengthBytes ), ( xTicksToWait ) )
|
||||
xStreamBufferReceive( ( StreamBufferHandle_t ) xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait )
|
||||
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xMessageBufferReceiveFromISR( MessageBufferHandle_t xMessageBuffer,
|
||||
* void *pvRxData,
|
||||
* size_t xBufferLengthBytes,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* An interrupt safe version of the API function that receives a discrete
|
||||
* message from a message buffer. Messages can be of variable length and are
|
||||
@@ -621,9 +538,6 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* xMessageBufferReceiveFromISR() to read from a message buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferReceiveFromISR() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer from which a message
|
||||
* is being received.
|
||||
*
|
||||
@@ -653,7 +567,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* any.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A message buffer that has already been created.
|
||||
* MessageBuffer_t xMessageBuffer;
|
||||
*
|
||||
@@ -685,19 +599,19 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* // documentation for the port in use for port specific instructions.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xMessageBufferReceiveFromISR xMessageBufferReceiveFromISR
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferReceiveFromISR( xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken ) \
|
||||
xStreamBufferReceiveFromISR( ( xMessageBuffer ), ( pvRxData ), ( xBufferLengthBytes ), ( pxHigherPriorityTaskWoken ) )
|
||||
xStreamBufferReceiveFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vMessageBufferDelete( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Deletes a message buffer that was previously created using a call to
|
||||
* xMessageBufferCreate() or xMessageBufferCreateStatic(). If the message
|
||||
@@ -707,47 +621,38 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* A message buffer handle must not be used after the message buffer has been
|
||||
* deleted.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* vMessageBufferDelete() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer to be deleted.
|
||||
*
|
||||
*/
|
||||
#define vMessageBufferDelete( xMessageBuffer ) \
|
||||
vStreamBufferDelete( xMessageBuffer )
|
||||
vStreamBufferDelete( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferIsFull( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
* <pre>
|
||||
* BaseType_t xMessageBufferIsFull( MessageBufferHandle_t xMessageBuffer ) );
|
||||
* </pre>
|
||||
*
|
||||
* Tests to see if a message buffer is full. A message buffer is full if it
|
||||
* cannot accept any more messages, of any size, until space is made available
|
||||
* by a message being removed from the message buffer.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferIsFull() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being queried.
|
||||
*
|
||||
* @return If the message buffer referenced by xMessageBuffer is full then
|
||||
* pdTRUE is returned. Otherwise pdFALSE is returned.
|
||||
*/
|
||||
#define xMessageBufferIsFull( xMessageBuffer ) \
|
||||
xStreamBufferIsFull( xMessageBuffer )
|
||||
xStreamBufferIsFull( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferIsEmpty( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
* <pre>
|
||||
* BaseType_t xMessageBufferIsEmpty( MessageBufferHandle_t xMessageBuffer ) );
|
||||
* </pre>
|
||||
*
|
||||
* Tests to see if a message buffer is empty (does not contain any messages).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferIsEmpty() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being queried.
|
||||
*
|
||||
* @return If the message buffer referenced by xMessageBuffer is empty then
|
||||
@@ -755,26 +660,19 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
*
|
||||
*/
|
||||
#define xMessageBufferIsEmpty( xMessageBuffer ) \
|
||||
xStreamBufferIsEmpty( xMessageBuffer )
|
||||
xStreamBufferIsEmpty( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xMessageBufferReset( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Resets a message buffer to its initial empty state, discarding any message it
|
||||
* contained.
|
||||
*
|
||||
* A message buffer can only be reset if there are no tasks blocked on it.
|
||||
*
|
||||
* Use xMessageBufferReset() to reset a message buffer from a task.
|
||||
* Use xMessageBufferResetFromISR() to reset a message buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferReset() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being reset.
|
||||
*
|
||||
* @return If the message buffer was reset then pdPASS is returned. If the
|
||||
@@ -786,51 +684,16 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferReset( xMessageBuffer ) \
|
||||
xStreamBufferReset( xMessageBuffer )
|
||||
xStreamBufferReset( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferResetFromISR( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* An interrupt safe version of the API function that resets the message buffer.
|
||||
* Resets a message buffer to its initial empty state, discarding any message it
|
||||
* contained.
|
||||
*
|
||||
* A message buffer can only be reset if there are no tasks blocked on it.
|
||||
*
|
||||
* Use xMessageBufferReset() to reset a message buffer from a task.
|
||||
* Use xMessageBufferResetFromISR() to reset a message buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferResetFromISR() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being reset.
|
||||
*
|
||||
* @return If the message buffer was reset then pdPASS is returned. If the
|
||||
* message buffer could not be reset because either there was a task blocked on
|
||||
* the message queue to wait for space to become available, or to wait for a
|
||||
* a message to be available, then pdFAIL is returned.
|
||||
*
|
||||
* \defgroup xMessageBufferResetFromISR xMessageBufferResetFromISR
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferResetFromISR( xMessageBuffer ) \
|
||||
xStreamBufferResetFromISR( xMessageBuffer )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* size_t xMessageBufferSpaceAvailable( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
* <pre>
|
||||
* size_t xMessageBufferSpaceAvailable( MessageBufferHandle_t xMessageBuffer ) );
|
||||
* </pre>
|
||||
* Returns the number of bytes of free space in the message buffer.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferSpaceAvailable() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being queried.
|
||||
*
|
||||
* @return The number of bytes that can be written to the message buffer before
|
||||
@@ -844,22 +707,19 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferSpaceAvailable( xMessageBuffer ) \
|
||||
xStreamBufferSpacesAvailable( xMessageBuffer )
|
||||
xStreamBufferSpacesAvailable( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||
#define xMessageBufferSpacesAvailable( xMessageBuffer ) \
|
||||
xStreamBufferSpacesAvailable( xMessageBuffer ) /* Corrects typo in original macro name. */
|
||||
xStreamBufferSpacesAvailable( ( StreamBufferHandle_t ) xMessageBuffer ) /* Corrects typo in original macro name. */
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
* @code{c}
|
||||
* size_t xMessageBufferNextLengthBytes( MessageBufferHandle_t xMessageBuffer );
|
||||
* @endcode
|
||||
* <pre>
|
||||
* size_t xMessageBufferNextLengthBytes( MessageBufferHandle_t xMessageBuffer ) );
|
||||
* </pre>
|
||||
* Returns the length (in bytes) of the next message in a message buffer.
|
||||
* Useful if xMessageBufferReceive() returned 0 because the size of the buffer
|
||||
* passed into xMessageBufferReceive() was too small to hold the next message.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferNextLengthBytes() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the message buffer being queried.
|
||||
*
|
||||
* @return The length (in bytes) of the next message in the message buffer, or 0
|
||||
@@ -869,14 +729,14 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* \ingroup MessageBufferManagement
|
||||
*/
|
||||
#define xMessageBufferNextLengthBytes( xMessageBuffer ) \
|
||||
xStreamBufferNextMessageLengthBytes( xMessageBuffer )
|
||||
xStreamBufferNextMessageLengthBytes( ( StreamBufferHandle_t ) xMessageBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferSendCompletedFromISR( MessageBufferHandle_t xMessageBuffer, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* <pre>
|
||||
* BaseType_t xMessageBufferSendCompletedFromISR( MessageBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* </pre>
|
||||
*
|
||||
* For advanced users only.
|
||||
*
|
||||
@@ -891,10 +751,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
|
||||
* additional information.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferSendCompletedFromISR() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the stream buffer to which data was
|
||||
* @param xStreamBuffer The handle of the stream buffer to which data was
|
||||
* written.
|
||||
*
|
||||
* @param pxHigherPriorityTaskWoken *pxHigherPriorityTaskWoken should be
|
||||
@@ -912,14 +769,14 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
#define xMessageBufferSendCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) \
|
||||
xStreamBufferSendCompletedFromISR( ( xMessageBuffer ), ( pxHigherPriorityTaskWoken ) )
|
||||
xStreamBufferSendCompletedFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pxHigherPriorityTaskWoken )
|
||||
|
||||
/**
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* BaseType_t xMessageBufferReceiveCompletedFromISR( MessageBufferHandle_t xMessageBuffer, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* <pre>
|
||||
* BaseType_t xMessageBufferReceiveCompletedFromISR( MessageBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* </pre>
|
||||
*
|
||||
* For advanced users only.
|
||||
*
|
||||
@@ -935,10 +792,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
|
||||
* additional information.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xMessageBufferReceiveCompletedFromISR() to be available.
|
||||
*
|
||||
* @param xMessageBuffer The handle of the stream buffer from which data was
|
||||
* @param xStreamBuffer The handle of the stream buffer from which data was
|
||||
* read.
|
||||
*
|
||||
* @param pxHigherPriorityTaskWoken *pxHigherPriorityTaskWoken should be
|
||||
@@ -956,7 +810,7 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
#define xMessageBufferReceiveCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) \
|
||||
xStreamBufferReceiveCompletedFromISR( ( xMessageBuffer ), ( pxHigherPriorityTaskWoken ) )
|
||||
xStreamBufferReceiveCompletedFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pxHigherPriorityTaskWoken )
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#if defined( __cplusplus )
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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,45 +36,29 @@
|
||||
#ifndef MPU_PROTOTYPES_H
|
||||
#define MPU_PROTOTYPES_H
|
||||
|
||||
typedef struct xTaskGenericNotifyParams
|
||||
{
|
||||
TaskHandle_t xTaskToNotify;
|
||||
UBaseType_t uxIndexToNotify;
|
||||
uint32_t ulValue;
|
||||
eNotifyAction eAction;
|
||||
uint32_t * pulPreviousNotificationValue;
|
||||
} xTaskGenericNotifyParams_t;
|
||||
|
||||
typedef struct xTaskGenericNotifyWaitParams
|
||||
{
|
||||
UBaseType_t uxIndexToWaitOn;
|
||||
uint32_t ulBitsToClearOnEntry;
|
||||
uint32_t ulBitsToClearOnExit;
|
||||
uint32_t * pulNotificationValue;
|
||||
TickType_t xTicksToWait;
|
||||
} xTaskGenericNotifyWaitParams_t;
|
||||
|
||||
typedef struct xTimerGenericCommandFromTaskParams
|
||||
{
|
||||
TimerHandle_t xTimer;
|
||||
BaseType_t xCommandID;
|
||||
TickType_t xOptionalValue;
|
||||
BaseType_t * pxHigherPriorityTaskWoken;
|
||||
TickType_t xTicksToWait;
|
||||
} xTimerGenericCommandFromTaskParams_t;
|
||||
|
||||
typedef struct xEventGroupWaitBitsParams
|
||||
{
|
||||
EventGroupHandle_t xEventGroup;
|
||||
EventBits_t uxBitsToWaitFor;
|
||||
BaseType_t xClearOnExit;
|
||||
BaseType_t xWaitForAllBits;
|
||||
TickType_t xTicksToWait;
|
||||
} xEventGroupWaitBitsParams_t;
|
||||
|
||||
/* MPU versions of task.h API functions. */
|
||||
/* MPU versions of tasks.h API functions. */
|
||||
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
|
||||
const char * const pcName,
|
||||
const uint16_t usStackDepth,
|
||||
void * const pvParameters,
|
||||
UBaseType_t uxPriority,
|
||||
TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
||||
const char * const pcName,
|
||||
const uint32_t ulStackDepth,
|
||||
void * const pvParameters,
|
||||
UBaseType_t uxPriority,
|
||||
StackType_t * const puxStackBuffer,
|
||||
StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
|
||||
TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
|
||||
TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask,
|
||||
const MemoryRegion_t * const pxRegions ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
@@ -85,10 +67,17 @@ void MPU_vTaskGetInfo( TaskHandle_t xTask,
|
||||
TaskStatus_t * pxTaskStatus,
|
||||
BaseType_t xGetFreeStackSpace,
|
||||
eTaskState eState ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskPrioritySet( TaskHandle_t xTask,
|
||||
UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
|
||||
TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
|
||||
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
|
||||
@@ -99,26 +88,25 @@ void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
|
||||
void * pvValue ) FREERTOS_SYSTEM_CALL;
|
||||
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
|
||||
BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
|
||||
void * pvParameter ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
||||
const UBaseType_t uxArraySize,
|
||||
configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) FREERTOS_SYSTEM_CALL;
|
||||
uint32_t * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
|
||||
uint32_t MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskGetRunTimeStats( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
|
||||
UBaseType_t uxIndexToNotify,
|
||||
uint32_t ulValue,
|
||||
eNotifyAction eAction,
|
||||
uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
|
||||
uint32_t ulBitsToClearOnEntry,
|
||||
uint32_t ulBitsToClearOnExit,
|
||||
uint32_t * pulNotificationValue,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
||||
BaseType_t xClearCountOnExit,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
@@ -127,58 +115,14 @@ BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
||||
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
||||
UBaseType_t uxIndexToClear,
|
||||
uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||
TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/* Privileged only wrappers for Task APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
|
||||
const char * const pcName,
|
||||
const configSTACK_DEPTH_TYPE uxStackDepth,
|
||||
void * const pvParameters,
|
||||
UBaseType_t uxPriority,
|
||||
TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
|
||||
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
|
||||
const char * const pcName,
|
||||
const configSTACK_DEPTH_TYPE uxStackDepth,
|
||||
void * const pvParameters,
|
||||
UBaseType_t uxPriority,
|
||||
StackType_t * const puxStackBuffer,
|
||||
StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
|
||||
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION;
|
||||
void MPU_vTaskPrioritySet( TaskHandle_t xTask,
|
||||
UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION;
|
||||
TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
|
||||
void * pvParameter ) PRIVILEGED_FUNCTION;
|
||||
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
|
||||
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
|
||||
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
|
||||
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTaskToModify,
|
||||
const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskGetStaticBuffers( TaskHandle_t xTask,
|
||||
StackType_t ** ppuxStackBuffer,
|
||||
StaticTask_t ** ppxTaskBuffer ) PRIVILEGED_FUNCTION;
|
||||
UBaseType_t MPU_uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
|
||||
UBaseType_t MPU_uxTaskBasePriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
|
||||
UBaseType_t MPU_uxTaskBasePriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
|
||||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify,
|
||||
UBaseType_t uxIndexToNotify,
|
||||
uint32_t ulValue,
|
||||
eNotifyAction eAction,
|
||||
uint32_t * pulPreviousNotificationValue,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
void MPU_vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify,
|
||||
UBaseType_t uxIndexToNotify,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/* MPU versions of queue.h API functions. */
|
||||
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
|
||||
@@ -195,6 +139,15 @@ BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
||||
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
||||
StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
||||
const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
||||
const UBaseType_t uxInitialCount,
|
||||
StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
@@ -203,109 +156,70 @@ void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
|
||||
const char * pcName ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
||||
const UBaseType_t uxItemSize,
|
||||
const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
||||
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
|
||||
const UBaseType_t uxItemSize,
|
||||
uint8_t * pucQueueStorage,
|
||||
StaticQueue_t * pxStaticQueue,
|
||||
const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
|
||||
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
|
||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
||||
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
|
||||
BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue,
|
||||
UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/* Privileged only wrappers for Queue APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
void MPU_vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
||||
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
||||
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
||||
const UBaseType_t uxInitialCount,
|
||||
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
||||
const UBaseType_t uxItemSize,
|
||||
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
|
||||
const UBaseType_t uxItemSize,
|
||||
uint8_t * pucQueueStorage,
|
||||
StaticQueue_t * pxStaticQueue,
|
||||
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
|
||||
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueGenericGetStaticBuffers( QueueHandle_t xQueue,
|
||||
uint8_t ** ppucQueueStorage,
|
||||
StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
||||
const void * const pvItemToQueue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||
void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueReceiveFromISR( QueueHandle_t xQueue,
|
||||
void * const pvBuffer,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
UBaseType_t MPU_uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
TaskHandle_t MPU_xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/* MPU versions of timers.h API functions. */
|
||||
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
|
||||
void * pvNewID ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||
const BaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/* Privileged only wrappers for Timer APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
|
||||
TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
|
||||
TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction,
|
||||
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTimerGetStaticBuffer( TimerHandle_t xTimer,
|
||||
StaticTimer_t ** ppxTimerBuffer ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xTimerGenericCommandFromISR( TimerHandle_t xTimer,
|
||||
StaticTimer_t * pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
|
||||
void * pvNewID ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
||||
void * pvParameter1,
|
||||
uint32_t ulParameter2,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||
const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/* MPU versions of event_group.h API functions. */
|
||||
EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
|
||||
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToWaitFor,
|
||||
const BaseType_t xClearOnExit,
|
||||
const BaseType_t xWaitForAllBits,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) FREERTOS_SYSTEM_CALL;
|
||||
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
|
||||
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
@@ -314,26 +228,8 @@ EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet,
|
||||
const EventBits_t uxBitsToWaitFor,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
|
||||
UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vEventGroupSetNumber( void * xEventGroup,
|
||||
UBaseType_t uxEventGroupNumber ) FREERTOS_SYSTEM_CALL;
|
||||
#endif /* ( configUSE_TRACE_FACILITY == 1 )*/
|
||||
|
||||
/* Privileged only wrappers for Event Group APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
EventGroupHandle_t MPU_xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
|
||||
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
||||
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
|
||||
StaticEventGroup_t ** ppxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
EventBits_t MPU_xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/* MPU versions of message/stream_buffer.h API functions. */
|
||||
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
@@ -344,46 +240,24 @@ size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
void * pvRxData,
|
||||
size_t xBufferLengthBytes,
|
||||
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
|
||||
size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||
size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
|
||||
size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/* Privileged only wrappers for Stream Buffer APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes,
|
||||
size_t xTriggerLevelBytes,
|
||||
BaseType_t xStreamBufferType,
|
||||
StreamBufferCallbackFunction_t pxSendCompletedCallback,
|
||||
StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t xIsMessageBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
|
||||
size_t xTriggerLevelBytes,
|
||||
BaseType_t xStreamBufferType,
|
||||
BaseType_t xIsMessageBuffer,
|
||||
uint8_t * const pucStreamBufferStorageArea,
|
||||
StaticStreamBuffer_t * const pxStaticStreamBuffer,
|
||||
StreamBufferCallbackFunction_t pxSendCompletedCallback,
|
||||
StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
|
||||
void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffers,
|
||||
uint8_t * ppucStreamBufferStorageArea,
|
||||
StaticStreamBuffer_t * ppxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
const void * pvTxData,
|
||||
size_t xDataLengthBytes,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
void * pvRxData,
|
||||
size_t xBufferLengthBytes,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t MPU_xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
StaticStreamBuffer_t * const pxStaticStreamBuffer ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
|
||||
|
||||
#endif /* MPU_PROTOTYPES_H */
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MPU_SYSCALL_NUMBERS_H
|
||||
#define MPU_SYSCALL_NUMBERS_H
|
||||
|
||||
/* Numbers assigned to various system calls. */
|
||||
#define SYSTEM_CALL_xTaskGenericNotify 0
|
||||
#define SYSTEM_CALL_xTaskGenericNotifyWait 1
|
||||
#define SYSTEM_CALL_xTimerGenericCommandFromTask 2
|
||||
#define SYSTEM_CALL_xEventGroupWaitBits 3
|
||||
#define SYSTEM_CALL_xTaskDelayUntil 4
|
||||
#define SYSTEM_CALL_xTaskAbortDelay 5
|
||||
#define SYSTEM_CALL_vTaskDelay 6
|
||||
#define SYSTEM_CALL_uxTaskPriorityGet 7
|
||||
#define SYSTEM_CALL_eTaskGetState 8
|
||||
#define SYSTEM_CALL_vTaskGetInfo 9
|
||||
#define SYSTEM_CALL_xTaskGetIdleTaskHandle 10
|
||||
#define SYSTEM_CALL_vTaskSuspend 11
|
||||
#define SYSTEM_CALL_vTaskResume 12
|
||||
#define SYSTEM_CALL_xTaskGetTickCount 13
|
||||
#define SYSTEM_CALL_uxTaskGetNumberOfTasks 14
|
||||
#define SYSTEM_CALL_ulTaskGetRunTimeCounter 15
|
||||
#define SYSTEM_CALL_ulTaskGetRunTimePercent 16
|
||||
#define SYSTEM_CALL_ulTaskGetIdleRunTimePercent 17
|
||||
#define SYSTEM_CALL_ulTaskGetIdleRunTimeCounter 18
|
||||
#define SYSTEM_CALL_vTaskSetApplicationTaskTag 19
|
||||
#define SYSTEM_CALL_xTaskGetApplicationTaskTag 20
|
||||
#define SYSTEM_CALL_vTaskSetThreadLocalStoragePointer 21
|
||||
#define SYSTEM_CALL_pvTaskGetThreadLocalStoragePointer 22
|
||||
#define SYSTEM_CALL_uxTaskGetSystemState 23
|
||||
#define SYSTEM_CALL_uxTaskGetStackHighWaterMark 24
|
||||
#define SYSTEM_CALL_uxTaskGetStackHighWaterMark2 25
|
||||
#define SYSTEM_CALL_xTaskGetCurrentTaskHandle 26
|
||||
#define SYSTEM_CALL_xTaskGetSchedulerState 27
|
||||
#define SYSTEM_CALL_vTaskSetTimeOutState 28
|
||||
#define SYSTEM_CALL_xTaskCheckForTimeOut 29
|
||||
#define SYSTEM_CALL_ulTaskGenericNotifyTake 30
|
||||
#define SYSTEM_CALL_xTaskGenericNotifyStateClear 31
|
||||
#define SYSTEM_CALL_ulTaskGenericNotifyValueClear 32
|
||||
#define SYSTEM_CALL_xQueueGenericSend 33
|
||||
#define SYSTEM_CALL_uxQueueMessagesWaiting 34
|
||||
#define SYSTEM_CALL_uxQueueSpacesAvailable 35
|
||||
#define SYSTEM_CALL_xQueueReceive 36
|
||||
#define SYSTEM_CALL_xQueuePeek 37
|
||||
#define SYSTEM_CALL_xQueueSemaphoreTake 38
|
||||
#define SYSTEM_CALL_xQueueGetMutexHolder 39
|
||||
#define SYSTEM_CALL_xQueueTakeMutexRecursive 40
|
||||
#define SYSTEM_CALL_xQueueGiveMutexRecursive 41
|
||||
#define SYSTEM_CALL_xQueueSelectFromSet 42
|
||||
#define SYSTEM_CALL_xQueueAddToSet 43
|
||||
#define SYSTEM_CALL_vQueueAddToRegistry 44
|
||||
#define SYSTEM_CALL_vQueueUnregisterQueue 45
|
||||
#define SYSTEM_CALL_pcQueueGetName 46
|
||||
#define SYSTEM_CALL_pvTimerGetTimerID 47
|
||||
#define SYSTEM_CALL_vTimerSetTimerID 48
|
||||
#define SYSTEM_CALL_xTimerIsTimerActive 49
|
||||
#define SYSTEM_CALL_xTimerGetTimerDaemonTaskHandle 50
|
||||
#define SYSTEM_CALL_pcTimerGetName 51
|
||||
#define SYSTEM_CALL_vTimerSetReloadMode 52
|
||||
#define SYSTEM_CALL_xTimerGetReloadMode 53
|
||||
#define SYSTEM_CALL_uxTimerGetReloadMode 54
|
||||
#define SYSTEM_CALL_xTimerGetPeriod 55
|
||||
#define SYSTEM_CALL_xTimerGetExpiryTime 56
|
||||
#define SYSTEM_CALL_xEventGroupClearBits 57
|
||||
#define SYSTEM_CALL_xEventGroupSetBits 58
|
||||
#define SYSTEM_CALL_xEventGroupSync 59
|
||||
#define SYSTEM_CALL_uxEventGroupGetNumber 60
|
||||
#define SYSTEM_CALL_vEventGroupSetNumber 61
|
||||
#define SYSTEM_CALL_xStreamBufferSend 62
|
||||
#define SYSTEM_CALL_xStreamBufferReceive 63
|
||||
#define SYSTEM_CALL_xStreamBufferIsFull 64
|
||||
#define SYSTEM_CALL_xStreamBufferIsEmpty 65
|
||||
#define SYSTEM_CALL_xStreamBufferSpacesAvailable 66
|
||||
#define SYSTEM_CALL_xStreamBufferBytesAvailable 67
|
||||
#define SYSTEM_CALL_xStreamBufferSetTriggerLevel 68
|
||||
#define SYSTEM_CALL_xStreamBufferNextMessageLengthBytes 69
|
||||
#define NUM_SYSTEM_CALLS 70 /* Total number of system calls. */
|
||||
|
||||
#endif /* MPU_SYSCALL_NUMBERS_H */
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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,7 +29,8 @@
|
||||
|
||||
/* This file redefines API functions to be called through a wrapper macro, but
|
||||
* only for ports that are using the MPU. */
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
#ifdef portUSING_MPU_WRAPPERS
|
||||
#error MPU
|
||||
|
||||
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
|
||||
* included from queue.c or task.c to prevent it from having an effect within
|
||||
@@ -46,67 +45,51 @@
|
||||
* privileges.
|
||||
*/
|
||||
|
||||
/* Map standard task.h API functions to the MPU equivalents. */
|
||||
/* Map standard tasks.h API functions to the MPU equivalents. */
|
||||
#define xTaskCreate MPU_xTaskCreate
|
||||
#define xTaskCreateStatic MPU_xTaskCreateStatic
|
||||
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
|
||||
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
|
||||
#define vTaskDelete MPU_vTaskDelete
|
||||
#define vTaskDelay MPU_vTaskDelay
|
||||
#define xTaskDelayUntil MPU_xTaskDelayUntil
|
||||
#define vTaskDelayUntil MPU_vTaskDelayUntil
|
||||
#define xTaskAbortDelay MPU_xTaskAbortDelay
|
||||
#define uxTaskPriorityGet MPU_uxTaskPriorityGet
|
||||
#define eTaskGetState MPU_eTaskGetState
|
||||
#define vTaskGetInfo MPU_vTaskGetInfo
|
||||
#define vTaskPrioritySet MPU_vTaskPrioritySet
|
||||
#define vTaskSuspend MPU_vTaskSuspend
|
||||
#define vTaskResume MPU_vTaskResume
|
||||
#define vTaskSuspendAll MPU_vTaskSuspendAll
|
||||
#define xTaskResumeAll MPU_xTaskResumeAll
|
||||
#define xTaskGetTickCount MPU_xTaskGetTickCount
|
||||
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
|
||||
#define pcTaskGetName MPU_pcTaskGetName
|
||||
#define xTaskGetHandle MPU_xTaskGetHandle
|
||||
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
|
||||
#define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
|
||||
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
|
||||
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
|
||||
#define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
|
||||
#define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
|
||||
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
|
||||
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
|
||||
#define uxTaskGetSystemState MPU_uxTaskGetSystemState
|
||||
#define vTaskList MPU_vTaskList
|
||||
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
|
||||
#define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
|
||||
#define ulTaskGetIdleRunTimePercent MPU_ulTaskGetIdleRunTimePercent
|
||||
#define xTaskGenericNotify MPU_xTaskGenericNotify
|
||||
#define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
|
||||
#define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
|
||||
#define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
|
||||
#define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
|
||||
#define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
|
||||
|
||||
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
|
||||
#define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
|
||||
#define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
|
||||
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
|
||||
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
#define ulTaskGetRunTimeCounter MPU_ulTaskGetRunTimeCounter
|
||||
#define ulTaskGetRunTimePercent MPU_ulTaskGetRunTimePercent
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
/* Privileged only wrappers for Task APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
#define xTaskCreate MPU_xTaskCreate
|
||||
#define xTaskCreateStatic MPU_xTaskCreateStatic
|
||||
#define vTaskDelete MPU_vTaskDelete
|
||||
#define vTaskPrioritySet MPU_vTaskPrioritySet
|
||||
#define xTaskGetHandle MPU_xTaskGetHandle
|
||||
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
#define pcTaskGetName MPU_pcTaskGetName
|
||||
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
|
||||
#define xTaskCreateRestrictedStatic MPU_xTaskCreateRestrictedStatic
|
||||
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
|
||||
#define xTaskGetStaticBuffers MPU_xTaskGetStaticBuffers
|
||||
#define uxTaskPriorityGetFromISR MPU_uxTaskPriorityGetFromISR
|
||||
#define uxTaskBasePriorityGet MPU_uxTaskBasePriorityGet
|
||||
#define uxTaskBasePriorityGetFromISR MPU_uxTaskBasePriorityGetFromISR
|
||||
#define xTaskResumeFromISR MPU_xTaskResumeFromISR
|
||||
#define xTaskGetApplicationTaskTagFromISR MPU_xTaskGetApplicationTaskTagFromISR
|
||||
#define xTaskGenericNotifyFromISR MPU_xTaskGenericNotifyFromISR
|
||||
#define vTaskGenericNotifyGiveFromISR MPU_vTaskGenericNotifyGiveFromISR
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
/* Map standard queue.h API functions to the MPU equivalents. */
|
||||
#define xQueueGenericSend MPU_xQueueGenericSend
|
||||
#define xQueueReceive MPU_xQueueReceive
|
||||
@@ -114,163 +97,90 @@
|
||||
#define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
|
||||
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
|
||||
#define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
|
||||
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
|
||||
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
|
||||
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
|
||||
#define xQueueAddToSet MPU_xQueueAddToSet
|
||||
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
|
||||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
|
||||
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
|
||||
#define pcQueueGetName MPU_pcQueueGetName
|
||||
#endif /* #if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
|
||||
/* Privileged only wrappers for Queue APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
#define vQueueDelete MPU_vQueueDelete
|
||||
#define xQueueCreateMutex MPU_xQueueCreateMutex
|
||||
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
|
||||
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
|
||||
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
|
||||
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
|
||||
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
|
||||
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
|
||||
#define xQueueGenericCreate MPU_xQueueGenericCreate
|
||||
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
|
||||
#define xQueueGenericReset MPU_xQueueGenericReset
|
||||
#define xQueueCreateSet MPU_xQueueCreateSet
|
||||
#define xQueueAddToSet MPU_xQueueAddToSet
|
||||
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
|
||||
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
|
||||
#define xQueueGenericReset MPU_xQueueGenericReset
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
#define xQueueGenericGetStaticBuffers MPU_xQueueGenericGetStaticBuffers
|
||||
#define xQueueGenericSendFromISR MPU_xQueueGenericSendFromISR
|
||||
#define xQueueGiveFromISR MPU_xQueueGiveFromISR
|
||||
#define xQueuePeekFromISR MPU_xQueuePeekFromISR
|
||||
#define xQueueReceiveFromISR MPU_xQueueReceiveFromISR
|
||||
#define xQueueIsQueueEmptyFromISR MPU_xQueueIsQueueEmptyFromISR
|
||||
#define xQueueIsQueueFullFromISR MPU_xQueueIsQueueFullFromISR
|
||||
#define uxQueueMessagesWaitingFromISR MPU_uxQueueMessagesWaitingFromISR
|
||||
#define xQueueGetMutexHolderFromISR MPU_xQueueGetMutexHolderFromISR
|
||||
#define xQueueSelectFromSetFromISR MPU_xQueueSelectFromSetFromISR
|
||||
#endif /* if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
#if (configQUEUE_REGISTRY_SIZE > 0)
|
||||
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
|
||||
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
|
||||
#define pcQueueGetName MPU_pcQueueGetName
|
||||
#endif
|
||||
|
||||
/* Map standard timer.h API functions to the MPU equivalents. */
|
||||
#define xTimerCreate MPU_xTimerCreate
|
||||
#define xTimerCreateStatic MPU_xTimerCreateStatic
|
||||
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
|
||||
#define vTimerSetTimerID MPU_vTimerSetTimerID
|
||||
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
|
||||
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
|
||||
#define xTimerGenericCommandFromTask MPU_xTimerGenericCommandFromTask
|
||||
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
|
||||
#define pcTimerGetName MPU_pcTimerGetName
|
||||
#define vTimerSetReloadMode MPU_vTimerSetReloadMode
|
||||
#define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
|
||||
#define xTimerGetPeriod MPU_xTimerGetPeriod
|
||||
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
|
||||
|
||||
/* Privileged only wrappers for Timer APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
#define xTimerGetReloadMode MPU_xTimerGetReloadMode
|
||||
#define xTimerCreate MPU_xTimerCreate
|
||||
#define xTimerCreateStatic MPU_xTimerCreateStatic
|
||||
#define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer
|
||||
#define xTimerGenericCommandFromISR MPU_xTimerGenericCommandFromISR
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
#define xTimerGenericCommand MPU_xTimerGenericCommand
|
||||
|
||||
/* Map standard event_group.h API functions to the MPU equivalents. */
|
||||
#define xEventGroupCreate MPU_xEventGroupCreate
|
||||
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
|
||||
#define xEventGroupWaitBits MPU_xEventGroupWaitBits
|
||||
#define xEventGroupClearBits MPU_xEventGroupClearBits
|
||||
#define xEventGroupSetBits MPU_xEventGroupSetBits
|
||||
#define xEventGroupSync MPU_xEventGroupSync
|
||||
|
||||
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||
#define uxEventGroupGetNumber MPU_uxEventGroupGetNumber
|
||||
#define vEventGroupSetNumber MPU_vEventGroupSetNumber
|
||||
#endif /* #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) ) */
|
||||
|
||||
/* Privileged only wrappers for Event Group APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
#define xEventGroupCreate MPU_xEventGroupCreate
|
||||
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
|
||||
#define vEventGroupDelete MPU_vEventGroupDelete
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
#define xEventGroupGetStaticBuffer MPU_xEventGroupGetStaticBuffer
|
||||
#define xEventGroupClearBitsFromISR MPU_xEventGroupClearBitsFromISR
|
||||
#define xEventGroupSetBitsFromISR MPU_xEventGroupSetBitsFromISR
|
||||
#define xEventGroupGetBitsFromISR MPU_xEventGroupGetBitsFromISR
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
|
||||
/* Map standard message/stream_buffer.h API functions to the MPU
|
||||
* equivalents. */
|
||||
#define xStreamBufferSend MPU_xStreamBufferSend
|
||||
#define xStreamBufferReceive MPU_xStreamBufferReceive
|
||||
#define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
|
||||
#define vStreamBufferDelete MPU_vStreamBufferDelete
|
||||
#define xStreamBufferIsFull MPU_xStreamBufferIsFull
|
||||
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
|
||||
#define xStreamBufferReset MPU_xStreamBufferReset
|
||||
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
|
||||
#define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
|
||||
#define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
|
||||
#define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
|
||||
|
||||
/* Privileged only wrappers for Stream Buffer APIs. These are needed so that
|
||||
* the application can use opaque handles maintained in mpu_wrappers.c
|
||||
* with all the APIs. */
|
||||
|
||||
#define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
|
||||
#define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
|
||||
#define vStreamBufferDelete MPU_vStreamBufferDelete
|
||||
#define xStreamBufferReset MPU_xStreamBufferReset
|
||||
|
||||
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
|
||||
#define xStreamBufferGetStaticBuffers MPU_xStreamBufferGetStaticBuffers
|
||||
#define xStreamBufferSendFromISR MPU_xStreamBufferSendFromISR
|
||||
#define xStreamBufferReceiveFromISR MPU_xStreamBufferReceiveFromISR
|
||||
#define xStreamBufferSendCompletedFromISR MPU_xStreamBufferSendCompletedFromISR
|
||||
#define xStreamBufferReceiveCompletedFromISR MPU_xStreamBufferReceiveCompletedFromISR
|
||||
#define xStreamBufferResetFromISR MPU_xStreamBufferResetFromISR
|
||||
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
|
||||
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
|
||||
* macro so applications can place data in privileged access sections
|
||||
* (useful when using statically allocated objects). */
|
||||
#define PRIVILEGED_FUNCTION
|
||||
#define PRIVILEGED_DATA __attribute__((section("privileged_data")))
|
||||
#define FREERTOS_SYSTEM_CALL
|
||||
|
||||
#if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) )
|
||||
|
||||
#define vGrantAccessToTask( xTask, xTaskToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xTaskToGrantAccess ) )
|
||||
#define vRevokeAccessToTask( xTask, xTaskToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xTaskToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToSemaphore( xTask, xSemaphoreToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xSemaphoreToGrantAccess ) )
|
||||
#define vRevokeAccessToSemaphore( xTask, xSemaphoreToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xSemaphoreToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToQueue( xTask, xQueueToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueToGrantAccess ) )
|
||||
#define vRevokeAccessToQueue( xTask, xQueueToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToQueueSet( xTask, xQueueSetToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueSetToGrantAccess ) )
|
||||
#define vRevokeAccessToQueueSet( xTask, xQueueSetToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xQueueSetToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToEventGroup( xTask, xEventGroupToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xEventGroupToGrantAccess ) )
|
||||
#define vRevokeAccessToEventGroup( xTask, xEventGroupToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xEventGroupToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToStreamBuffer( xTask, xStreamBufferToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xStreamBufferToGrantAccess ) )
|
||||
#define vRevokeAccessToStreamBuffer( xTask, xStreamBufferToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xStreamBufferToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToMessageBuffer( xTask, xMessageBufferToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xMessageBufferToGrantAccess ) )
|
||||
#define vRevokeAccessToMessageBuffer( xTask, xMessageBufferToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xMessageBufferToRevokeAccess ) )
|
||||
|
||||
#define vGrantAccessToTimer( xTask, xTimerToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xTimerToGrantAccess ) )
|
||||
#define vRevokeAccessToTimer( xTask, xTimerToRevokeAccess ) vRevokeAccessToKernelObject( ( xTask ), ( int32_t ) ( xTimerToRevokeAccess ) )
|
||||
|
||||
#endif /* #if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) ) */
|
||||
|
||||
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
||||
#else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
||||
|
||||
/* Ensure API functions go in the privileged execution section. */
|
||||
#define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions")))
|
||||
#define PRIVILEGED_DATA __attribute__((section("privileged_data")))
|
||||
#define FREERTOS_SYSTEM_CALL __attribute__((section("freertos_system_calls")))
|
||||
|
||||
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
|
||||
|
||||
#else /* portUSING_MPU_WRAPPERS */
|
||||
|
||||
#define PRIVILEGED_FUNCTION
|
||||
#define PRIVILEGED_DATA
|
||||
#define FREERTOS_SYSTEM_CALL
|
||||
#define portUSING_MPU_WRAPPERS 0
|
||||
|
||||
#endif /* portUSING_MPU_WRAPPERS */
|
||||
|
||||
|
||||
#endif /* MPU_WRAPPERS_H */
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INC_NEWLIB_FREERTOS_H
|
||||
#define INC_NEWLIB_FREERTOS_H
|
||||
|
||||
/* Note Newlib support has been included by popular demand, but is not
|
||||
* used by the FreeRTOS maintainers themselves. FreeRTOS is not
|
||||
* responsible for resulting newlib operation. User must be familiar with
|
||||
* newlib and must provide system-wide implementations of the necessary
|
||||
* stubs. Be warned that (at the time of writing) the current newlib design
|
||||
* implements a system-wide malloc() that must be provided with locks.
|
||||
*
|
||||
* See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html
|
||||
* for additional information. */
|
||||
|
||||
#include <reent.h>
|
||||
|
||||
#define configUSE_C_RUNTIME_TLS_SUPPORT 1
|
||||
|
||||
#ifndef configTLS_BLOCK_TYPE
|
||||
#define configTLS_BLOCK_TYPE struct _reent
|
||||
#endif
|
||||
|
||||
#ifndef configINIT_TLS_BLOCK
|
||||
#define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) _REENT_INIT_PTR( &( xTLSBlock ) )
|
||||
#endif
|
||||
|
||||
#ifndef configSET_TLS_BLOCK
|
||||
#define configSET_TLS_BLOCK( xTLSBlock ) ( _impure_ptr = &( xTLSBlock ) )
|
||||
#endif
|
||||
|
||||
#ifndef configDEINIT_TLS_BLOCK
|
||||
#define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) )
|
||||
#endif
|
||||
|
||||
#endif /* INC_NEWLIB_FREERTOS_H */
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* 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
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INC_PICOLIBC_FREERTOS_H
|
||||
#define INC_PICOLIBC_FREERTOS_H
|
||||
|
||||
/* Use picolibc TLS support to allocate space for __thread variables,
|
||||
* initialize them at thread creation and set the TLS context at
|
||||
* thread switch time.
|
||||
*
|
||||
* See the picolibc TLS docs:
|
||||
* https://github.com/picolibc/picolibc/blob/main/doc/tls.md
|
||||
* for additional information. */
|
||||
|
||||
#include <picotls.h>
|
||||
|
||||
#define configUSE_C_RUNTIME_TLS_SUPPORT 1
|
||||
|
||||
#define configTLS_BLOCK_TYPE void *
|
||||
|
||||
#define picolibcTLS_SIZE ( ( portPOINTER_SIZE_TYPE ) _tls_size() )
|
||||
#define picolibcSTACK_ALIGNMENT_MASK ( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK )
|
||||
|
||||
#if __PICOLIBC_MAJOR__ > 1 || __PICOLIBC_MINOR__ >= 8
|
||||
|
||||
/* Picolibc 1.8 and newer have explicit alignment values provided
|
||||
* by the _tls_align() inline */
|
||||
#define picolibcTLS_ALIGNMENT_MASK ( ( portPOINTER_SIZE_TYPE ) ( _tls_align() - 1 ) )
|
||||
#else
|
||||
|
||||
/* For older Picolibc versions, use the general port alignment value */
|
||||
#define picolibcTLS_ALIGNMENT_MASK ( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK )
|
||||
#endif
|
||||
|
||||
/* Allocate thread local storage block off the end of the
|
||||
* stack. The picolibcTLS_SIZE macro returns the size (in
|
||||
* bytes) of the total TLS area used by the application.
|
||||
* Calculate the top of stack address. */
|
||||
#if ( portSTACK_GROWTH < 0 )
|
||||
|
||||
#define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) \
|
||||
do { \
|
||||
xTLSBlock = ( void * ) ( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) - \
|
||||
picolibcTLS_SIZE ) & \
|
||||
~picolibcTLS_ALIGNMENT_MASK ); \
|
||||
pxTopOfStack = ( StackType_t * ) ( ( ( ( portPOINTER_SIZE_TYPE ) xTLSBlock ) - 1 ) & \
|
||||
~picolibcSTACK_ALIGNMENT_MASK ); \
|
||||
_init_tls( xTLSBlock ); \
|
||||
} while( 0 )
|
||||
#else /* portSTACK_GROWTH */
|
||||
#define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) \
|
||||
do { \
|
||||
xTLSBlock = ( void * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack + \
|
||||
picolibcTLS_ALIGNMENT_MASK ) & ~picolibcTLS_ALIGNMENT_MASK ); \
|
||||
pxTopOfStack = ( StackType_t * ) ( ( ( ( ( portPOINTER_SIZE_TYPE ) xTLSBlock ) + \
|
||||
picolibcTLS_SIZE ) + picolibcSTACK_ALIGNMENT_MASK ) & \
|
||||
~picolibcSTACK_ALIGNMENT_MASK ); \
|
||||
_init_tls( xTLSBlock ); \
|
||||
} while( 0 )
|
||||
#endif /* portSTACK_GROWTH */
|
||||
|
||||
#define configSET_TLS_BLOCK( xTLSBlock ) _set_tls( xTLSBlock )
|
||||
|
||||
#define configDEINIT_TLS_BLOCK( xTLSBlock )
|
||||
|
||||
#endif /* INC_PICOLIBC_FREERTOS_H */
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -43,6 +41,7 @@
|
||||
* to make it clear that new projects should not use it, support for the port
|
||||
* specific constants has been moved into the deprecated_definitions.h header
|
||||
* file. */
|
||||
#include "deprecated_definitions.h"
|
||||
|
||||
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
||||
* did not result in a portmacro.h header file being included - and it should be
|
||||
@@ -54,22 +53,30 @@
|
||||
|
||||
#if portBYTE_ALIGNMENT == 32
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x001f )
|
||||
#elif portBYTE_ALIGNMENT == 16
|
||||
#define portBYTE_ALIGNMENT_MASK (0x000f)
|
||||
#elif portBYTE_ALIGNMENT == 8
|
||||
#define portBYTE_ALIGNMENT_MASK (0x0007)
|
||||
#elif portBYTE_ALIGNMENT == 4
|
||||
#define portBYTE_ALIGNMENT_MASK (0x0003)
|
||||
#elif portBYTE_ALIGNMENT == 2
|
||||
#define portBYTE_ALIGNMENT_MASK (0x0001)
|
||||
#elif portBYTE_ALIGNMENT == 1
|
||||
#define portBYTE_ALIGNMENT_MASK (0x0000)
|
||||
#else /* if portBYTE_ALIGNMENT == 32 */
|
||||
#error "Invalid portBYTE_ALIGNMENT definition"
|
||||
#endif /* if portBYTE_ALIGNMENT == 32 */
|
||||
#endif
|
||||
|
||||
#ifndef portUSING_MPU_WRAPPERS
|
||||
#define portUSING_MPU_WRAPPERS 0
|
||||
#if portBYTE_ALIGNMENT == 16
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x000f )
|
||||
#endif
|
||||
|
||||
#if portBYTE_ALIGNMENT == 8
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
|
||||
#endif
|
||||
|
||||
#if portBYTE_ALIGNMENT == 4
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x0003 )
|
||||
#endif
|
||||
|
||||
#if portBYTE_ALIGNMENT == 2
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x0001 )
|
||||
#endif
|
||||
|
||||
#if portBYTE_ALIGNMENT == 1
|
||||
#define portBYTE_ALIGNMENT_MASK ( 0x0000 )
|
||||
#endif
|
||||
|
||||
#ifndef portBYTE_ALIGNMENT_MASK
|
||||
#error "Invalid portBYTE_ALIGNMENT definition"
|
||||
#endif
|
||||
|
||||
#ifndef portNUM_CONFIGURABLE_REGIONS
|
||||
@@ -84,15 +91,6 @@
|
||||
#define portARCH_NAME NULL
|
||||
#endif
|
||||
|
||||
#ifndef configSTACK_DEPTH_TYPE
|
||||
#define configSTACK_DEPTH_TYPE StackType_t
|
||||
#endif
|
||||
|
||||
#ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP
|
||||
/* Defaults to 0 for backward compatibility. */
|
||||
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
|
||||
#endif
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -109,28 +107,41 @@ extern "C" {
|
||||
*/
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged,
|
||||
xMPU_SETTINGS *xMPUSettings) PRIVILEGED_FUNCTION;
|
||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||
StackType_t * pxEndOfStack,
|
||||
TaskFunction_t pxCode,
|
||||
void * pvParameters,
|
||||
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged, xMPU_SETTINGS *xMPUSettings) PRIVILEGED_FUNCTION;
|
||||
#endif /* if ( portHAS_STACK_OVERFLOW_CHECKING == 1 ) */
|
||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||
TaskFunction_t pxCode,
|
||||
void * pvParameters,
|
||||
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION;
|
||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||
StackType_t * pxEndOfStack,
|
||||
TaskFunction_t pxCode,
|
||||
void * pvParameters ) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION;
|
||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||
TaskFunction_t pxCode,
|
||||
void * pvParameters ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
||||
|
||||
/* Used by heap_5.c to define the start address and size of each memory region
|
||||
* that together comprise the total FreeRTOS heap space. */
|
||||
typedef struct HeapRegion {
|
||||
typedef struct HeapRegion
|
||||
{
|
||||
uint8_t * pucStartAddress;
|
||||
size_t xSizeInBytes;
|
||||
} HeapRegion_t;
|
||||
|
||||
/* Used to pass information about the heap out of vPortGetHeapStats(). */
|
||||
typedef struct xHeapStats {
|
||||
typedef struct xHeapStats
|
||||
{
|
||||
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
||||
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||
@@ -162,40 +173,12 @@ void vPortGetHeapStats(HeapStats_t *pxHeapStats);
|
||||
/*
|
||||
* Map to the memory management routines required for the port.
|
||||
*/
|
||||
void *pvPortMalloc(size_t xWantedSize) PRIVILEGED_FUNCTION;
|
||||
void *pvPortCalloc(size_t xNum, size_t xSize) PRIVILEGED_FUNCTION;
|
||||
void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
||||
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
|
||||
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
|
||||
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if (configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1)
|
||||
void *pvPortMallocStack(size_t xSize) PRIVILEGED_FUNCTION;
|
||||
void vPortFreeStack(void *pv) PRIVILEGED_FUNCTION;
|
||||
#else
|
||||
#define pvPortMallocStack pvPortMalloc
|
||||
#define vPortFreeStack vPortFree
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This function resets the internal state of the heap module. It must be called
|
||||
* by the application before restarting the scheduler.
|
||||
*/
|
||||
void vPortHeapResetState(void) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if (configUSE_MALLOC_FAILED_HOOK == 1)
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* @code{c}
|
||||
* void vApplicationMallocFailedHook( void )
|
||||
* @endcode
|
||||
*
|
||||
* This hook function is called when allocation failed.
|
||||
*/
|
||||
void vApplicationMallocFailedHook(void);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Setup the hardware ready for the scheduler to take control. This generally
|
||||
* sets up a tick interrupt and sets timers for the correct tick frequency.
|
||||
@@ -218,36 +201,10 @@ void vPortEndScheduler(void) PRIVILEGED_FUNCTION;
|
||||
*/
|
||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||
struct xMEMORY_REGION;
|
||||
void vPortStoreTaskMPUSettings(xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION *const xRegions, StackType_t *pxBottomOfStack, configSTACK_DEPTH_TYPE uxStackDepth) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Checks if the calling task is authorized to access the given buffer.
|
||||
*
|
||||
* @param pvBuffer The buffer which the calling task wants to access.
|
||||
* @param ulBufferLength The length of the pvBuffer.
|
||||
* @param ulAccessRequested The permissions that the calling task wants.
|
||||
*
|
||||
* @return pdTRUE if the calling task is authorized to access the buffer,
|
||||
* pdFALSE otherwise.
|
||||
*/
|
||||
#if (portUSING_MPU_WRAPPERS == 1)
|
||||
BaseType_t xPortIsAuthorizedToAccessBuffer(const void *pvBuffer, uint32_t ulBufferLength, uint32_t ulAccessRequested) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Checks if the calling task is authorized to access the given kernel object.
|
||||
*
|
||||
* @param lInternalIndexOfKernelObject The index of the kernel object in the kernel
|
||||
* object handle pool.
|
||||
*
|
||||
* @return pdTRUE if the calling task is authorized to access the kernel object,
|
||||
* pdFALSE otherwise.
|
||||
*/
|
||||
#if ((portUSING_MPU_WRAPPERS == 1) && (configUSE_MPU_WRAPPERS_V1 == 0))
|
||||
|
||||
BaseType_t xPortIsAuthorizedToAccessKernelObject(int32_t lInternalIndexOfKernelObject) PRIVILEGED_FUNCTION;
|
||||
|
||||
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
||||
const struct xMEMORY_REGION * const xRegions,
|
||||
StackType_t * pxBottomOfStack,
|
||||
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -33,28 +31,17 @@
|
||||
* Defines the prototype to which task functions must conform. Defined in this
|
||||
* file to ensure the type is known before portable.h is included.
|
||||
*/
|
||||
typedef void (* TaskFunction_t)( void * arg );
|
||||
typedef void (* TaskFunction_t)( void * );
|
||||
|
||||
/* Converts a time in milliseconds to a time in ticks. This macro can be
|
||||
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
|
||||
* definition here is not suitable for your application. */
|
||||
#ifndef pdMS_TO_TICKS
|
||||
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInMs ) * ( uint64_t ) configTICK_RATE_HZ ) / ( uint64_t ) 1000U ) )
|
||||
#endif
|
||||
|
||||
/* Converts a time in ticks to a time in milliseconds. This macro can be
|
||||
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
|
||||
* definition here is not suitable for your application. */
|
||||
#ifndef pdTICKS_TO_MS
|
||||
#define pdTICKS_TO_MS( xTimeInTicks ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInTicks ) * ( uint64_t ) 1000U ) / ( uint64_t ) configTICK_RATE_HZ ) )
|
||||
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
|
||||
#endif
|
||||
|
||||
#define pdFALSE ( ( BaseType_t ) 0 )
|
||||
#define pdTRUE ( ( BaseType_t ) 1 )
|
||||
#define pdFALSE_SIGNED ( ( BaseType_t ) 0 )
|
||||
#define pdTRUE_SIGNED ( ( BaseType_t ) 1 )
|
||||
#define pdFALSE_UNSIGNED ( ( UBaseType_t ) 0 )
|
||||
#define pdTRUE_UNSIGNED ( ( UBaseType_t ) 1 )
|
||||
|
||||
#define pdPASS ( pdTRUE )
|
||||
#define pdFAIL ( pdFALSE )
|
||||
@@ -71,14 +58,10 @@ typedef void (* TaskFunction_t)( void * arg );
|
||||
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
|
||||
#endif
|
||||
|
||||
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
|
||||
#if ( configUSE_16_BIT_TICKS == 1 )
|
||||
#define pdINTEGRITY_CHECK_VALUE 0x5a5a
|
||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
|
||||
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
|
||||
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS )
|
||||
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5a5a5a5a5aULL
|
||||
#else
|
||||
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
|
||||
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
|
||||
#endif
|
||||
|
||||
/* The following errno values are used by FreeRTOS+ components, not FreeRTOS
|
||||
@@ -111,7 +94,6 @@ typedef void (* TaskFunction_t)( void * arg );
|
||||
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
|
||||
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
|
||||
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||
#define pdFREERTOS_ERRNO_EAFNOSUPPORT 97 /* Address family not supported by protocol */
|
||||
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
|
||||
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
|
||||
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -79,12 +77,12 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* QueueHandle_t xQueueCreate(
|
||||
* UBaseType_t uxQueueLength,
|
||||
* UBaseType_t uxItemSize
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new queue instance, and returns a handle by which the new queue
|
||||
* can be referenced.
|
||||
@@ -113,7 +111,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -141,7 +139,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueCreate xQueueCreate
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -151,14 +149,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* QueueHandle_t xQueueCreateStatic(
|
||||
* UBaseType_t uxQueueLength,
|
||||
* UBaseType_t uxItemSize,
|
||||
* uint8_t *pucQueueStorage,
|
||||
* uint8_t *pucQueueStorageBuffer,
|
||||
* StaticQueue_t *pxQueueBuffer
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new queue instance, and returns a handle by which the new queue
|
||||
* can be referenced.
|
||||
@@ -182,11 +180,11 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* that will be copied for each posted item. Each item on the queue must be
|
||||
* the same size.
|
||||
*
|
||||
* @param pucQueueStorage If uxItemSize is not zero then
|
||||
* pucQueueStorage must point to a uint8_t array that is at least large
|
||||
* @param pucQueueStorageBuffer If uxItemSize is not zero then
|
||||
* pucQueueStorageBuffer must point to a uint8_t array that is at least large
|
||||
* enough to hold the maximum number of items that can be in the queue at any
|
||||
* one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is
|
||||
* zero then pucQueueStorage can be NULL.
|
||||
* zero then pucQueueStorageBuffer can be NULL.
|
||||
*
|
||||
* @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which
|
||||
* will be used to hold the queue's data structure.
|
||||
@@ -195,7 +193,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* returned. If pxQueueBuffer is NULL then NULL is returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -227,7 +225,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueCreateStatic xQueueCreateStatic
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -237,42 +235,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* BaseType_t xQueueGetStaticBuffers( QueueHandle_t xQueue,
|
||||
* uint8_t ** ppucQueueStorage,
|
||||
* StaticQueue_t ** ppxStaticQueue );
|
||||
* @endcode
|
||||
*
|
||||
* Retrieve pointers to a statically created queue's data structure buffer
|
||||
* and storage area buffer. These are the same buffers that are supplied
|
||||
* at the time of creation.
|
||||
*
|
||||
* @param xQueue The queue for which to retrieve the buffers.
|
||||
*
|
||||
* @param ppucQueueStorage Used to return a pointer to the queue's storage
|
||||
* area buffer.
|
||||
*
|
||||
* @param ppxStaticQueue Used to return a pointer to the queue's data
|
||||
* structure buffer.
|
||||
*
|
||||
* @return pdTRUE if buffers were retrieved, pdFALSE otherwise.
|
||||
*
|
||||
* \defgroup xQueueGetStaticBuffers xQueueGetStaticBuffers
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
#define xQueueGetStaticBuffers( xQueue, ppucQueueStorage, ppxStaticQueue ) xQueueGenericGetStaticBuffers( ( xQueue ), ( ppucQueueStorage ), ( ppxStaticQueue ) )
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* BaseType_t xQueueSendToFront(
|
||||
* <pre>
|
||||
* BaseType_t xQueueSendToToFront(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void *pvItemToQueue,
|
||||
* TickType_t xTicksToWait
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Post an item to the front of a queue. The item is queued by copy, not by
|
||||
* reference. This function must not be called from an interrupt service
|
||||
@@ -295,14 +264,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
* char ucData[ 20 ];
|
||||
* } xMessage;
|
||||
*
|
||||
* uint32_t ulVar = 10U;
|
||||
* uint32_t ulVar = 10UL;
|
||||
*
|
||||
* void vATask( void *pvParameters )
|
||||
* {
|
||||
@@ -338,7 +307,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -347,13 +316,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueSendToBack(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void *pvItemToQueue,
|
||||
* TickType_t xTicksToWait
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This is a macro that calls xQueueGenericSend().
|
||||
*
|
||||
@@ -378,14 +347,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
* char ucData[ 20 ];
|
||||
* } xMessage;
|
||||
*
|
||||
* uint32_t ulVar = 10U;
|
||||
* uint32_t ulVar = 10UL;
|
||||
*
|
||||
* void vATask( void *pvParameters )
|
||||
* {
|
||||
@@ -421,7 +390,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -430,13 +399,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueSend(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void * pvItemToQueue,
|
||||
* TickType_t xTicksToWait
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This is a macro that calls xQueueGenericSend(). It is included for
|
||||
* backward compatibility with versions of FreeRTOS.org that did not
|
||||
@@ -463,14 +432,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
* char ucData[ 20 ];
|
||||
* } xMessage;
|
||||
*
|
||||
* uint32_t ulVar = 10U;
|
||||
* uint32_t ulVar = 10UL;
|
||||
*
|
||||
* void vATask( void *pvParameters )
|
||||
* {
|
||||
@@ -506,7 +475,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -515,12 +484,12 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueOverwrite(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void * pvItemToQueue
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Only for use with queues that have a length of one - so the queue is either
|
||||
* empty or full.
|
||||
@@ -544,7 +513,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* to the queue even when the queue is already full.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* void vFunction( void *pvParameters )
|
||||
* {
|
||||
@@ -590,7 +559,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ...
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueOverwrite xQueueOverwrite
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -600,14 +569,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueGenericSend(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void * pvItemToQueue,
|
||||
* TickType_t xTicksToWait
|
||||
* BaseType_t xCopyPosition
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* It is preferred that the macros xQueueSend(), xQueueSendToFront() and
|
||||
* xQueueSendToBack() are used in place of calling this function directly.
|
||||
@@ -636,14 +605,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
* char ucData[ 20 ];
|
||||
* } xMessage;
|
||||
*
|
||||
* uint32_t ulVar = 10U;
|
||||
* uint32_t ulVar = 10UL;
|
||||
*
|
||||
* void vATask( void *pvParameters )
|
||||
* {
|
||||
@@ -679,7 +648,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -690,13 +659,13 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueuePeek(
|
||||
* QueueHandle_t xQueue,
|
||||
* void * const pvBuffer,
|
||||
* TickType_t xTicksToWait
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Receive an item from a queue without removing the item from the queue.
|
||||
* The item is received by copy so a buffer of adequate size must be
|
||||
@@ -727,7 +696,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||
* otherwise pdFALSE.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -777,7 +746,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueuePeek xQueuePeek
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -787,12 +756,12 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueuePeekFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* void *pvBuffer,
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* A version of xQueuePeek() that can be called from an interrupt service
|
||||
* routine (ISR).
|
||||
@@ -822,13 +791,13 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueReceive(
|
||||
* QueueHandle_t xQueue,
|
||||
* void *pvBuffer,
|
||||
* TickType_t xTicksToWait
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Receive an item from a queue. The item is received by copy so a buffer of
|
||||
* adequate size must be provided. The number of bytes copied into the buffer
|
||||
@@ -856,7 +825,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||
* otherwise pdFALSE.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -906,7 +875,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueReceive xQueueReceive
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -916,9 +885,9 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Return the number of messages stored in a queue.
|
||||
*
|
||||
@@ -933,9 +902,9 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNC
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Return the number of free spaces available in a queue. This is equal to the
|
||||
* number of items that can be sent to the queue before the queue becomes full
|
||||
@@ -952,9 +921,9 @@ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNC
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vQueueDelete( QueueHandle_t xQueue );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Delete a queue - freeing all the memory allocated for storing of items
|
||||
* placed on the queue.
|
||||
@@ -968,13 +937,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueSendToFrontFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void *pvItemToQueue,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This is a macro that calls xQueueGenericSendFromISR().
|
||||
*
|
||||
@@ -995,7 +964,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
|
||||
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
|
||||
* to unblock, and the unblocked task has a priority higher than the currently
|
||||
* running task. If xQueueSendToFrontFromISR() sets this value to pdTRUE then
|
||||
* running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
|
||||
* a context switch should be requested before the interrupt is exited.
|
||||
*
|
||||
* @return pdTRUE if the data was successfully sent to the queue, otherwise
|
||||
@@ -1003,11 +972,11 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* Example usage for buffered IO (where the ISR can obtain more than one value
|
||||
* per call):
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vBufferISR( void )
|
||||
* {
|
||||
* char cIn;
|
||||
* BaseType_t xHigherPriorityTaskWoken;
|
||||
* BaseType_t xHigherPrioritTaskWoken;
|
||||
*
|
||||
* // We have not woken a task at the start of the ISR.
|
||||
* xHigherPriorityTaskWoken = pdFALSE;
|
||||
@@ -1029,7 +998,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* taskYIELD ();
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||
* \ingroup QueueManagement
|
||||
@@ -1040,13 +1009,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueSendToBackFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void *pvItemToQueue,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This is a macro that calls xQueueGenericSendFromISR().
|
||||
*
|
||||
@@ -1075,7 +1044,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* Example usage for buffered IO (where the ISR can obtain more than one value
|
||||
* per call):
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vBufferISR( void )
|
||||
* {
|
||||
* char cIn;
|
||||
@@ -1101,7 +1070,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* taskYIELD ();
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||
* \ingroup QueueManagement
|
||||
@@ -1111,13 +1080,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueOverwriteFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void * pvItemToQueue,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* A version of xQueueOverwrite() that can be used in an interrupt service
|
||||
* routine (ISR).
|
||||
@@ -1148,7 +1117,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* the queue is already full.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* QueueHandle_t xQueue;
|
||||
*
|
||||
@@ -1187,13 +1156,10 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* // has a priority higher than or equal to the priority of the currently
|
||||
* // executing task (the task this interrupt interrupted). Perform a context
|
||||
* // switch so this interrupt returns directly to the unblocked task.
|
||||
* // The macro used is port specific and will be either
|
||||
* // portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to the documentation
|
||||
* // page for the port being used.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -1202,13 +1168,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueSendFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void *pvItemToQueue,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* This is a macro that calls xQueueGenericSendFromISR(). It is included
|
||||
* for backward compatibility with versions of FreeRTOS.org that did not
|
||||
@@ -1240,7 +1206,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* Example usage for buffered IO (where the ISR can obtain more than one value
|
||||
* per call):
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vBufferISR( void )
|
||||
* {
|
||||
* char cIn;
|
||||
@@ -1263,14 +1229,11 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* // Now the buffer is empty we can switch context if necessary.
|
||||
* if( xHigherPriorityTaskWoken )
|
||||
* {
|
||||
* // As xHigherPriorityTaskWoken is now set to pdTRUE then a context
|
||||
* // switch should be requested. The macro used is port specific and
|
||||
* // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
|
||||
* // refer to the documentation page for the port being used.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* // Actual macro used here is port specific.
|
||||
* portYIELD_FROM_ISR ();
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||
* \ingroup QueueManagement
|
||||
@@ -1280,14 +1243,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueGenericSendFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* const void *pvItemToQueue,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken,
|
||||
* BaseType_t xCopyPosition
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* It is preferred that the macros xQueueSendFromISR(),
|
||||
* xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place
|
||||
@@ -1323,7 +1286,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* Example usage for buffered IO (where the ISR can obtain more than one value
|
||||
* per call):
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vBufferISR( void )
|
||||
* {
|
||||
* char cIn;
|
||||
@@ -1343,17 +1306,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
|
||||
*
|
||||
* // Now the buffer is empty we can switch context if necessary.
|
||||
* // Now the buffer is empty we can switch context if necessary. Note that the
|
||||
* // name of the yield function required is port specific.
|
||||
* if( xHigherPriorityTaskWokenByPost )
|
||||
* {
|
||||
* // As xHigherPriorityTaskWokenByPost is now set to pdTRUE then a context
|
||||
* // switch should be requested. The macro used is port specific and
|
||||
* // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
|
||||
* // refer to the documentation page for the port being used.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWokenByPost );
|
||||
* portYIELD_FROM_ISR();
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||
* \ingroup QueueManagement
|
||||
@@ -1367,13 +1327,13 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xQueueReceiveFromISR(
|
||||
* QueueHandle_t xQueue,
|
||||
* void *pvBuffer,
|
||||
* BaseType_t *pxTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Receive an item from a queue. It is safe to use this function from within an
|
||||
* interrupt service routine.
|
||||
@@ -1384,16 +1344,16 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||
* @param pvBuffer Pointer to the buffer into which the received item will
|
||||
* be copied.
|
||||
*
|
||||
* @param pxHigherPriorityTaskWoken A task may be blocked waiting for space to
|
||||
* become available on the queue. If xQueueReceiveFromISR causes such a task
|
||||
* to unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
|
||||
* @param pxTaskWoken A task may be blocked waiting for space to become
|
||||
* available on the queue. If xQueueReceiveFromISR causes such a task to
|
||||
* unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
|
||||
* remain unchanged.
|
||||
*
|
||||
* @return pdTRUE if an item was successfully received from the queue,
|
||||
* otherwise pdFALSE.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* QueueHandle_t xQueue;
|
||||
*
|
||||
@@ -1438,17 +1398,17 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||
* vOutputCharacter( cRxedChar );
|
||||
*
|
||||
* // If removing the character from the queue woke the task that was
|
||||
* // posting onto the queue xTaskWokenByReceive will have been set to
|
||||
* // posting onto the queue cTaskWokenByReceive will have been set to
|
||||
* // pdTRUE. No matter how many times this loop iterates only one
|
||||
* // task will be woken.
|
||||
* }
|
||||
*
|
||||
* if( xTaskWokenByReceive != ( char ) pdFALSE;
|
||||
* if( cTaskWokenByPost != ( char ) pdFALSE;
|
||||
* {
|
||||
* taskYIELD ();
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -1458,14 +1418,12 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
|
||||
|
||||
/*
|
||||
* Utilities to query queues that are safe to use from an ISR. These utilities
|
||||
* should be used only from within an ISR, or within a critical section.
|
||||
* should be used only from witin an ISR, or within a critical section.
|
||||
*/
|
||||
BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configUSE_CO_ROUTINES == 1 )
|
||||
|
||||
/*
|
||||
* The functions defined above are for passing data to and from tasks. The
|
||||
* functions below are the equivalents for passing data to and from
|
||||
@@ -1488,42 +1446,27 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEG
|
||||
void * pvBuffer,
|
||||
TickType_t xTicksToWait );
|
||||
|
||||
#endif /* if ( configUSE_CO_ROUTINES == 1 ) */
|
||||
|
||||
/*
|
||||
* For internal use only. Use xSemaphoreCreateMutex(),
|
||||
* xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
|
||||
* these functions directly.
|
||||
*/
|
||||
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
||||
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_COUNTING_SEMAPHORES == 1 )
|
||||
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
||||
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
#if ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
|
||||
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
||||
const UBaseType_t uxInitialCount,
|
||||
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For internal use only. Use xSemaphoreTakeRecursive() or
|
||||
* xSemaphoreGiveRecursive() instead of calling these functions directly.
|
||||
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
|
||||
* xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
|
||||
*/
|
||||
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
@@ -1533,7 +1476,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* Reset a queue back to its original empty state. The return value is now
|
||||
* obsolete and is always set to pdPASS.
|
||||
*/
|
||||
#define xQueueReset( xQueue ) xQueueGenericReset( ( xQueue ), pdFALSE )
|
||||
#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
|
||||
|
||||
/*
|
||||
* The registry is provided as a means for kernel aware debuggers to
|
||||
@@ -1545,25 +1488,21 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
|
||||
* registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
|
||||
* within FreeRTOSConfig.h for the registry to be available. Its value
|
||||
* does not affect the number of queues, semaphores and mutexes that can be
|
||||
* does not effect the number of queues, semaphores and mutexes that can be
|
||||
* created - just the number that the registry can hold.
|
||||
*
|
||||
* If vQueueAddToRegistry is called more than once with the same xQueue
|
||||
* parameter, the registry will store the pcQueueName parameter from the
|
||||
* most recent call to vQueueAddToRegistry.
|
||||
*
|
||||
* @param xQueue The handle of the queue being added to the registry. This
|
||||
* is the handle returned by a call to xQueueCreate(). Semaphore and mutex
|
||||
* handles can also be passed in here.
|
||||
*
|
||||
* @param pcQueueName The name to be associated with the handle. This is the
|
||||
* @param pcName The name to be associated with the handle. This is the
|
||||
* name that the kernel aware debugger will display. The queue registry only
|
||||
* stores a pointer to the string - so the string must be persistent (global or
|
||||
* preferably in ROM/Flash), not on the stack.
|
||||
*/
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
void vQueueAddToRegistry( QueueHandle_t xQueue,
|
||||
const char * pcQueueName ) PRIVILEGED_FUNCTION;
|
||||
const char * pcQueueName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1592,7 +1531,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* returned.
|
||||
*/
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1619,18 +1558,6 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generic version of the function used to retrieve the buffers of statically
|
||||
* created queues. This is called by other functions and macros that retrieve
|
||||
* the buffers of other statically created RTOS objects that use the queue
|
||||
* structure as their base.
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xQueueGenericGetStaticBuffers( QueueHandle_t xQueue,
|
||||
uint8_t ** ppucQueueStorage,
|
||||
StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Queue sets provide a mechanism to allow a task to block (pend) on a read
|
||||
* operation from multiple queues or semaphores simultaneously.
|
||||
@@ -1645,7 +1572,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* or semaphores contained in the set is in a state where a queue read or
|
||||
* semaphore take operation would be successful.
|
||||
*
|
||||
* Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
|
||||
* Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
|
||||
* for reasons why queue sets are very rarely needed in practice as there are
|
||||
* simpler methods of blocking on multiple objects.
|
||||
*
|
||||
@@ -1679,9 +1606,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* @return If the queue set is created successfully then a handle to the created
|
||||
* queue set is returned. Otherwise NULL is returned.
|
||||
*/
|
||||
#if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Adds a queue or semaphore to a queue set that was previously created by a
|
||||
@@ -1705,10 +1630,8 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* queue set because it is already a member of a different queue set then pdFAIL
|
||||
* is returned.
|
||||
*/
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Removes a queue or semaphore from a queue set. A queue or semaphore can only
|
||||
@@ -1727,10 +1650,8 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* then pdPASS is returned. If the queue was not in the queue set, or the
|
||||
* queue (or semaphore) was not empty, then pdFAIL is returned.
|
||||
*/
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* xQueueSelectFromSet() selects from the members of a queue set a queue or
|
||||
@@ -1742,7 +1663,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
|
||||
* function.
|
||||
*
|
||||
* Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
|
||||
* Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
|
||||
* for reasons why queue sets are very rarely needed in practice as there are
|
||||
* simpler methods of blocking on multiple objects.
|
||||
*
|
||||
@@ -1766,17 +1687,13 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||
* in the queue set that is available, or NULL if no such queue or semaphore
|
||||
* exists before before the specified block time expires.
|
||||
*/
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
||||
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A version of xQueueSelectFromSet() that can be used from an ISR.
|
||||
*/
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/* Not public API functions. */
|
||||
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
|
||||
@@ -1784,22 +1701,11 @@ void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
|
||||
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
||||
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
void vQueueSetQueueNumber( QueueHandle_t xQueue,
|
||||
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
UBaseType_t uxQueueGetQueueItemSize( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
UBaseType_t uxQueueGetQueueLength( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -44,9 +42,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* vSemaphoreCreateBinary( SemaphoreHandle_t xSemaphore );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* In many usage scenarios it is faster and more memory efficient to use a
|
||||
* direct to task notification in place of a binary semaphore!
|
||||
@@ -74,7 +72,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* @param xSemaphore Handle to the created semaphore. Should be of type SemaphoreHandle_t.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore = NULL;
|
||||
*
|
||||
* void vATask( void * pvParameters )
|
||||
@@ -89,26 +87,26 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // The semaphore can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
#define vSemaphoreCreateBinary( xSemaphore ) \
|
||||
do { \
|
||||
{ \
|
||||
( xSemaphore ) = xQueueGenericCreate( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_BINARY_SEMAPHORE ); \
|
||||
if( ( xSemaphore ) != NULL ) \
|
||||
{ \
|
||||
( void ) xSemaphoreGive( ( xSemaphore ) ); \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateBinary( void );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new binary semaphore instance, and returns a handle by which the
|
||||
* new semaphore can be referenced.
|
||||
@@ -144,7 +142,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* hold the semaphore's data structures could not be allocated.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore = NULL;
|
||||
*
|
||||
* void vATask( void * pvParameters )
|
||||
@@ -159,7 +157,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // The semaphore can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateBinary xSemaphoreCreateBinary
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -169,9 +167,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateBinaryStatic( StaticSemaphore_t *pxSemaphoreBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new binary semaphore instance, and returns a handle by which the
|
||||
* new semaphore can be referenced.
|
||||
@@ -204,7 +202,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* returned. If pxSemaphoreBuffer is NULL then NULL is returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore = NULL;
|
||||
* StaticSemaphore_t xSemaphoreBuffer;
|
||||
*
|
||||
@@ -220,22 +218,22 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
*
|
||||
* // Rest of task code goes here.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateBinaryStatic xSemaphoreCreateBinaryStatic
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
#define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, ( pxStaticSemaphore ), queueQUEUE_TYPE_BINARY_SEMAPHORE )
|
||||
#define xSemaphoreCreateBinaryStatic( pxStaticSemaphore ) xQueueGenericCreateStatic( ( UBaseType_t ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticSemaphore, queueQUEUE_TYPE_BINARY_SEMAPHORE )
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* xSemaphoreTake(
|
||||
* SemaphoreHandle_t xSemaphore,
|
||||
* TickType_t xBlockTime
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* <i>Macro</i> to obtain a semaphore. The semaphore must have previously been
|
||||
* created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
|
||||
@@ -254,7 +252,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* if xBlockTime expired without the semaphore becoming available.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore = NULL;
|
||||
*
|
||||
* // A task that creates a semaphore.
|
||||
@@ -291,7 +289,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreTake xSemaphoreTake
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -299,12 +297,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* xSemaphoreTakeRecursive(
|
||||
* SemaphoreHandle_t xMutex,
|
||||
* TickType_t xBlockTime
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* <i>Macro</i> to recursively obtain, or 'take', a mutex type semaphore.
|
||||
* The mutex must have previously been created using a call to
|
||||
@@ -335,7 +333,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* expired without the semaphore becoming available.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xMutex = NULL;
|
||||
*
|
||||
* // A task that creates a mutex.
|
||||
@@ -386,7 +384,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreTakeRecursive xSemaphoreTakeRecursive
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -396,9 +394,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* xSemaphoreGive( SemaphoreHandle_t xSemaphore );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* <i>Macro</i> to release a semaphore. The semaphore must have previously been
|
||||
* created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
|
||||
@@ -419,7 +417,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* semaphore was not first obtained correctly.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore = NULL;
|
||||
*
|
||||
* void vATask( void * pvParameters )
|
||||
@@ -453,7 +451,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreGive xSemaphoreGive
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -461,9 +459,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* xSemaphoreGiveRecursive( SemaphoreHandle_t xMutex );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* <i>Macro</i> to recursively release, or 'give', a mutex type semaphore.
|
||||
* The mutex must have previously been created using a call to
|
||||
@@ -487,7 +485,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* @return pdTRUE if the semaphore was given.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xMutex = NULL;
|
||||
*
|
||||
* // A task that creates a mutex.
|
||||
@@ -539,7 +537,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreGiveRecursive xSemaphoreGiveRecursive
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -549,12 +547,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* xSemaphoreGiveFromISR(
|
||||
* SemaphoreHandle_t xSemaphore,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* <i>Macro</i> to release a semaphore. The semaphore must have previously been
|
||||
* created with a call to xSemaphoreCreateBinary() or xSemaphoreCreateCounting().
|
||||
@@ -576,7 +574,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* @return pdTRUE if the semaphore was successfully given, otherwise errQUEUE_FULL.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
\#define LONG_TIME 0xffff
|
||||
\#define TICKS_TO_WAIT 10
|
||||
* SemaphoreHandle_t xSemaphore = NULL;
|
||||
@@ -633,7 +631,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // to find the syntax required.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreGiveFromISR xSemaphoreGiveFromISR
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -641,12 +639,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* xSemaphoreTakeFromISR(
|
||||
* SemaphoreHandle_t xSemaphore,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken
|
||||
* );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* <i>Macro</i> to take a semaphore from an ISR. The semaphore must have
|
||||
* previously been created with a call to xSemaphoreCreateBinary() or
|
||||
@@ -676,9 +674,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateMutex( void );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new mutex type semaphore instance, and returns a handle by which
|
||||
* the new mutex can be referenced.
|
||||
@@ -712,7 +710,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* data structures then NULL is returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore;
|
||||
*
|
||||
* void vATask( void * pvParameters )
|
||||
@@ -727,19 +725,19 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // The semaphore can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateMutex xSemaphoreCreateMutex
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_MUTEXES == 1 ) )
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
#define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUE_TYPE_MUTEX )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateMutexStatic( StaticSemaphore_t *pxMutexBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new mutex type semaphore instance, and returns a handle by which
|
||||
* the new mutex can be referenced.
|
||||
@@ -776,7 +774,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* mutex is returned. If pxMutexBuffer was NULL then NULL is returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore;
|
||||
* StaticSemaphore_t xMutexBuffer;
|
||||
*
|
||||
@@ -790,25 +788,25 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // As no dynamic memory allocation was performed, xSemaphore cannot be NULL,
|
||||
* // so there is no need to check it.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateMutexStatic xSemaphoreCreateMutexStatic
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_MUTEXES == 1 ) )
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
#define xSemaphoreCreateMutexStatic( pxMutexBuffer ) xQueueCreateMutexStatic( queueQUEUE_TYPE_MUTEX, ( pxMutexBuffer ) )
|
||||
#endif
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateRecursiveMutex( void );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new recursive mutex type semaphore instance, and returns a handle
|
||||
* by which the new recursive mutex can be referenced.
|
||||
*
|
||||
* Internally, within the FreeRTOS implementation, recursive mutexes use a block
|
||||
* Internally, within the FreeRTOS implementation, recursive mutexs use a block
|
||||
* of memory, in which the mutex structure is stored. If a recursive mutex is
|
||||
* created using xSemaphoreCreateRecursiveMutex() then the required memory is
|
||||
* automatically dynamically allocated inside the
|
||||
@@ -845,7 +843,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* SemaphoreHandle_t.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore;
|
||||
*
|
||||
* void vATask( void * pvParameters )
|
||||
@@ -860,7 +858,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // The semaphore can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateRecursiveMutex xSemaphoreCreateRecursiveMutex
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -870,14 +868,14 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic( StaticSemaphore_t *pxMutexBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new recursive mutex type semaphore instance, and returns a handle
|
||||
* by which the new recursive mutex can be referenced.
|
||||
*
|
||||
* Internally, within the FreeRTOS implementation, recursive mutexes use a block
|
||||
* Internally, within the FreeRTOS implementation, recursive mutexs use a block
|
||||
* of memory, in which the mutex structure is stored. If a recursive mutex is
|
||||
* created using xSemaphoreCreateRecursiveMutex() then the required memory is
|
||||
* automatically dynamically allocated inside the
|
||||
@@ -919,7 +917,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore;
|
||||
* StaticSemaphore_t xMutexBuffer;
|
||||
*
|
||||
@@ -935,19 +933,19 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // As no dynamic memory allocation was performed, xSemaphore cannot be NULL,
|
||||
* // so there is no need to check it.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateRecursiveMutexStatic xSemaphoreCreateRecursiveMutexStatic
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_RECURSIVE_MUTEXES == 1 ) )
|
||||
#define xSemaphoreCreateRecursiveMutexStatic( pxStaticSemaphore ) xQueueCreateMutexStatic( queueQUEUE_TYPE_RECURSIVE_MUTEX, ( pxStaticSemaphore ) )
|
||||
#define xSemaphoreCreateRecursiveMutexStatic( pxStaticSemaphore ) xQueueCreateMutexStatic( queueQUEUE_TYPE_RECURSIVE_MUTEX, pxStaticSemaphore )
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateCounting( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new counting semaphore instance, and returns a handle by which the
|
||||
* new counting semaphore can be referenced.
|
||||
@@ -999,7 +997,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* created.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore;
|
||||
*
|
||||
* void vATask( void * pvParameters )
|
||||
@@ -1017,7 +1015,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // The semaphore can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateCounting xSemaphoreCreateCounting
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -1027,9 +1025,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new counting semaphore instance, and returns a handle by which the
|
||||
* new counting semaphore can be referenced.
|
||||
@@ -1085,7 +1083,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* then NULL is returned.
|
||||
*
|
||||
* Example usage:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* SemaphoreHandle_t xSemaphore;
|
||||
* StaticSemaphore_t xSemaphoreBuffer;
|
||||
*
|
||||
@@ -1104,7 +1102,7 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* // No memory allocation was attempted so xSemaphore cannot be NULL, so there
|
||||
* // is no need to check its value.
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xSemaphoreCreateCountingStatic xSemaphoreCreateCountingStatic
|
||||
* \ingroup Semaphores
|
||||
*/
|
||||
@@ -1114,9 +1112,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr. h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vSemaphoreDelete( SemaphoreHandle_t xSemaphore );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Delete a semaphore. This function must be used with care. For example,
|
||||
* do not delete a mutex type semaphore if the mutex is held by a task.
|
||||
@@ -1130,9 +1128,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* TaskHandle_t xSemaphoreGetMutexHolder( SemaphoreHandle_t xMutex );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
||||
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
||||
@@ -1143,30 +1141,26 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
* the holder may change between the function exiting and the returned value
|
||||
* being tested.
|
||||
*/
|
||||
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||
#define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
||||
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
||||
* by a task), return NULL.
|
||||
*
|
||||
*/
|
||||
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||
#define xSemaphoreGetMutexHolderFromISR( xSemaphore ) xQueueGetMutexHolderFromISR( ( xSemaphore ) )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns
|
||||
* its current count value. If the semaphore is a binary semaphore then
|
||||
@@ -1176,40 +1170,4 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
*/
|
||||
#define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* @code{c}
|
||||
* UBaseType_t uxSemaphoreGetCountFromISR( SemaphoreHandle_t xSemaphore );
|
||||
* @endcode
|
||||
*
|
||||
* If the semaphore is a counting semaphore then uxSemaphoreGetCountFromISR() returns
|
||||
* its current count value. If the semaphore is a binary semaphore then
|
||||
* uxSemaphoreGetCountFromISR() returns 1 if the semaphore is available, and 0 if the
|
||||
* semaphore is not available.
|
||||
*
|
||||
*/
|
||||
#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* @code{c}
|
||||
* BaseType_t xSemaphoreGetStaticBuffer( SemaphoreHandle_t xSemaphore,
|
||||
* StaticSemaphore_t ** ppxSemaphoreBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* Retrieve pointer to a statically created binary semaphore, counting semaphore,
|
||||
* or mutex semaphore's data structure buffer. This is the same buffer that is
|
||||
* supplied at the time of creation.
|
||||
*
|
||||
* @param xSemaphore The semaphore for which to retrieve the buffer.
|
||||
*
|
||||
* @param ppxSemaphoreBuffer Used to return a pointer to the semaphore's
|
||||
* data structure buffer.
|
||||
*
|
||||
* @return pdTRUE if buffer was retrieved, pdFALSE otherwise.
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
#define xSemaphoreGetStaticBuffer( xSemaphore, ppxSemaphoreBuffer ) xQueueGenericGetStaticBuffers( ( QueueHandle_t ) ( xSemaphore ), NULL, ( ppxSemaphoreBuffer ) )
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
#endif /* SEMAPHORE_H */
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -45,26 +43,17 @@
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* portSTACK_LIMIT_PADDING is a number of extra words to consider to be in
|
||||
* use on the stack.
|
||||
*/
|
||||
#ifndef portSTACK_LIMIT_PADDING
|
||||
#define portSTACK_LIMIT_PADDING 0
|
||||
#endif
|
||||
|
||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
|
||||
|
||||
/* Only the current stack state is to be checked. */
|
||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||
do { \
|
||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
|
||||
{ \
|
||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
|
||||
{ \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
|
||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -73,15 +62,14 @@
|
||||
|
||||
/* Only the current stack state is to be checked. */
|
||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||
do { \
|
||||
{ \
|
||||
\
|
||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \
|
||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
|
||||
{ \
|
||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
|
||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -89,19 +77,18 @@
|
||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
|
||||
|
||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||
do { \
|
||||
{ \
|
||||
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
|
||||
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \
|
||||
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
|
||||
\
|
||||
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
||||
( pulStack[ 1 ] != ulCheckValue ) || \
|
||||
( pulStack[ 2 ] != ulCheckValue ) || \
|
||||
( pulStack[ 3 ] != ulCheckValue ) ) \
|
||||
{ \
|
||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
|
||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -109,7 +96,7 @@
|
||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
|
||||
|
||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
||||
do { \
|
||||
{ \
|
||||
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
|
||||
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
||||
@@ -123,10 +110,9 @@
|
||||
/* Has the extremity of the task stack ever been written over? */ \
|
||||
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
||||
{ \
|
||||
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \
|
||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
||||
} \
|
||||
} while( 0 )
|
||||
}
|
||||
|
||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -62,13 +60,6 @@
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/**
|
||||
* Type of stream buffer. For internal use only.
|
||||
*/
|
||||
#define sbTYPE_STREAM_BUFFER ( ( BaseType_t ) 0 )
|
||||
#define sbTYPE_MESSAGE_BUFFER ( ( BaseType_t ) 1 )
|
||||
#define sbTYPE_STREAM_BATCHING_BUFFER ( ( BaseType_t ) 2 )
|
||||
|
||||
/**
|
||||
* Type by which stream buffers are referenced. For example, a call to
|
||||
* xStreamBufferCreate() returns an StreamBufferHandle_t variable that can
|
||||
@@ -78,19 +69,13 @@
|
||||
struct StreamBufferDef_t;
|
||||
typedef struct StreamBufferDef_t * StreamBufferHandle_t;
|
||||
|
||||
/**
|
||||
* Type used as a stream buffer's optional callback.
|
||||
*/
|
||||
typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuffer,
|
||||
BaseType_t xIsInsideISR,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken );
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
* message_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* StreamBufferHandle_t xStreamBufferCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Creates a new stream buffer using dynamically allocated memory. See
|
||||
* xStreamBufferCreateStatic() for a version that uses statically allocated
|
||||
@@ -98,8 +83,6 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
*
|
||||
* configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
|
||||
* FreeRTOSConfig.h for xStreamBufferCreate() to be available.
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferCreate() to be available.
|
||||
*
|
||||
* @param xBufferSizeBytes The total number of bytes the stream buffer will be
|
||||
* able to hold at any one time.
|
||||
@@ -118,16 +101,6 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* trigger level of 1 being used. It is not valid to specify a trigger level
|
||||
* that is greater than the buffer size.
|
||||
*
|
||||
* @param pxSendCompletedCallback Callback invoked when number of bytes at least equal to
|
||||
* trigger level is sent to the stream buffer. If the parameter is NULL, it will use the default
|
||||
* implementation provided by sbSEND_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @param pxReceiveCompletedCallback Callback invoked when more than zero bytes are read from a
|
||||
* stream buffer. If the parameter is NULL, it will use the default
|
||||
* implementation provided by sbRECEIVE_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @return If NULL is returned, then the stream buffer cannot be created
|
||||
* because there is insufficient heap memory available for FreeRTOS to allocate
|
||||
* the stream buffer data structures and storage area. A non-NULL value being
|
||||
@@ -136,7 +109,7 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* buffer.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* void vAFunction( void )
|
||||
* {
|
||||
@@ -158,35 +131,26 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* // The stream buffer was created successfully and can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xStreamBufferCreate xStreamBufferCreate
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
|
||||
#define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) \
|
||||
xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, NULL, NULL )
|
||||
|
||||
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
|
||||
#define xStreamBufferCreateWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
|
||||
xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
|
||||
#endif
|
||||
#define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE )
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* StreamBufferHandle_t xStreamBufferCreateStatic( size_t xBufferSizeBytes,
|
||||
* size_t xTriggerLevelBytes,
|
||||
* uint8_t *pucStreamBufferStorageArea,
|
||||
* StaticStreamBuffer_t *pxStaticStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
* Creates a new stream buffer using statically allocated memory. See
|
||||
* xStreamBufferCreate() for a version that uses dynamically allocated memory.
|
||||
*
|
||||
* configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h for
|
||||
* xStreamBufferCreateStatic() to be available. configUSE_STREAM_BUFFERS must be
|
||||
* set to 1 in for FreeRTOSConfig.h for xStreamBufferCreateStatic() to be
|
||||
* available.
|
||||
* xStreamBufferCreateStatic() to be available.
|
||||
*
|
||||
* @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
|
||||
* pucStreamBufferStorageArea parameter.
|
||||
@@ -206,29 +170,19 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* that is greater than the buffer size.
|
||||
*
|
||||
* @param pucStreamBufferStorageArea Must point to a uint8_t array that is at
|
||||
* least xBufferSizeBytes big. This is the array to which streams are
|
||||
* least xBufferSizeBytes + 1 big. This is the array to which streams are
|
||||
* copied when they are written to the stream buffer.
|
||||
*
|
||||
* @param pxStaticStreamBuffer Must point to a variable of type
|
||||
* StaticStreamBuffer_t, which will be used to hold the stream buffer's data
|
||||
* structure.
|
||||
*
|
||||
* @param pxSendCompletedCallback Callback invoked when number of bytes at least equal to
|
||||
* trigger level is sent to the stream buffer. If the parameter is NULL, it will use the default
|
||||
* implementation provided by sbSEND_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @param pxReceiveCompletedCallback Callback invoked when more than zero bytes are read from a
|
||||
* stream buffer. If the parameter is NULL, it will use the default
|
||||
* implementation provided by sbRECEIVE_COMPLETED macro. To enable the callback,
|
||||
* configUSE_SB_COMPLETED_CALLBACK must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @return If the stream buffer is created successfully then a handle to the
|
||||
* created stream buffer is returned. If either pucStreamBufferStorageArea or
|
||||
* pxStaticstreamBuffer are NULL then NULL is returned.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
*
|
||||
* // Used to dimension the array used to hold the streams. The available space
|
||||
* // will actually be one less than this, so 999.
|
||||
@@ -246,9 +200,9 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* StreamBufferHandle_t xStreamBuffer;
|
||||
* const size_t xTriggerLevel = 1;
|
||||
*
|
||||
* xStreamBuffer = xStreamBufferCreateStatic( sizeof( ucStorageBuffer ),
|
||||
* xStreamBuffer = xStreamBufferCreateStatic( sizeof( ucBufferStorage ),
|
||||
* xTriggerLevel,
|
||||
* ucStorageBuffer,
|
||||
* ucBufferStorage,
|
||||
* &xStreamBufferStruct );
|
||||
*
|
||||
* // As neither the pucStreamBufferStorageArea or pxStaticStreamBuffer
|
||||
@@ -258,251 +212,22 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* // Other code that uses the stream buffer can go here.
|
||||
* }
|
||||
*
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xStreamBufferCreateStatic xStreamBufferCreateStatic
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
|
||||
#define xStreamBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) \
|
||||
xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), NULL, NULL )
|
||||
|
||||
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
|
||||
#define xStreamBufferCreateStaticWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
|
||||
xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
|
||||
#endif
|
||||
xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE, pucStreamBufferStorageArea, pxStaticStreamBuffer )
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* StreamBufferHandle_t xStreamBatchingBufferCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes );
|
||||
* @endcode
|
||||
*
|
||||
* Creates a new stream batching buffer using dynamically allocated memory. See
|
||||
* xStreamBatchingBufferCreateStatic() for a version that uses statically
|
||||
* allocated memory (memory that is allocated at compile time).
|
||||
*
|
||||
* configSUPPORT_DYNAMIC_ALLOCATION must be set to 1 or left undefined in
|
||||
* FreeRTOSConfig.h for xStreamBatchingBufferCreate() to be available.
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBatchingBufferCreate() to be available.
|
||||
*
|
||||
* The difference between a stream buffer and a stream batching buffer is when
|
||||
* a task performs read on a non-empty buffer:
|
||||
* - The task reading from a non-empty stream buffer returns immediately
|
||||
* regardless of the amount of data in the buffer.
|
||||
* - The task reading from a non-empty steam batching buffer blocks until the
|
||||
* amount of data in the buffer exceeds the trigger level or the block time
|
||||
* expires.
|
||||
*
|
||||
* @param xBufferSizeBytes The total number of bytes the stream batching buffer
|
||||
* will be able to hold at any one time.
|
||||
*
|
||||
* @param xTriggerLevelBytes The number of bytes that must be in the stream
|
||||
* batching buffer to unblock a task calling xStreamBufferReceive before the
|
||||
* block time expires.
|
||||
*
|
||||
* @param pxSendCompletedCallback Callback invoked when number of bytes at least
|
||||
* equal to trigger level is sent to the stream batching buffer. If the
|
||||
* parameter is NULL, it will use the default implementation provided by
|
||||
* sbSEND_COMPLETED macro. To enable the callback, configUSE_SB_COMPLETED_CALLBACK
|
||||
* must be set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @param pxReceiveCompletedCallback Callback invoked when more than zero bytes
|
||||
* are read from a stream batching buffer. If the parameter is NULL, it will use
|
||||
* the default implementation provided by sbRECEIVE_COMPLETED macro. To enable
|
||||
* the callback, configUSE_SB_COMPLETED_CALLBACK must be set to 1 in
|
||||
* FreeRTOSConfig.h.
|
||||
*
|
||||
* @return If NULL is returned, then the stream batching buffer cannot be created
|
||||
* because there is insufficient heap memory available for FreeRTOS to allocate
|
||||
* the stream batching buffer data structures and storage area. A non-NULL value
|
||||
* being returned indicates that the stream batching buffer has been created
|
||||
* successfully - the returned value should be stored as the handle to the
|
||||
* created stream batching buffer.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
*
|
||||
* void vAFunction( void )
|
||||
* {
|
||||
* StreamBufferHandle_t xStreamBatchingBuffer;
|
||||
* const size_t xStreamBufferSizeBytes = 100, xTriggerLevel = 10;
|
||||
*
|
||||
* // Create a stream batching buffer that can hold 100 bytes. The memory used
|
||||
* // to hold both the stream batching buffer structure and the data in the stream
|
||||
* // batching buffer is allocated dynamically.
|
||||
* xStreamBatchingBuffer = xStreamBatchingBufferCreate( xStreamBufferSizeBytes, xTriggerLevel );
|
||||
*
|
||||
* if( xStreamBatchingBuffer == NULL )
|
||||
* {
|
||||
* // There was not enough heap memory space available to create the
|
||||
* // stream batching buffer.
|
||||
* }
|
||||
* else
|
||||
* {
|
||||
* // The stream batching buffer was created successfully and can now be used.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* \defgroup xStreamBatchingBufferCreate xStreamBatchingBufferCreate
|
||||
* \ingroup StreamBatchingBufferManagement
|
||||
*/
|
||||
|
||||
#define xStreamBatchingBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) \
|
||||
xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, NULL, NULL )
|
||||
|
||||
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
|
||||
#define xStreamBatchingBufferCreateWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
|
||||
xStreamBufferGenericCreate( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* StreamBufferHandle_t xStreamBatchingBufferCreateStatic( size_t xBufferSizeBytes,
|
||||
* size_t xTriggerLevelBytes,
|
||||
* uint8_t *pucStreamBufferStorageArea,
|
||||
* StaticStreamBuffer_t *pxStaticStreamBuffer );
|
||||
* @endcode
|
||||
* Creates a new stream batching buffer using statically allocated memory. See
|
||||
* xStreamBatchingBufferCreate() for a version that uses dynamically allocated
|
||||
* memory.
|
||||
*
|
||||
* configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h for
|
||||
* xStreamBatchingBufferCreateStatic() to be available. configUSE_STREAM_BUFFERS
|
||||
* must be set to 1 in for FreeRTOSConfig.h for xStreamBatchingBufferCreateStatic()
|
||||
* to be available.
|
||||
*
|
||||
* The difference between a stream buffer and a stream batching buffer is when
|
||||
* a task performs read on a non-empty buffer:
|
||||
* - The task reading from a non-empty stream buffer returns immediately
|
||||
* regardless of the amount of data in the buffer.
|
||||
* - The task reading from a non-empty steam batching buffer blocks until the
|
||||
* amount of data in the buffer exceeds the trigger level or the block time
|
||||
* expires.
|
||||
*
|
||||
* @param xBufferSizeBytes The size, in bytes, of the buffer pointed to by the
|
||||
* pucStreamBufferStorageArea parameter.
|
||||
*
|
||||
* @param xTriggerLevelBytes The number of bytes that must be in the stream
|
||||
* batching buffer to unblock a task calling xStreamBufferReceive before the
|
||||
* block time expires.
|
||||
*
|
||||
* @param pucStreamBufferStorageArea Must point to a uint8_t array that is at
|
||||
* least xBufferSizeBytes big. This is the array to which streams are
|
||||
* copied when they are written to the stream batching buffer.
|
||||
*
|
||||
* @param pxStaticStreamBuffer Must point to a variable of type
|
||||
* StaticStreamBuffer_t, which will be used to hold the stream batching buffer's
|
||||
* data structure.
|
||||
*
|
||||
* @param pxSendCompletedCallback Callback invoked when number of bytes at least
|
||||
* equal to trigger level is sent to the stream batching buffer. If the parameter
|
||||
* is NULL, it will use the default implementation provided by sbSEND_COMPLETED
|
||||
* macro. To enable the callback, configUSE_SB_COMPLETED_CALLBACK must be set to
|
||||
* 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* @param pxReceiveCompletedCallback Callback invoked when more than zero bytes
|
||||
* are read from a stream batching buffer. If the parameter is NULL, it will use
|
||||
* the default implementation provided by sbRECEIVE_COMPLETED macro. To enable
|
||||
* the callback, configUSE_SB_COMPLETED_CALLBACK must be set to 1 in
|
||||
* FreeRTOSConfig.h.
|
||||
*
|
||||
* @return If the stream batching buffer is created successfully then a handle
|
||||
* to the created stream batching buffer is returned. If either pucStreamBufferStorageArea
|
||||
* or pxStaticstreamBuffer are NULL then NULL is returned.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
*
|
||||
* // Used to dimension the array used to hold the streams. The available space
|
||||
* // will actually be one less than this, so 999.
|
||||
* #define STORAGE_SIZE_BYTES 1000
|
||||
*
|
||||
* // Defines the memory that will actually hold the streams within the stream
|
||||
* // batching buffer.
|
||||
* static uint8_t ucStorageBuffer[ STORAGE_SIZE_BYTES ];
|
||||
*
|
||||
* // The variable used to hold the stream batching buffer structure.
|
||||
* StaticStreamBuffer_t xStreamBufferStruct;
|
||||
*
|
||||
* void MyFunction( void )
|
||||
* {
|
||||
* StreamBufferHandle_t xStreamBatchingBuffer;
|
||||
* const size_t xTriggerLevel = 1;
|
||||
*
|
||||
* xStreamBatchingBuffer = xStreamBatchingBufferCreateStatic( sizeof( ucStorageBuffer ),
|
||||
* xTriggerLevel,
|
||||
* ucStorageBuffer,
|
||||
* &xStreamBufferStruct );
|
||||
*
|
||||
* // As neither the pucStreamBufferStorageArea or pxStaticStreamBuffer
|
||||
* // parameters were NULL, xStreamBatchingBuffer will not be NULL, and can be
|
||||
* // used to reference the created stream batching buffer in other stream
|
||||
* // buffer API calls.
|
||||
*
|
||||
* // Other code that uses the stream batching buffer can go here.
|
||||
* }
|
||||
*
|
||||
* @endcode
|
||||
* \defgroup xStreamBatchingBufferCreateStatic xStreamBatchingBufferCreateStatic
|
||||
* \ingroup StreamBatchingBufferManagement
|
||||
*/
|
||||
|
||||
#define xStreamBatchingBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) \
|
||||
xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), NULL, NULL )
|
||||
|
||||
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
|
||||
#define xStreamBatchingBufferCreateStaticWithCallback( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer, pxSendCompletedCallback, pxReceiveCompletedCallback ) \
|
||||
xStreamBufferGenericCreateStatic( ( xBufferSizeBytes ), ( xTriggerLevelBytes ), sbTYPE_STREAM_BATCHING_BUFFER, ( pucStreamBufferStorageArea ), ( pxStaticStreamBuffer ), ( pxSendCompletedCallback ), ( pxReceiveCompletedCallback ) )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* BaseType_t xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffer,
|
||||
* uint8_t ** ppucStreamBufferStorageArea,
|
||||
* StaticStreamBuffer_t ** ppxStaticStreamBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* Retrieve pointers to a statically created stream buffer's data structure
|
||||
* buffer and storage area buffer. These are the same buffers that are supplied
|
||||
* at the time of creation.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferGetStaticBuffers() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The stream buffer for which to retrieve the buffers.
|
||||
*
|
||||
* @param ppucStreamBufferStorageArea Used to return a pointer to the stream
|
||||
* buffer's storage area buffer.
|
||||
*
|
||||
* @param ppxStaticStreamBuffer Used to return a pointer to the stream
|
||||
* buffer's data structure buffer.
|
||||
*
|
||||
* @return pdTRUE if buffers were retrieved, pdFALSE otherwise.
|
||||
*
|
||||
* \defgroup xStreamBufferGetStaticBuffers xStreamBufferGetStaticBuffers
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffer,
|
||||
uint8_t ** ppucStreamBufferStorageArea,
|
||||
StaticStreamBuffer_t ** ppxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
* const void *pvTxData,
|
||||
* size_t xDataLengthBytes,
|
||||
* TickType_t xTicksToWait );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Sends bytes to a stream buffer. The bytes are copied into the stream buffer.
|
||||
*
|
||||
@@ -525,9 +250,6 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
|
||||
* service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferSend() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer to which a stream is
|
||||
* being sent.
|
||||
*
|
||||
@@ -555,7 +277,7 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* write as many bytes as possible.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vAFunction( StreamBufferHandle_t xStreamBuffer )
|
||||
* {
|
||||
* size_t xBytesSent;
|
||||
@@ -585,7 +307,7 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
|
||||
* // were sent. Could try again to send the remaining bytes.
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xStreamBufferSend xStreamBufferSend
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
@@ -597,12 +319,12 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
* const void *pvTxData,
|
||||
* size_t xDataLengthBytes,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Interrupt safe version of the API function that sends a stream of bytes to
|
||||
* the stream buffer.
|
||||
@@ -626,9 +348,6 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
* xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
|
||||
* service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferSendFromISR() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer to which a stream is
|
||||
* being sent.
|
||||
*
|
||||
@@ -657,7 +376,7 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
* space for all the bytes to be written.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A stream buffer that has already been created.
|
||||
* StreamBufferHandle_t xStreamBuffer;
|
||||
*
|
||||
@@ -684,12 +403,12 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
* // priority of the currently executing task was unblocked and a context
|
||||
* // switch should be performed to ensure the ISR returns to the unblocked
|
||||
* // task. In most FreeRTOS ports this is done by simply passing
|
||||
* // xHigherPriorityTaskWoken into portYIELD_FROM_ISR(), which will test the
|
||||
* // xHigherPriorityTaskWoken into taskYIELD_FROM_ISR(), which will test the
|
||||
* // variables value, and perform the context switch if necessary. Check the
|
||||
* // documentation for the port in use for port specific instructions.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* taskYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xStreamBufferSendFromISR xStreamBufferSendFromISR
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
@@ -701,12 +420,12 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
* void *pvRxData,
|
||||
* size_t xBufferLengthBytes,
|
||||
* TickType_t xTicksToWait );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Receives bytes from a stream buffer.
|
||||
*
|
||||
@@ -729,9 +448,6 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
* xStreamBufferReceiveFromISR() to read from a stream buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferReceive() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer from which bytes are to
|
||||
* be received.
|
||||
*
|
||||
@@ -759,7 +475,7 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
* out before xBufferLengthBytes were available.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vAFunction( StreamBuffer_t xStreamBuffer )
|
||||
* {
|
||||
* uint8_t ucRxData[ 20 ];
|
||||
@@ -777,11 +493,11 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
*
|
||||
* if( xReceivedBytes > 0 )
|
||||
* {
|
||||
* // A ucRxData contains another xReceivedBytes bytes of data, which can
|
||||
* // A ucRxData contains another xRecievedBytes bytes of data, which can
|
||||
* // be processed here....
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xStreamBufferReceive xStreamBufferReceive
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
@@ -793,12 +509,12 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
* void *pvRxData,
|
||||
* size_t xBufferLengthBytes,
|
||||
* BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* An interrupt safe version of the API function that receives bytes from a
|
||||
* stream buffer.
|
||||
@@ -807,9 +523,6 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
* Use xStreamBufferReceiveFromISR() to read bytes from a stream buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferReceiveFromISR() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer from which a stream
|
||||
* is being received.
|
||||
*
|
||||
@@ -838,7 +551,7 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
* @return The number of bytes read from the stream buffer, if any.
|
||||
*
|
||||
* Example use:
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* // A stream buffer that has already been created.
|
||||
* StreamBuffer_t xStreamBuffer;
|
||||
*
|
||||
@@ -865,12 +578,12 @@ size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
* // priority of the currently executing task was unblocked and a context
|
||||
* // switch should be performed to ensure the ISR returns to the unblocked
|
||||
* // task. In most FreeRTOS ports this is done by simply passing
|
||||
* // xHigherPriorityTaskWoken into portYIELD_FROM_ISR(), which will test the
|
||||
* // xHigherPriorityTaskWoken into taskYIELD_FROM_ISR(), which will test the
|
||||
* // variables value, and perform the context switch if necessary. Check the
|
||||
* // documentation for the port in use for port specific instructions.
|
||||
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* taskYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
* }
|
||||
* @endcode
|
||||
* </pre>
|
||||
* \defgroup xStreamBufferReceiveFromISR xStreamBufferReceiveFromISR
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
@@ -882,9 +595,9 @@ size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Deletes a stream buffer that was previously created using a call to
|
||||
* xStreamBufferCreate() or xStreamBufferCreateStatic(). If the stream
|
||||
@@ -894,9 +607,6 @@ size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
* A stream buffer handle must not be used after the stream buffer has been
|
||||
* deleted.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* vStreamBufferDelete() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer to be deleted.
|
||||
*
|
||||
* \defgroup vStreamBufferDelete vStreamBufferDelete
|
||||
@@ -907,16 +617,13 @@ void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTI
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Queries a stream buffer to see if it is full. A stream buffer is full if it
|
||||
* does not have any free space, and therefore cannot accept any more data.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferIsFull() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being queried.
|
||||
*
|
||||
* @return If the stream buffer is full then pdTRUE is returned. Otherwise
|
||||
@@ -930,16 +637,13 @@ BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Queries a stream buffer to see if it is empty. A stream buffer is empty if
|
||||
* it does not contain any data.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferIsEmpty() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being queried.
|
||||
*
|
||||
* @return If the stream buffer is empty then pdTRUE is returned. Otherwise
|
||||
@@ -953,22 +657,15 @@ BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Resets a stream buffer to its initial, empty, state. Any data that was in
|
||||
* the stream buffer is discarded. A stream buffer can only be reset if there
|
||||
* are no tasks blocked waiting to either send to or receive from the stream
|
||||
* buffer.
|
||||
*
|
||||
* Use xStreamBufferReset() to reset a stream buffer from a task.
|
||||
* Use xStreamBufferResetFromISR() to reset a stream buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferReset() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being reset.
|
||||
*
|
||||
* @return If the stream buffer is reset then pdPASS is returned. If there was
|
||||
@@ -983,49 +680,14 @@ BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_F
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* BaseType_t xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* An interrupt safe version of the API function that resets the stream buffer.
|
||||
*
|
||||
* Resets a stream buffer to its initial, empty, state. Any data that was in
|
||||
* the stream buffer is discarded. A stream buffer can only be reset if there
|
||||
* are no tasks blocked waiting to either send to or receive from the stream
|
||||
* buffer.
|
||||
*
|
||||
* Use xStreamBufferReset() to reset a stream buffer from a task.
|
||||
* Use xStreamBufferResetFromISR() to reset a stream buffer from an
|
||||
* interrupt service routine (ISR).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferResetFromISR() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being reset.
|
||||
*
|
||||
* @return If the stream buffer is reset then pdPASS is returned. If there was
|
||||
* a task blocked waiting to send to or read from the stream buffer then the
|
||||
* stream buffer is not reset and pdFAIL is returned.
|
||||
*
|
||||
* \defgroup xStreamBufferResetFromISR xStreamBufferResetFromISR
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
BaseType_t xStreamBufferResetFromISR( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Queries a stream buffer to see how much free space it contains, which is
|
||||
* equal to the amount of data that can be sent to the stream buffer before it
|
||||
* is full.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferSpacesAvailable() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being queried.
|
||||
*
|
||||
* @return The number of bytes that can be written to the stream buffer before
|
||||
@@ -1039,17 +701,14 @@ size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVIL
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* Queries a stream buffer to see how much data it contains, which is equal to
|
||||
* the number of bytes that can be read from the stream buffer before the stream
|
||||
* buffer would be empty.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferBytesAvailable() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being queried.
|
||||
*
|
||||
* @return The number of bytes that can be read from the stream buffer before
|
||||
@@ -1063,9 +722,9 @@ size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILE
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* A stream buffer's trigger level is the number of bytes that must be in the
|
||||
* stream buffer before a task that is blocked on the stream buffer to
|
||||
@@ -1084,9 +743,6 @@ size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILE
|
||||
* A trigger level is set when the stream buffer is created, and can be modified
|
||||
* using xStreamBufferSetTriggerLevel().
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferSetTriggerLevel() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer being updated.
|
||||
*
|
||||
* @param xTriggerLevel The new trigger level for the stream buffer.
|
||||
@@ -1104,9 +760,9 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* For advanced users only.
|
||||
*
|
||||
@@ -1121,9 +777,6 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
|
||||
* additional information.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferSendCompletedFromISR() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer to which data was
|
||||
* written.
|
||||
*
|
||||
@@ -1147,9 +800,9 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* <pre>
|
||||
* BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken );
|
||||
* @endcode
|
||||
* </pre>
|
||||
*
|
||||
* For advanced users only.
|
||||
*
|
||||
@@ -1165,9 +818,6 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
|
||||
* See the example implemented in FreeRTOS/Demo/Minimal/MessageBufferAMP.c for
|
||||
* additional information.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* xStreamBufferReceiveCompletedFromISR() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer from which data was
|
||||
* read.
|
||||
*
|
||||
@@ -1188,79 +838,16 @@ BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer
|
||||
BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* UBaseType_t uxStreamBufferGetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer );
|
||||
* @endcode
|
||||
*
|
||||
* Get the task notification index used for the supplied stream buffer which can
|
||||
* be set using vStreamBufferSetStreamBufferNotificationIndex. If the task
|
||||
* notification index for the stream buffer is not changed using
|
||||
* vStreamBufferSetStreamBufferNotificationIndex, this function returns the
|
||||
* default value (tskDEFAULT_INDEX_TO_NOTIFY).
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* uxStreamBufferGetStreamBufferNotificationIndex() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer for which the task
|
||||
* notification index is retrieved.
|
||||
*
|
||||
* @return The task notification index for the stream buffer.
|
||||
*
|
||||
* \defgroup uxStreamBufferGetStreamBufferNotificationIndex uxStreamBufferGetStreamBufferNotificationIndex
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
UBaseType_t uxStreamBufferGetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* stream_buffer.h
|
||||
*
|
||||
* @code{c}
|
||||
* void vStreamBufferSetStreamBufferNotificationIndex ( StreamBuffer_t xStreamBuffer, UBaseType_t uxNotificationIndex );
|
||||
* @endcode
|
||||
*
|
||||
* Set the task notification index used for the supplied stream buffer.
|
||||
* Successive calls to stream buffer APIs (like xStreamBufferSend or
|
||||
* xStreamBufferReceive) for this stream buffer will use this new index for
|
||||
* their task notifications.
|
||||
*
|
||||
* If this function is not called, the default index (tskDEFAULT_INDEX_TO_NOTIFY)
|
||||
* is used for task notifications. It is recommended to call this function
|
||||
* before attempting to send or receive data from the stream buffer to avoid
|
||||
* inconsistencies.
|
||||
*
|
||||
* configUSE_STREAM_BUFFERS must be set to 1 in for FreeRTOSConfig.h for
|
||||
* vStreamBufferSetStreamBufferNotificationIndex() to be available.
|
||||
*
|
||||
* @param xStreamBuffer The handle of the stream buffer for which the task
|
||||
* notification index is set.
|
||||
*
|
||||
* @param uxNotificationIndex The task notification index to set.
|
||||
*
|
||||
* \defgroup vStreamBufferSetStreamBufferNotificationIndex vStreamBufferSetStreamBufferNotificationIndex
|
||||
* \ingroup StreamBufferManagement
|
||||
*/
|
||||
void vStreamBufferSetStreamBufferNotificationIndex( StreamBufferHandle_t xStreamBuffer,
|
||||
UBaseType_t uxNotificationIndex ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/* Functions below here are not part of the public API. */
|
||||
StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
|
||||
size_t xTriggerLevelBytes,
|
||||
BaseType_t xStreamBufferType,
|
||||
StreamBufferCallbackFunction_t pxSendCompletedCallback,
|
||||
StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
|
||||
BaseType_t xIsMessageBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
|
||||
size_t xTriggerLevelBytes,
|
||||
BaseType_t xStreamBufferType,
|
||||
BaseType_t xIsMessageBuffer,
|
||||
uint8_t * const pucStreamBufferStorageArea,
|
||||
StaticStreamBuffer_t * const pxStaticStreamBuffer,
|
||||
StreamBufferCallbackFunction_t pxSendCompletedCallback,
|
||||
StreamBufferCallbackFunction_t pxReceiveCompletedCallback ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
StaticStreamBuffer_t * const pxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -34,8 +32,10 @@
|
||||
#error "include FreeRTOS.h must appear in source files before include timers.h"
|
||||
#endif
|
||||
|
||||
/*lint -save -e537 This headers are only multiply included if the application code
|
||||
* happens to also be including task.h. */
|
||||
#include "task.h"
|
||||
|
||||
/*lint -restore */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
@@ -86,13 +86,13 @@ typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
|
||||
* Defines the prototype to which functions used with the
|
||||
* xTimerPendFunctionCallFromISR() function must conform.
|
||||
*/
|
||||
typedef void (* PendedFunction_t)( void * arg1,
|
||||
uint32_t arg2 );
|
||||
typedef void (* PendedFunction_t)( void *,
|
||||
uint32_t );
|
||||
|
||||
/**
|
||||
* TimerHandle_t xTimerCreate( const char * const pcTimerName,
|
||||
* TickType_t xTimerPeriodInTicks,
|
||||
* BaseType_t xAutoReload,
|
||||
* UBaseType_t uxAutoReload,
|
||||
* void * pvTimerID,
|
||||
* TimerCallbackFunction_t pxCallbackFunction );
|
||||
*
|
||||
@@ -125,9 +125,9 @@ typedef void (* PendedFunction_t)( void * arg1,
|
||||
* to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or
|
||||
* equal to 1000. Time timer period must be greater than 0.
|
||||
*
|
||||
* @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
|
||||
* @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will
|
||||
* expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.
|
||||
* If xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||
* If uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||
* enter the dormant state after it expires.
|
||||
*
|
||||
* @param pvTimerID An identifier that is assigned to the timer being created.
|
||||
@@ -191,7 +191,7 @@ typedef void (* PendedFunction_t)( void * arg1,
|
||||
* for( x = 0; x < NUM_TIMERS; x++ )
|
||||
* {
|
||||
* xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel.
|
||||
* ( 100 * ( x + 1 ) ), // The timer period in ticks.
|
||||
* ( 100 * x ), // The timer period in ticks.
|
||||
* pdTRUE, // The timers will auto-reload themselves when they expire.
|
||||
* ( void * ) x, // Assign each timer a unique id equal to its array index.
|
||||
* vTimerCallback // Each timer calls the same callback when it expires.
|
||||
@@ -227,9 +227,9 @@ typedef void (* PendedFunction_t)( void * arg1,
|
||||
* @endverbatim
|
||||
*/
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
TimerHandle_t xTimerCreate( const char * const pcTimerName,
|
||||
TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const BaseType_t xAutoReload,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
@@ -237,7 +237,7 @@ typedef void (* PendedFunction_t)( void * arg1,
|
||||
/**
|
||||
* TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,
|
||||
* TickType_t xTimerPeriodInTicks,
|
||||
* BaseType_t xAutoReload,
|
||||
* UBaseType_t uxAutoReload,
|
||||
* void * pvTimerID,
|
||||
* TimerCallbackFunction_t pxCallbackFunction,
|
||||
* StaticTimer_t *pxTimerBuffer );
|
||||
@@ -271,9 +271,9 @@ typedef void (* PendedFunction_t)( void * arg1,
|
||||
* to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or
|
||||
* equal to 1000. The timer period must be greater than 0.
|
||||
*
|
||||
* @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
|
||||
* @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will
|
||||
* expire repeatedly with a frequency set by the xTimerPeriodInTicks parameter.
|
||||
* If xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||
* If uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||
* enter the dormant state after it expires.
|
||||
*
|
||||
* @param pvTimerID An identifier that is assigned to the timer being created.
|
||||
@@ -357,9 +357,9 @@ typedef void (* PendedFunction_t)( void * arg1,
|
||||
* @endverbatim
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
TimerHandle_t xTimerCreateStatic( const char * const pcTimerName,
|
||||
TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const BaseType_t xAutoReload,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction,
|
||||
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
|
||||
@@ -1196,12 +1196,10 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
|
||||
* }
|
||||
* @endverbatim
|
||||
*/
|
||||
#if ( INCLUDE_xTimerPendFunctionCall == 1 )
|
||||
BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
|
||||
void * pvParameter1,
|
||||
uint32_t ulParameter2,
|
||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
||||
@@ -1235,12 +1233,10 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
|
||||
* timer daemon task, otherwise pdFALSE is returned.
|
||||
*
|
||||
*/
|
||||
#if ( INCLUDE_xTimerPendFunctionCall == 1 )
|
||||
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
||||
void * pvParameter1,
|
||||
uint32_t ulParameter2,
|
||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* const char * const pcTimerGetName( TimerHandle_t xTimer );
|
||||
@@ -1251,10 +1247,10 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* @return The name assigned to the timer specified by the xTimer parameter.
|
||||
*/
|
||||
const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||
const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
|
||||
/**
|
||||
* void vTimerSetReloadMode( TimerHandle_t xTimer, const BaseType_t xAutoReload );
|
||||
* void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload );
|
||||
*
|
||||
* Updates a timer to be either an auto-reload timer, in which case the timer
|
||||
* automatically resets itself each time it expires, or a one-shot timer, in
|
||||
@@ -1262,28 +1258,14 @@ const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||
*
|
||||
* @param xTimer The handle of the timer being updated.
|
||||
*
|
||||
* @param xAutoReload If xAutoReload is set to pdTRUE then the timer will
|
||||
* @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will
|
||||
* expire repeatedly with a frequency set by the timer's period (see the
|
||||
* xTimerPeriodInTicks parameter of the xTimerCreate() API function). If
|
||||
* xAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||
* uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||
* enter the dormant state after it expires.
|
||||
*/
|
||||
void vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||
const BaseType_t xAutoReload ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* BaseType_t xTimerGetReloadMode( TimerHandle_t xTimer );
|
||||
*
|
||||
* Queries a timer to determine if it is an auto-reload timer, in which case the timer
|
||||
* automatically resets itself each time it expires, or a one-shot timer, in
|
||||
* which case the timer will only expire once unless it is manually restarted.
|
||||
*
|
||||
* @param xTimer The handle of the timer being queried.
|
||||
*
|
||||
* @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
|
||||
* pdFALSE is returned.
|
||||
*/
|
||||
BaseType_t xTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||
const UBaseType_t uxAutoReload ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer );
|
||||
@@ -1325,54 +1307,17 @@ TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||
*/
|
||||
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
|
||||
* StaticTimer_t ** ppxTimerBuffer );
|
||||
*
|
||||
* Retrieve pointer to a statically created timer's data structure
|
||||
* buffer. This is the same buffer that is supplied at the time of
|
||||
* creation.
|
||||
*
|
||||
* @param xTimer The timer for which to retrieve the buffer.
|
||||
*
|
||||
* @param ppxTaskBuffer Used to return a pointer to the timers's data
|
||||
* structure buffer.
|
||||
*
|
||||
* @return pdTRUE if the buffer was retrieved, pdFALSE otherwise.
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
|
||||
StaticTimer_t ** ppxTimerBuffer ) PRIVILEGED_FUNCTION;
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
/*
|
||||
* Functions beyond this part are not part of the public API and are intended
|
||||
* for use by the kernel only.
|
||||
*/
|
||||
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Splitting the xTimerGenericCommand into two sub functions and making it a macro
|
||||
* removes a recursion path when called from ISRs. This is primarily for the XCore
|
||||
* XCC port which detects the recursion path and throws an error during compilation
|
||||
* when this is not split.
|
||||
*/
|
||||
BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
|
||||
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
|
||||
BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#define xTimerGenericCommand( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) \
|
||||
( ( xCommandID ) < tmrFIRST_FROM_ISR_COMMAND ? \
|
||||
xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) : \
|
||||
xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait ) )
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
void vTimerSetTimerNumber( TimerHandle_t xTimer,
|
||||
UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;
|
||||
@@ -1383,46 +1328,21 @@ BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
|
||||
|
||||
/**
|
||||
* task.h
|
||||
* @code{c}
|
||||
* void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, configSTACK_DEPTH_TYPE * puxTimerTaskStackSize )
|
||||
* @endcode
|
||||
* <pre>void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize ) </pre>
|
||||
*
|
||||
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Timer Task TCB. This function is required when
|
||||
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.FreeRTOS.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||
*
|
||||
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for the idle task
|
||||
* @param puxTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task
|
||||
* @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||
*/
|
||||
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
||||
StackType_t ** ppxTimerTaskStackBuffer,
|
||||
configSTACK_DEPTH_TYPE * puxTimerTaskStackSize );
|
||||
uint32_t * pulTimerTaskStackSize );
|
||||
|
||||
#endif
|
||||
|
||||
#if ( configUSE_DAEMON_TASK_STARTUP_HOOK != 0 )
|
||||
|
||||
/**
|
||||
* timers.h
|
||||
* @code{c}
|
||||
* void vApplicationDaemonTaskStartupHook( void );
|
||||
* @endcode
|
||||
*
|
||||
* This hook function is called form the timer task once when the task starts running.
|
||||
*/
|
||||
/* MISRA Ref 8.6.1 [External linkage] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-86 */
|
||||
/* coverity[misra_c_2012_rule_8_6_violation] */
|
||||
void vApplicationDaemonTaskStartupHook( void );
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This function resets the internal state of the timer module. It must be called
|
||||
* by the application before restarting the scheduler.
|
||||
*/
|
||||
void vTimerResetState( void ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -37,10 +35,11 @@
|
||||
#include "FreeRTOS.h"
|
||||
#include "list.h"
|
||||
|
||||
/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
|
||||
/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
|
||||
* because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
|
||||
* defined for the header files above, but not in this file, in order to
|
||||
* generate the correct privileged Vs unprivileged linkage and placement. */
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* PUBLIC LIST API documented in list.h
|
||||
@@ -48,14 +47,10 @@
|
||||
|
||||
void vListInitialise( List_t * const pxList )
|
||||
{
|
||||
traceENTER_vListInitialise( pxList );
|
||||
|
||||
/* The list structure contains a list item which is used to mark the
|
||||
* end of the list. To initialise the list the list end is inserted
|
||||
* as the only list entry. */
|
||||
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd );
|
||||
|
||||
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
|
||||
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||
|
||||
/* The list end value is the highest possible value in the list to
|
||||
* ensure it remains at the end of the list. */
|
||||
@@ -63,17 +58,8 @@ void vListInitialise( List_t * const pxList )
|
||||
|
||||
/* The list end next and previous pointers point to itself so we know
|
||||
* when the list is empty. */
|
||||
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd );
|
||||
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );
|
||||
|
||||
/* Initialize the remaining fields of xListEnd when it is a proper ListItem_t */
|
||||
#if ( configUSE_MINI_LIST_ITEM == 0 )
|
||||
{
|
||||
pxList->xListEnd.pvOwner = NULL;
|
||||
pxList->xListEnd.pxContainer = NULL;
|
||||
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
|
||||
}
|
||||
#endif
|
||||
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. */
|
||||
|
||||
pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
|
||||
|
||||
@@ -81,15 +67,11 @@ void vListInitialise( List_t * const pxList )
|
||||
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
|
||||
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
|
||||
|
||||
traceRETURN_vListInitialise();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vListInitialiseItem( ListItem_t * const pxItem )
|
||||
{
|
||||
traceENTER_vListInitialiseItem( pxItem );
|
||||
|
||||
/* Make sure the list item is not recorded as being on a list. */
|
||||
pxItem->pxContainer = NULL;
|
||||
|
||||
@@ -97,8 +79,6 @@ void vListInitialiseItem( ListItem_t * const pxItem )
|
||||
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
|
||||
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
|
||||
|
||||
traceRETURN_vListInitialiseItem();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -107,8 +87,6 @@ void vListInsertEnd( List_t * const pxList,
|
||||
{
|
||||
ListItem_t * const pxIndex = pxList->pxIndex;
|
||||
|
||||
traceENTER_vListInsertEnd( pxList, pxNewListItem );
|
||||
|
||||
/* Only effective when configASSERT() is also defined, these tests may catch
|
||||
* the list data structures being overwritten in memory. They will not catch
|
||||
* data errors caused by incorrect configuration or use of FreeRTOS. */
|
||||
@@ -130,9 +108,7 @@ void vListInsertEnd( List_t * const pxList,
|
||||
/* Remember which list the item is in. */
|
||||
pxNewListItem->pxContainer = pxList;
|
||||
|
||||
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U );
|
||||
|
||||
traceRETURN_vListInsertEnd();
|
||||
( pxList->uxNumberOfItems )++;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -142,8 +118,6 @@ void vListInsert( List_t * const pxList,
|
||||
ListItem_t * pxIterator;
|
||||
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
|
||||
|
||||
traceENTER_vListInsert( pxList, pxNewListItem );
|
||||
|
||||
/* Only effective when configASSERT() is also defined, these tests may catch
|
||||
* the list data structures being overwritten in memory. They will not catch
|
||||
* data errors caused by incorrect configuration or use of FreeRTOS. */
|
||||
@@ -184,12 +158,9 @@ void vListInsert( List_t * const pxList,
|
||||
* 4) Using a queue or semaphore before it has been initialised or
|
||||
* before the scheduler has been started (are interrupts firing
|
||||
* before vTaskStartScheduler() has been called?).
|
||||
* 5) If the FreeRTOS port supports interrupt nesting then ensure that
|
||||
* the priority of the tick interrupt is at or below
|
||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
||||
**********************************************************************/
|
||||
|
||||
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
|
||||
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 !e9087 The mini list structure is used as the list end to save RAM. This is checked and valid. *//*lint !e440 The iterator moves to a different value, not xValueOfInsertion. */
|
||||
{
|
||||
/* There is nothing to do here, just iterating to the wanted
|
||||
* insertion position. */
|
||||
@@ -205,21 +176,16 @@ void vListInsert( List_t * const pxList,
|
||||
* item later. */
|
||||
pxNewListItem->pxContainer = pxList;
|
||||
|
||||
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U );
|
||||
|
||||
traceRETURN_vListInsert();
|
||||
( pxList->uxNumberOfItems )++;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
||||
{
|
||||
/* The list item knows which list it is in. Obtain the list from the list
|
||||
* item. */
|
||||
List_t * const pxList = pxItemToRemove->pxContainer;
|
||||
|
||||
traceENTER_uxListRemove( pxItemToRemove );
|
||||
|
||||
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
|
||||
pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
|
||||
|
||||
@@ -237,9 +203,7 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
|
||||
}
|
||||
|
||||
pxItemToRemove->pxContainer = NULL;
|
||||
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems - 1U );
|
||||
|
||||
traceRETURN_uxListRemove( pxList->uxNumberOfItems );
|
||||
( pxList->uxNumberOfItems )--;
|
||||
|
||||
return pxList->uxNumberOfItems;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4427
source/Middlewares/Third_Party/FreeRTOS/Source/tasks.c
vendored
4427
source/Middlewares/Third_Party/FreeRTOS/Source/tasks.c
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS Kernel V11.1.0
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* FreeRTOS Kernel V10.4.1
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. 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
|
||||
@@ -43,10 +41,11 @@
|
||||
#error configUSE_TIMERS must be set to 1 to make the xTimerPendFunctionCall() function available.
|
||||
#endif
|
||||
|
||||
/* The MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
|
||||
/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
|
||||
* because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined
|
||||
* for the header files above, but not in this file, in order to generate the
|
||||
* correct privileged Vs unprivileged linkage and placement. */
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e9021 !e961 !e750. */
|
||||
|
||||
|
||||
/* This entire source file will be skipped if the application is not configured
|
||||
@@ -56,41 +55,31 @@
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
/* Misc definitions. */
|
||||
#define tmrNO_DELAY ( ( TickType_t ) 0U )
|
||||
#define tmrMAX_TIME_BEFORE_OVERFLOW ( ( TickType_t ) -1 )
|
||||
#define tmrNO_DELAY ( TickType_t ) 0U
|
||||
|
||||
/* The name assigned to the timer service task. This can be overridden by
|
||||
* defining configTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
|
||||
* defining trmTIMER_SERVICE_TASK_NAME in FreeRTOSConfig.h. */
|
||||
#ifndef configTIMER_SERVICE_TASK_NAME
|
||||
#define configTIMER_SERVICE_TASK_NAME "Tmr Svc"
|
||||
#endif
|
||||
|
||||
#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
|
||||
|
||||
/* The core affinity assigned to the timer service task on SMP systems.
|
||||
* This can be overridden by defining configTIMER_SERVICE_TASK_CORE_AFFINITY in FreeRTOSConfig.h. */
|
||||
#ifndef configTIMER_SERVICE_TASK_CORE_AFFINITY
|
||||
#define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY
|
||||
#endif
|
||||
#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
|
||||
|
||||
/* Bit definitions used in the ucStatus member of a timer structure. */
|
||||
#define tmrSTATUS_IS_ACTIVE ( 0x01U )
|
||||
#define tmrSTATUS_IS_STATICALLY_ALLOCATED ( 0x02U )
|
||||
#define tmrSTATUS_IS_AUTORELOAD ( 0x04U )
|
||||
#define tmrSTATUS_IS_ACTIVE ( ( uint8_t ) 0x01 )
|
||||
#define tmrSTATUS_IS_STATICALLY_ALLOCATED ( ( uint8_t ) 0x02 )
|
||||
#define tmrSTATUS_IS_AUTORELOAD ( ( uint8_t ) 0x04 )
|
||||
|
||||
/* The definition of the timers themselves. */
|
||||
typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||
{
|
||||
const char * pcTimerName; /**< Text name. This is not used by the kernel, it is included simply to make debugging easier. */
|
||||
ListItem_t xTimerListItem; /**< Standard linked list item as used by all kernel features for event management. */
|
||||
TickType_t xTimerPeriodInTicks; /**< How quickly and often the timer expires. */
|
||||
void * pvTimerID; /**< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
|
||||
portTIMER_CALLBACK_ATTRIBUTE TimerCallbackFunction_t pxCallbackFunction; /**< The function that will be called when the timer expires. */
|
||||
const char * pcTimerName; /*<< Text name. This is not used by the kernel, it is included simply to make debugging easier. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
ListItem_t xTimerListItem; /*<< Standard linked list item as used by all kernel features for event management. */
|
||||
TickType_t xTimerPeriodInTicks; /*<< How quickly and often the timer expires. */
|
||||
void * pvTimerID; /*<< An ID to identify the timer. This allows the timer to be identified when the same callback is used for multiple timers. */
|
||||
TimerCallbackFunction_t pxCallbackFunction; /*<< The function that will be called when the timer expires. */
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
UBaseType_t uxTimerNumber; /**< An ID assigned by trace tools such as FreeRTOS+Trace */
|
||||
UBaseType_t uxTimerNumber; /*<< An ID assigned by trace tools such as FreeRTOS+Trace */
|
||||
#endif
|
||||
uint8_t ucStatus; /**< Holds bits to say if the timer was statically allocated or not, and if it is active or not. */
|
||||
uint8_t ucStatus; /*<< Holds bits to say if the timer was statically allocated or not, and if it is active or not. */
|
||||
} xTIMER;
|
||||
|
||||
/* The old xTIMER name is maintained above then typedefed to the new Timer_t
|
||||
@@ -104,14 +93,13 @@
|
||||
* and xCallbackParametersType respectively. */
|
||||
typedef struct tmrTimerParameters
|
||||
{
|
||||
TickType_t xMessageValue; /**< An optional value used by a subset of commands, for example, when changing the period of a timer. */
|
||||
Timer_t * pxTimer; /**< The timer to which the command will be applied. */
|
||||
TickType_t xMessageValue; /*<< An optional value used by a subset of commands, for example, when changing the period of a timer. */
|
||||
Timer_t * pxTimer; /*<< The timer to which the command will be applied. */
|
||||
} TimerParameter_t;
|
||||
|
||||
|
||||
typedef struct tmrCallbackParameters
|
||||
{
|
||||
portTIMER_CALLBACK_ATTRIBUTE
|
||||
PendedFunction_t pxCallbackFunction; /* << The callback function to execute. */
|
||||
void * pvParameter1; /* << The value that will be used as the callback functions first parameter. */
|
||||
uint32_t ulParameter2; /* << The value that will be used as the callback functions second parameter. */
|
||||
@@ -121,7 +109,7 @@
|
||||
* that is used to determine which message type is valid. */
|
||||
typedef struct tmrTimerQueueMessage
|
||||
{
|
||||
BaseType_t xMessageID; /**< The command being sent to the timer service task. */
|
||||
BaseType_t xMessageID; /*<< The command being sent to the timer service task. */
|
||||
union
|
||||
{
|
||||
TimerParameter_t xTimerParameters;
|
||||
@@ -134,6 +122,9 @@
|
||||
} u;
|
||||
} DaemonTaskMessage_t;
|
||||
|
||||
/*lint -save -e956 A manual analysis and inspection has been used to determine
|
||||
* which static variables must be declared volatile. */
|
||||
|
||||
/* The list in which active timers are stored. Timers are referenced in expire
|
||||
* time order, with the nearest expiry time at the front of the list. Only the
|
||||
* timer service task is allowed to access these lists.
|
||||
@@ -149,6 +140,8 @@
|
||||
PRIVILEGED_DATA static QueueHandle_t xTimerQueue = NULL;
|
||||
PRIVILEGED_DATA static TaskHandle_t xTimerTaskHandle = NULL;
|
||||
|
||||
/*lint -restore */
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
@@ -179,15 +172,6 @@
|
||||
const TickType_t xTimeNow,
|
||||
const TickType_t xCommandTime ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Reload the specified auto-reload timer. If the reloading is backlogged,
|
||||
* clear the backlog, calling the callback for each additional reload. When
|
||||
* this function returns, the next expiry time is after xTimeNow.
|
||||
*/
|
||||
static void prvReloadTimer( Timer_t * const pxTimer,
|
||||
TickType_t xExpiredTime,
|
||||
const TickType_t xTimeNow ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* An active timer has reached its expire time. Reload the timer if it is an
|
||||
* auto-reload timer, then call its callback.
|
||||
@@ -226,9 +210,9 @@
|
||||
* Called after a Timer_t structure has been allocated either statically or
|
||||
* dynamically to fill in the structure's members.
|
||||
*/
|
||||
static void prvInitialiseNewTimer( const char * const pcTimerName,
|
||||
static void prvInitialiseNewTimer( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const BaseType_t xAutoReload,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction,
|
||||
Timer_t * pxNewTimer ) PRIVILEGED_FUNCTION;
|
||||
@@ -238,8 +222,6 @@
|
||||
{
|
||||
BaseType_t xReturn = pdFAIL;
|
||||
|
||||
traceENTER_xTimerCreateTimerTask();
|
||||
|
||||
/* This function is called when the scheduler is started if
|
||||
* configUSE_TIMERS is set to 1. Check that the infrastructure used by the
|
||||
* timer service task has been created/initialised. If timers have already
|
||||
@@ -247,54 +229,17 @@
|
||||
prvCheckForValidListAndQueue();
|
||||
|
||||
if( xTimerQueue != NULL )
|
||||
{
|
||||
#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
|
||||
{
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
StaticTask_t * pxTimerTaskTCBBuffer = NULL;
|
||||
StackType_t * pxTimerTaskStackBuffer = NULL;
|
||||
configSTACK_DEPTH_TYPE uxTimerTaskStackSize;
|
||||
uint32_t ulTimerTaskStackSize;
|
||||
|
||||
vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &uxTimerTaskStackSize );
|
||||
xTimerTaskHandle = xTaskCreateStaticAffinitySet( prvTimerTask,
|
||||
configTIMER_SERVICE_TASK_NAME,
|
||||
uxTimerTaskStackSize,
|
||||
NULL,
|
||||
( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
|
||||
pxTimerTaskStackBuffer,
|
||||
pxTimerTaskTCBBuffer,
|
||||
configTIMER_SERVICE_TASK_CORE_AFFINITY );
|
||||
|
||||
if( xTimerTaskHandle != NULL )
|
||||
{
|
||||
xReturn = pdPASS;
|
||||
}
|
||||
}
|
||||
#else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
|
||||
{
|
||||
xReturn = xTaskCreateAffinitySet( prvTimerTask,
|
||||
configTIMER_SERVICE_TASK_NAME,
|
||||
configTIMER_TASK_STACK_DEPTH,
|
||||
NULL,
|
||||
( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
|
||||
configTIMER_SERVICE_TASK_CORE_AFFINITY,
|
||||
&xTimerTaskHandle );
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
}
|
||||
#else /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
|
||||
{
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
StaticTask_t * pxTimerTaskTCBBuffer = NULL;
|
||||
StackType_t * pxTimerTaskStackBuffer = NULL;
|
||||
configSTACK_DEPTH_TYPE uxTimerTaskStackSize;
|
||||
|
||||
vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &uxTimerTaskStackSize );
|
||||
vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &ulTimerTaskStackSize );
|
||||
xTimerTaskHandle = xTaskCreateStatic( prvTimerTask,
|
||||
configTIMER_SERVICE_TASK_NAME,
|
||||
uxTimerTaskStackSize,
|
||||
ulTimerTaskStackSize,
|
||||
NULL,
|
||||
( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
|
||||
pxTimerTaskStackBuffer,
|
||||
@@ -316,37 +261,27 @@
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
}
|
||||
#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) */
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
|
||||
configASSERT( xReturn );
|
||||
|
||||
traceRETURN_xTimerCreateTimerTask( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
|
||||
TimerHandle_t xTimerCreate( const char * const pcTimerName,
|
||||
TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const BaseType_t xAutoReload,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction )
|
||||
{
|
||||
Timer_t * pxNewTimer;
|
||||
|
||||
traceENTER_xTimerCreate( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction );
|
||||
|
||||
/* MISRA Ref 11.5.1 [Malloc memory assignment] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) );
|
||||
pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of Timer_t is always a pointer to the timer's mame. */
|
||||
|
||||
if( pxNewTimer != NULL )
|
||||
{
|
||||
@@ -354,11 +289,9 @@
|
||||
* and has not been started. The auto-reload bit may get set in
|
||||
* prvInitialiseNewTimer. */
|
||||
pxNewTimer->ucStatus = 0x00;
|
||||
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
|
||||
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
|
||||
}
|
||||
|
||||
traceRETURN_xTimerCreate( pxNewTimer );
|
||||
|
||||
return pxNewTimer;
|
||||
}
|
||||
|
||||
@@ -367,17 +300,15 @@
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
|
||||
TimerHandle_t xTimerCreateStatic( const char * const pcTimerName,
|
||||
TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const BaseType_t xAutoReload,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction,
|
||||
StaticTimer_t * pxTimerBuffer )
|
||||
{
|
||||
Timer_t * pxNewTimer;
|
||||
|
||||
traceENTER_xTimerCreateStatic( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxTimerBuffer );
|
||||
|
||||
#if ( configASSERT_DEFINED == 1 )
|
||||
{
|
||||
/* Sanity check that the size of the structure used to declare a
|
||||
@@ -385,38 +316,33 @@
|
||||
* structure. */
|
||||
volatile size_t xSize = sizeof( StaticTimer_t );
|
||||
configASSERT( xSize == sizeof( Timer_t ) );
|
||||
( void ) xSize; /* Prevent unused variable warning when configASSERT() is not defined. */
|
||||
( void ) xSize; /* Keeps lint quiet when configASSERT() is not defined. */
|
||||
}
|
||||
#endif /* configASSERT_DEFINED */
|
||||
|
||||
/* A pointer to a StaticTimer_t structure MUST be provided, use it. */
|
||||
configASSERT( pxTimerBuffer );
|
||||
/* MISRA Ref 11.3.1 [Misaligned access] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
|
||||
/* coverity[misra_c_2012_rule_11_3_violation] */
|
||||
pxNewTimer = ( Timer_t * ) pxTimerBuffer;
|
||||
pxNewTimer = ( Timer_t * ) pxTimerBuffer; /*lint !e740 !e9087 StaticTimer_t is a pointer to a Timer_t, so guaranteed to be aligned and sized correctly (checked by an assert()), so this is safe. */
|
||||
|
||||
if( pxNewTimer != NULL )
|
||||
{
|
||||
/* Timers can be created statically or dynamically so note this
|
||||
* timer was created statically in case it is later deleted. The
|
||||
* auto-reload bit may get set in prvInitialiseNewTimer(). */
|
||||
pxNewTimer->ucStatus = ( uint8_t ) tmrSTATUS_IS_STATICALLY_ALLOCATED;
|
||||
pxNewTimer->ucStatus = tmrSTATUS_IS_STATICALLY_ALLOCATED;
|
||||
|
||||
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, xAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
|
||||
prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer );
|
||||
}
|
||||
|
||||
traceRETURN_xTimerCreateStatic( pxNewTimer );
|
||||
|
||||
return pxNewTimer;
|
||||
}
|
||||
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvInitialiseNewTimer( const char * const pcTimerName,
|
||||
static void prvInitialiseNewTimer( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
const TickType_t xTimerPeriodInTicks,
|
||||
const BaseType_t xAutoReload,
|
||||
const UBaseType_t uxAutoReload,
|
||||
void * const pvTimerID,
|
||||
TimerCallbackFunction_t pxCallbackFunction,
|
||||
Timer_t * pxNewTimer )
|
||||
@@ -424,6 +350,8 @@
|
||||
/* 0 is not a valid value for xTimerPeriodInTicks. */
|
||||
configASSERT( ( xTimerPeriodInTicks > 0 ) );
|
||||
|
||||
if( pxNewTimer != NULL )
|
||||
{
|
||||
/* Ensure the infrastructure used by the timer service task has been
|
||||
* created/initialised. */
|
||||
prvCheckForValidListAndQueue();
|
||||
@@ -436,16 +364,17 @@
|
||||
pxNewTimer->pxCallbackFunction = pxCallbackFunction;
|
||||
vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
|
||||
|
||||
if( xAutoReload != pdFALSE )
|
||||
if( uxAutoReload != pdFALSE )
|
||||
{
|
||||
pxNewTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_AUTORELOAD;
|
||||
pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
|
||||
}
|
||||
|
||||
traceTIMER_CREATE( pxNewTimer );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
|
||||
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
@@ -454,10 +383,6 @@
|
||||
BaseType_t xReturn = pdFAIL;
|
||||
DaemonTaskMessage_t xMessage;
|
||||
|
||||
( void ) pxHigherPriorityTaskWoken;
|
||||
|
||||
traceENTER_xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
/* Send a message to the timer service task to perform a particular action
|
||||
@@ -469,8 +394,6 @@
|
||||
xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
|
||||
xMessage.u.xTimerParameters.pxTimer = xTimer;
|
||||
|
||||
configASSERT( xCommandID < tmrFIRST_FROM_ISR_COMMAND );
|
||||
|
||||
if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )
|
||||
{
|
||||
if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )
|
||||
@@ -482,47 +405,7 @@
|
||||
xReturn = xQueueSendToBack( xTimerQueue, &xMessage, tmrNO_DELAY );
|
||||
}
|
||||
}
|
||||
|
||||
traceTIMER_COMMAND_SEND( xTimer, xCommandID, xOptionalValue, xReturn );
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
|
||||
traceRETURN_xTimerGenericCommandFromTask( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
|
||||
const BaseType_t xCommandID,
|
||||
const TickType_t xOptionalValue,
|
||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||
const TickType_t xTicksToWait )
|
||||
{
|
||||
BaseType_t xReturn = pdFAIL;
|
||||
DaemonTaskMessage_t xMessage;
|
||||
|
||||
( void ) xTicksToWait;
|
||||
|
||||
traceENTER_xTimerGenericCommandFromISR( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
/* Send a message to the timer service task to perform a particular action
|
||||
* on a particular timer definition. */
|
||||
if( xTimerQueue != NULL )
|
||||
{
|
||||
/* Send a command to the timer service task to start the xTimer timer. */
|
||||
xMessage.xMessageID = xCommandID;
|
||||
xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
|
||||
xMessage.u.xTimerParameters.pxTimer = xTimer;
|
||||
|
||||
configASSERT( xCommandID >= tmrFIRST_FROM_ISR_COMMAND );
|
||||
|
||||
if( xCommandID >= tmrFIRST_FROM_ISR_COMMAND )
|
||||
{
|
||||
xReturn = xQueueSendToBackFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
|
||||
}
|
||||
@@ -534,22 +417,15 @@
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
|
||||
traceRETURN_xTimerGenericCommandFromISR( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
TaskHandle_t xTimerGetTimerDaemonTaskHandle( void )
|
||||
{
|
||||
traceENTER_xTimerGetTimerDaemonTaskHandle();
|
||||
|
||||
/* If xTimerGetTimerDaemonTaskHandle() is called before the scheduler has been
|
||||
* started, then xTimerTaskHandle will be NULL. */
|
||||
configASSERT( ( xTimerTaskHandle != NULL ) );
|
||||
|
||||
traceRETURN_xTimerGetTimerDaemonTaskHandle( xTimerTaskHandle );
|
||||
|
||||
return xTimerTaskHandle;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -558,79 +434,53 @@
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
||||
traceENTER_xTimerGetPeriod( xTimer );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
traceRETURN_xTimerGetPeriod( pxTimer->xTimerPeriodInTicks );
|
||||
|
||||
return pxTimer->xTimerPeriodInTicks;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||
const BaseType_t xAutoReload )
|
||||
const UBaseType_t uxAutoReload )
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
||||
traceENTER_vTimerSetReloadMode( xTimer, xAutoReload );
|
||||
|
||||
configASSERT( xTimer );
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( xAutoReload != pdFALSE )
|
||||
if( uxAutoReload != pdFALSE )
|
||||
{
|
||||
pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_AUTORELOAD;
|
||||
pxTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_AUTORELOAD );
|
||||
pxTimer->ucStatus &= ~tmrSTATUS_IS_AUTORELOAD;
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
traceRETURN_vTimerSetReloadMode();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t xTimerGetReloadMode( TimerHandle_t xTimer )
|
||||
UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer )
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
BaseType_t xReturn;
|
||||
|
||||
traceENTER_xTimerGetReloadMode( xTimer );
|
||||
UBaseType_t uxReturn;
|
||||
|
||||
configASSERT( xTimer );
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0U )
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) == 0 )
|
||||
{
|
||||
/* Not an auto-reload timer. */
|
||||
xReturn = pdFALSE;
|
||||
uxReturn = ( UBaseType_t ) pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Is an auto-reload timer. */
|
||||
xReturn = pdTRUE;
|
||||
uxReturn = ( UBaseType_t ) pdTRUE;
|
||||
}
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
traceRETURN_xTimerGetReloadMode( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer )
|
||||
{
|
||||
UBaseType_t uxReturn;
|
||||
|
||||
traceENTER_uxTimerGetReloadMode( xTimer );
|
||||
|
||||
uxReturn = ( UBaseType_t ) xTimerGetReloadMode( xTimer );
|
||||
|
||||
traceRETURN_uxTimerGetReloadMode( uxReturn );
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -640,107 +490,60 @@
|
||||
Timer_t * pxTimer = xTimer;
|
||||
TickType_t xReturn;
|
||||
|
||||
traceENTER_xTimerGetExpiryTime( xTimer );
|
||||
|
||||
configASSERT( xTimer );
|
||||
xReturn = listGET_LIST_ITEM_VALUE( &( pxTimer->xTimerListItem ) );
|
||||
|
||||
traceRETURN_xTimerGetExpiryTime( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
|
||||
StaticTimer_t ** ppxTimerBuffer )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
||||
traceENTER_xTimerGetStaticBuffer( xTimer, ppxTimerBuffer );
|
||||
|
||||
configASSERT( ppxTimerBuffer != NULL );
|
||||
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) != 0U )
|
||||
{
|
||||
/* MISRA Ref 11.3.1 [Misaligned access] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */
|
||||
/* coverity[misra_c_2012_rule_11_3_violation] */
|
||||
*ppxTimerBuffer = ( StaticTimer_t * ) pxTimer;
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
|
||||
traceRETURN_xTimerGetStaticBuffer( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
const char * pcTimerGetName( TimerHandle_t xTimer )
|
||||
const char * pcTimerGetName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
||||
traceENTER_pcTimerGetName( xTimer );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
traceRETURN_pcTimerGetName( pxTimer->pcTimerName );
|
||||
|
||||
return pxTimer->pcTimerName;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvReloadTimer( Timer_t * const pxTimer,
|
||||
TickType_t xExpiredTime,
|
||||
const TickType_t xTimeNow )
|
||||
{
|
||||
/* Insert the timer into the appropriate list for the next expiry time.
|
||||
* If the next expiry time has already passed, advance the expiry time,
|
||||
* call the callback function, and try again. */
|
||||
while( prvInsertTimerInActiveList( pxTimer, ( xExpiredTime + pxTimer->xTimerPeriodInTicks ), xTimeNow, xExpiredTime ) != pdFALSE )
|
||||
{
|
||||
/* Advance the expiry time. */
|
||||
xExpiredTime += pxTimer->xTimerPeriodInTicks;
|
||||
|
||||
/* Call the timer callback. */
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvProcessExpiredTimer( const TickType_t xNextExpireTime,
|
||||
const TickType_t xTimeNow )
|
||||
{
|
||||
/* MISRA Ref 11.5.3 [Void pointer assignment] */
|
||||
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
|
||||
/* coverity[misra_c_2012_rule_11_5_violation] */
|
||||
Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList );
|
||||
BaseType_t xResult;
|
||||
Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList ); /*lint !e9087 !e9079 void * is used as this macro is used with tasks and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
|
||||
|
||||
/* Remove the timer from the list of active timers. A check has already
|
||||
* been performed to ensure the list is not empty. */
|
||||
|
||||
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
|
||||
/* If the timer is an auto-reload timer then calculate the next
|
||||
* expiry time and re-insert the timer in the list of active timers. */
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U )
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )
|
||||
{
|
||||
prvReloadTimer( pxTimer, xNextExpireTime, xTimeNow );
|
||||
/* The timer is inserted into a list using a time relative to anything
|
||||
* other than the current time. It will therefore be inserted into the
|
||||
* correct list relative to the time this task thinks it is now. */
|
||||
if( prvInsertTimerInActiveList( pxTimer, ( xNextExpireTime + pxTimer->xTimerPeriodInTicks ), xTimeNow, xNextExpireTime ) != pdFALSE )
|
||||
{
|
||||
/* The timer expired before it was added to the active timer
|
||||
* list. Reload it now. */
|
||||
xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START_DONT_TRACE, xNextExpireTime, NULL, tmrNO_DELAY );
|
||||
configASSERT( xResult );
|
||||
( void ) xResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
|
||||
/* Call the timer callback. */
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -755,6 +558,8 @@
|
||||
|
||||
#if ( configUSE_DAEMON_TASK_STARTUP_HOOK == 1 )
|
||||
{
|
||||
extern void vApplicationDaemonTaskStartupHook( void );
|
||||
|
||||
/* Allow the application writer to execute some code in the context of
|
||||
* this task at the point the task starts executing. This is useful if the
|
||||
* application includes initialisation code that would benefit from
|
||||
@@ -763,7 +568,7 @@
|
||||
}
|
||||
#endif /* configUSE_DAEMON_TASK_STARTUP_HOOK */
|
||||
|
||||
for( ; configCONTROL_INFINITE_LOOP(); )
|
||||
for( ; ; )
|
||||
{
|
||||
/* Query the timers list to see if it contains any timers, and if so,
|
||||
* obtain the time at which the next timer will expire. */
|
||||
@@ -825,7 +630,7 @@
|
||||
* block time to expire. If a command arrived between the
|
||||
* critical section being exited and this yield then the yield
|
||||
* will not cause the task to block. */
|
||||
taskYIELD_WITHIN_API();
|
||||
portYIELD_WITHIN_API();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -871,7 +676,7 @@
|
||||
static TickType_t prvSampleTimeNow( BaseType_t * const pxTimerListsWereSwitched )
|
||||
{
|
||||
TickType_t xTimeNow;
|
||||
PRIVILEGED_DATA static TickType_t xLastTime = ( TickType_t ) 0U;
|
||||
PRIVILEGED_DATA static TickType_t xLastTime = ( TickType_t ) 0U; /*lint !e956 Variable is only accessible to one task. */
|
||||
|
||||
xTimeNow = xTaskGetTickCount();
|
||||
|
||||
@@ -905,7 +710,7 @@
|
||||
{
|
||||
/* Has the expiry time elapsed between the command to start/reset a
|
||||
* timer was issued, and the time the command was processed? */
|
||||
if( ( ( TickType_t ) ( xTimeNow - xCommandTime ) ) >= pxTimer->xTimerPeriodInTicks )
|
||||
if( ( ( TickType_t ) ( xTimeNow - xCommandTime ) ) >= pxTimer->xTimerPeriodInTicks ) /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||
{
|
||||
/* The time between a command being issued and the command being
|
||||
* processed actually exceeds the timers period. */
|
||||
@@ -937,12 +742,12 @@
|
||||
|
||||
static void prvProcessReceivedCommands( void )
|
||||
{
|
||||
DaemonTaskMessage_t xMessage = { 0 };
|
||||
DaemonTaskMessage_t xMessage;
|
||||
Timer_t * pxTimer;
|
||||
BaseType_t xTimerListsWereSwitched;
|
||||
BaseType_t xTimerListsWereSwitched, xResult;
|
||||
TickType_t xTimeNow;
|
||||
|
||||
while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL )
|
||||
while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) /*lint !e603 xMessage does not have to be initialised as it is passed out, not in, and it is not used unless xQueueReceive() returns pdTRUE. */
|
||||
{
|
||||
#if ( INCLUDE_xTimerPendFunctionCall == 1 )
|
||||
{
|
||||
@@ -974,7 +779,7 @@
|
||||
* software timer. */
|
||||
pxTimer = xMessage.u.xTimerParameters.pxTimer;
|
||||
|
||||
if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE )
|
||||
if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE ) /*lint !e961. The cast is only redundant when NULL is passed into the macro. */
|
||||
{
|
||||
/* The timer is in a list, remove it. */
|
||||
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
|
||||
@@ -1000,25 +805,27 @@
|
||||
case tmrCOMMAND_START_FROM_ISR:
|
||||
case tmrCOMMAND_RESET:
|
||||
case tmrCOMMAND_RESET_FROM_ISR:
|
||||
case tmrCOMMAND_START_DONT_TRACE:
|
||||
/* Start or restart a timer. */
|
||||
pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE;
|
||||
pxTimer->ucStatus |= tmrSTATUS_IS_ACTIVE;
|
||||
|
||||
if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) != pdFALSE )
|
||||
{
|
||||
/* The timer expired before it was added to the active
|
||||
* timer list. Process it now. */
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0U )
|
||||
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )
|
||||
{
|
||||
prvReloadTimer( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow );
|
||||
xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START_DONT_TRACE, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, NULL, tmrNO_DELAY );
|
||||
configASSERT( xResult );
|
||||
( void ) xResult;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
|
||||
/* Call the timer callback. */
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1030,12 +837,12 @@
|
||||
case tmrCOMMAND_STOP:
|
||||
case tmrCOMMAND_STOP_FROM_ISR:
|
||||
/* The timer has already been removed from the active list. */
|
||||
pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
|
||||
pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;
|
||||
break;
|
||||
|
||||
case tmrCOMMAND_CHANGE_PERIOD:
|
||||
case tmrCOMMAND_CHANGE_PERIOD_FROM_ISR:
|
||||
pxTimer->ucStatus |= ( uint8_t ) tmrSTATUS_IS_ACTIVE;
|
||||
pxTimer->ucStatus |= tmrSTATUS_IS_ACTIVE;
|
||||
pxTimer->xTimerPeriodInTicks = xMessage.u.xTimerParameters.xMessageValue;
|
||||
configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) );
|
||||
|
||||
@@ -1060,7 +867,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
|
||||
pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;
|
||||
}
|
||||
}
|
||||
#else /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
|
||||
@@ -1069,7 +876,7 @@
|
||||
* could not have been dynamically allocated. So there is
|
||||
* no need to free the memory - just mark the timer as
|
||||
* "not active". */
|
||||
pxTimer->ucStatus &= ( ( uint8_t ) ~tmrSTATUS_IS_ACTIVE );
|
||||
pxTimer->ucStatus &= ~tmrSTATUS_IS_ACTIVE;
|
||||
}
|
||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
break;
|
||||
@@ -1085,8 +892,10 @@
|
||||
|
||||
static void prvSwitchTimerLists( void )
|
||||
{
|
||||
TickType_t xNextExpireTime;
|
||||
TickType_t xNextExpireTime, xReloadTime;
|
||||
List_t * pxTemp;
|
||||
Timer_t * pxTimer;
|
||||
BaseType_t xResult;
|
||||
|
||||
/* The tick count has overflowed. The timer lists must be switched.
|
||||
* If there are any timers still referenced from the current timer list
|
||||
@@ -1096,10 +905,43 @@
|
||||
{
|
||||
xNextExpireTime = listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxCurrentTimerList );
|
||||
|
||||
/* Process the expired timer. For auto-reload timers, be careful to
|
||||
* process only expirations that occur on the current list. Further
|
||||
* expirations must wait until after the lists are switched. */
|
||||
prvProcessExpiredTimer( xNextExpireTime, tmrMAX_TIME_BEFORE_OVERFLOW );
|
||||
/* Remove the timer from the list. */
|
||||
pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTimerList ); /*lint !e9087 !e9079 void * is used as this macro is used with tasks and co-routines too. Alignment is known to be fine as the type of the pointer stored and retrieved is the same. */
|
||||
( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
|
||||
traceTIMER_EXPIRED( pxTimer );
|
||||
|
||||
/* Execute its callback, then send a command to restart the timer if
|
||||
* it is an auto-reload timer. It cannot be restarted here as the lists
|
||||
* have not yet been switched. */
|
||||
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
|
||||
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_AUTORELOAD ) != 0 )
|
||||
{
|
||||
/* Calculate the reload value, and if the reload value results in
|
||||
* the timer going into the same timer list then it has already expired
|
||||
* and the timer should be re-inserted into the current list so it is
|
||||
* processed again within this loop. Otherwise a command should be sent
|
||||
* to restart the timer to ensure it is only inserted into a list after
|
||||
* the lists have been swapped. */
|
||||
xReloadTime = ( xNextExpireTime + pxTimer->xTimerPeriodInTicks );
|
||||
|
||||
if( xReloadTime > xNextExpireTime )
|
||||
{
|
||||
listSET_LIST_ITEM_VALUE( &( pxTimer->xTimerListItem ), xReloadTime );
|
||||
listSET_LIST_ITEM_OWNER( &( pxTimer->xTimerListItem ), pxTimer );
|
||||
vListInsert( pxCurrentTimerList, &( pxTimer->xTimerListItem ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START_DONT_TRACE, xNextExpireTime, NULL, tmrNO_DELAY );
|
||||
configASSERT( xResult );
|
||||
( void ) xResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
|
||||
pxTemp = pxCurrentTimerList;
|
||||
@@ -1126,14 +968,14 @@
|
||||
{
|
||||
/* The timer queue is allocated statically in case
|
||||
* configSUPPORT_DYNAMIC_ALLOCATION is 0. */
|
||||
PRIVILEGED_DATA static StaticQueue_t xStaticTimerQueue;
|
||||
PRIVILEGED_DATA static uint8_t ucStaticTimerQueueStorage[ ( size_t ) configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ];
|
||||
PRIVILEGED_DATA static StaticQueue_t xStaticTimerQueue; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */
|
||||
PRIVILEGED_DATA static uint8_t ucStaticTimerQueueStorage[ ( size_t ) configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ]; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */
|
||||
|
||||
xTimerQueue = xQueueCreateStatic( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ), &( ucStaticTimerQueueStorage[ 0 ] ), &xStaticTimerQueue );
|
||||
}
|
||||
#else
|
||||
{
|
||||
xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ) );
|
||||
xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, sizeof( DaemonTaskMessage_t ) );
|
||||
}
|
||||
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
|
||||
|
||||
@@ -1164,14 +1006,12 @@
|
||||
BaseType_t xReturn;
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
||||
traceENTER_xTimerIsTimerActive( xTimer );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
/* Is the timer in the list of active timers? */
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_ACTIVE ) == 0U )
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_ACTIVE ) == 0 )
|
||||
{
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
@@ -1182,10 +1022,8 @@
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
traceRETURN_xTimerIsTimerActive( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
} /*lint !e818 Can't be pointer to const due to the typedef. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void * pvTimerGetTimerID( const TimerHandle_t xTimer )
|
||||
@@ -1193,8 +1031,6 @@
|
||||
Timer_t * const pxTimer = xTimer;
|
||||
void * pvReturn;
|
||||
|
||||
traceENTER_pvTimerGetTimerID( xTimer );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
@@ -1203,8 +1039,6 @@
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
traceRETURN_pvTimerGetTimerID( pvReturn );
|
||||
|
||||
return pvReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -1214,8 +1048,6 @@
|
||||
{
|
||||
Timer_t * const pxTimer = xTimer;
|
||||
|
||||
traceENTER_vTimerSetTimerID( xTimer, pvNewID );
|
||||
|
||||
configASSERT( xTimer );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
@@ -1223,8 +1055,6 @@
|
||||
pxTimer->pvTimerID = pvNewID;
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
traceRETURN_vTimerSetTimerID();
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -1238,8 +1068,6 @@
|
||||
DaemonTaskMessage_t xMessage;
|
||||
BaseType_t xReturn;
|
||||
|
||||
traceENTER_xTimerPendFunctionCallFromISR( xFunctionToPend, pvParameter1, ulParameter2, pxHigherPriorityTaskWoken );
|
||||
|
||||
/* Complete the message with the function parameters and post it to the
|
||||
* daemon task. */
|
||||
xMessage.xMessageID = tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR;
|
||||
@@ -1250,7 +1078,6 @@
|
||||
xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );
|
||||
|
||||
tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
|
||||
traceRETURN_xTimerPendFunctionCallFromISR( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
@@ -1268,8 +1095,6 @@
|
||||
DaemonTaskMessage_t xMessage;
|
||||
BaseType_t xReturn;
|
||||
|
||||
traceENTER_xTimerPendFunctionCall( xFunctionToPend, pvParameter1, ulParameter2, xTicksToWait );
|
||||
|
||||
/* This function can only be called after a timer has been created or
|
||||
* after the scheduler has been started because, until then, the timer
|
||||
* queue does not exist. */
|
||||
@@ -1285,7 +1110,6 @@
|
||||
xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );
|
||||
|
||||
tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn );
|
||||
traceRETURN_xTimerPendFunctionCall( xReturn );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
@@ -1297,10 +1121,6 @@
|
||||
|
||||
UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer )
|
||||
{
|
||||
traceENTER_uxTimerGetTimerNumber( xTimer );
|
||||
|
||||
traceRETURN_uxTimerGetTimerNumber( ( ( Timer_t * ) xTimer )->uxTimerNumber );
|
||||
|
||||
return ( ( Timer_t * ) xTimer )->uxTimerNumber;
|
||||
}
|
||||
|
||||
@@ -1312,28 +1132,12 @@
|
||||
void vTimerSetTimerNumber( TimerHandle_t xTimer,
|
||||
UBaseType_t uxTimerNumber )
|
||||
{
|
||||
traceENTER_vTimerSetTimerNumber( xTimer, uxTimerNumber );
|
||||
|
||||
( ( Timer_t * ) xTimer )->uxTimerNumber = uxTimerNumber;
|
||||
|
||||
traceRETURN_vTimerSetTimerNumber();
|
||||
}
|
||||
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Reset the state in this file. This state is normally initialized at start up.
|
||||
* This function must be called by the application before restarting the
|
||||
* scheduler.
|
||||
*/
|
||||
void vTimerResetState( void )
|
||||
{
|
||||
xTimerQueue = NULL;
|
||||
xTimerTaskHandle = NULL;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* This entire source file will be skipped if the application is not configured
|
||||
* to include software timer functionality. If you want to include software timer
|
||||
* functionality then ensure configUSE_TIMERS is set to 1 in FreeRTOSConfig.h. */
|
||||
|
||||
@@ -6,7 +6,7 @@ TRANSLATION_DIR="../Translations"
|
||||
# AVAILABLE_LANGUAGES will be calculating according to json files in $TRANSLATION_DIR
|
||||
AVAILABLE_LANGUAGES=()
|
||||
BUILD_LANGUAGES=()
|
||||
AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "S60P" "T55" "TS101")
|
||||
AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "S60P" "T55" "S99" "TS101")
|
||||
BUILD_MODELS=()
|
||||
|
||||
builder_info() {
|
||||
|
||||
Reference in New Issue
Block a user