Compare commits

..

45 Commits

Author SHA1 Message Date
jonasius
331a278cb8 Merge a5560ae4ea into 40655a9501 2025-02-25 22:01:44 +01:00
Leska
40655a9501 Updated Overall French Translations (#2085)
Some checks failed
Docs / deploy-docs (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_docs (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
* Updated French translation.

* Updated

* Update Translations/translation_FR.json (discip)

Co-authored-by: discip <53649486+discip@users.noreply.github.com>

* added missing options

For some reason the following options were missing:
* Cool Down Blink
* Reverse Temp Change Buttons

* Update translation_FR.json

* Update translation_FR.json

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2025-02-25 18:09:15 +01:00
discip
a5560ae4ea Merge branch 'dev' into dev 2025-01-13 22:20:48 +01:00
discip
867f1fcb0d Merge branch 'dev' into dev 2024-12-07 00:04:31 +01:00
jonasius
02580dab2e Add probing for unused devices for testing/timing 2024-12-06 23:51:36 +01:00
jonasius
17f15bca98 Merge branch 'Ralim:dev' into dev 2024-11-19 22:47:29 +01:00
discip
35fd2f545f Merge branch 'dev' into dev 2024-11-08 00:09:04 +01:00
discip
b036da9dcc Merge branch 'dev' into dev 2024-09-04 22:29:28 +02:00
discip
2679a791d9 Merge branch 'dev' into dev 2024-08-24 13:04:38 +02:00
jonasius
4b340c52bc Add THERMAL_RUNAWAY config values for S99 2024-08-07 20:40:16 +02:00
jonasius
e667189f45 Add MODEL_S99 2024-08-07 20:39:51 +02:00
jonasius
a132d37dc6 Merge remote-tracking branch 'upstream/dev' into dev 2024-08-07 20:39:30 +02:00
jonasius
fcb1b3785f Merge branch 'dev' of https://github.com/jonasius/IronOS into dev 2024-08-05 22:12:15 +02:00
jonasius
a2734eed9e Fix i2c_probe function 2024-08-05 22:02:15 +02:00
jonasius
e79687e1e8 Set equal USB_PD_TIMEOUT for all Sequre irons 2024-08-05 21:59:51 +02:00
discip
ae21be2913 Merge branch 'dev' into dev 2024-07-11 22:04:43 +02:00
discip
fa3d4d49d5 Merge branch 'dev' into dev 2024-07-11 15:36:02 +02:00
jonasius
693c1a3f2f Merge branch 'dev' into dev 2024-06-28 23:49:53 +02:00
jonasius
f21630eb79 Enable/add DC support for S60P 2024-06-28 17:54:43 +02:00
jonasius
4634fa8ba7 Fix showing displayPowerMenu for POW_PD and POW_PD_EXT 2 2024-06-28 17:47:59 +02:00
jonasius
6ad0b65bff Correct README to Sequre S60, S60P and S99 2024-06-27 19:08:26 +02:00
jonasius
69493ba212 Add missing braces 2024-06-27 19:07:39 +02:00
jonasius
e6a3f380e1 4x faster PWM, add Timer changes from #1926 2024-06-26 00:13:23 +02:00
jonasius
56b91ac13c Add missing __HAL_RCC_GPIOB_CLK_ENABLE 2024-06-25 23:53:07 +02:00
jonasius
0d74f773b2 Code cleanup, always init both I2C bus 2024-06-25 23:40:17 +02:00
jonasius
51e08f3992 Fix clang-format issues 2024-06-25 19:13:30 +02:00
jonasius
e9117269ef Add experimental detection of separate USB-PD I2C bus for S99 v1.5 and S60P v1.2 2024-06-25 19:07:22 +02:00
jonasius
c776390ac3 Add pins for S99 v1.5 and probably S60P v1.2 2024-06-25 19:03:07 +02:00
jonasius
a626d5a9c1 Fix missing PD related description of menu items and messages for POW_PD_EXT 2024-06-25 17:26:14 +02:00
jonasius
c8c36d29bf Fix clang-format code style mismatches 2024-06-19 22:24:05 +02:00
jonasius
b772e1dc26 Add S99 to overview table 2024-06-19 22:05:55 +02:00
jonasius
8514edfdea Fix clang-format code style mismatches 2024-06-06 23:35:12 +02:00
jonasius
f5d6d8b1af Add define for USB_PD_TIMEOUT, the default value for PDNegTimeout 2024-06-06 23:13:58 +02:00
jonasius
da28492f00 Add define for USB_PD_TIMEOUT, the default value for PDNegTimeout 2024-06-06 23:09:43 +02:00
jonasius
6ef1fbd46a Support for S99
* Enable PD Options
* Make PDNegTimeout configureable
* Add default value for PDNegTimeout, also for S60 and S60P
* Add basic DC detection / correct debug readings while powered via DC
* Add basic ThermoModel for C245 Tips
* Modify op-amp gain
2024-06-06 22:35:35 +02:00
jonasius
6e53d85b32 Rename Sequre_S60 folder to Sequre 2024-06-06 20:27:08 +02:00
jonasius
31ff398150 Correct debug menu "Tip R" to "Tip uV" 2024-06-03 22:30:07 +02:00
jonasius
a2615a57b8 Use SettingsOptions::PDNegTimeout in FS2711 driver 2024-06-02 22:53:34 +02:00
jonasius
e327be5bd8 Correct debug menu "Tip R" to "Tip uV" 2024-06-02 16:15:46 +02:00
jonasius
a306de5c37 Merge branch 'Ralim:dev' into dev 2024-06-01 14:03:50 +02:00
jonasius
2c5d2a08ed Add whitespaces according to coding style
Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2024-05-26 23:09:13 +02:00
jonasius
5ea42a8bbf Add whitespaces according to coding style
Co-authored-by: discip <53649486+discip@users.noreply.github.com>
2024-05-26 23:09:06 +02:00
jonasius
a3b7abbf0e Add Sequre S99 with correct bootloader offset 2024-05-26 21:14:11 +02:00
jonasius
1521b5ea31 Add S99 2024-05-26 21:13:41 +02:00
jonasius
653a0803e2 Add support for Sequre S99, copied S60P settings 2024-05-26 21:13:09 +02:00
65 changed files with 20688 additions and 28984 deletions

View File

@@ -26,6 +26,7 @@ jobs:
"S60", "S60",
"S60P", "S60P",
"T55", "T55",
"S99",
"TS101", "TS101",
] ]
fail-fast: true fail-fast: true

View File

@@ -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. 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. 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.

View File

@@ -52,7 +52,7 @@ DOCKER_CMD=$(DOCKER_BIN) -f $(DOCKER_YML) run --rm builder
MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml
# supported models # 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_ML=Pinecil Pinecilv2 # target names
MODELS_MULTILANG=Pinecil_multi-lang Pinecilv2_multi-lang # dir names MODELS_MULTILANG=Pinecil_multi-lang Pinecilv2_multi-lang # dir names

View File

@@ -30,7 +30,8 @@ _This firmware does **NOT** support the USB port while running for changing sett
| Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
| Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. | | Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. |
| Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | 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. | | Sequre T55 | ❌ | ❌ | ✔️ | ❌ | ❌ | N/A | ✔️ | Full OLED resolution not yet supported. |
| Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | | | Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | |
| Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌\*\* | | | Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌\*\* | |

View File

@@ -163,7 +163,7 @@ def get_debug_menu() -> List[str]:
"UpTime ", "UpTime ",
"Move ", "Move ",
"Tip Res", "Tip Res",
"Tip R ", "Tip uV ",
"Tip O ", "Tip O ",
"HW G ", "HW G ",
"HW M ", "HW M ",

View File

@@ -4,7 +4,7 @@
"tempUnitFahrenheit": false, "tempUnitFahrenheit": false,
"messagesWarn": { "messagesWarn": {
"CalibrationDone": { "CalibrationDone": {
"message": "Étalonnage\nterminé!" "message": "Étalonnage\nterminé !"
}, },
"ResetOKMessage": { "ResetOKMessage": {
"message": "Reset OK" "message": "Reset OK"
@@ -19,37 +19,37 @@
"message": "USB-PD\nnon détecté !" "message": "USB-PD\nnon détecté !"
}, },
"LockingKeysString": { "LockingKeysString": {
"message": "VERROUIL" "message": "VERROUIL"
}, },
"UnlockingKeysString": { "UnlockingKeysString": {
"message": "DEVERROU" "message": "DEVERROUILLÉ"
}, },
"WarningKeysLockedString": { "WarningKeysLockedString": {
"message": "! VERR. !" "message": "! VERR. !"
}, },
"WarningThermalRunaway": { "WarningThermalRunaway": {
"message": "Emballement\nthermique" "message": "Surchauffe\ncritique"
}, },
"WarningTipShorted": { "WarningTipShorted": {
"message": "!Tip Shorted!" "message": "!Court-circuit Panne!"
}, },
"SettingsCalibrationWarning": { "SettingsCalibrationWarning": {
"message": "Avant de redémarrer, assurez-vous que la panne et la poignée sont à température ambiante !" "message": "Avant de redémarrer, assurez-vous que la panne et la poignée sont à température ambiante !"
}, },
"CJCCalibrating": { "CJCCalibrating": {
"message": "Etalonnage\n" "message": "Étalonnage\n"
}, },
"SettingsResetWarning": { "SettingsResetWarning": {
"message": "Voulez-vous vraiment réinitialiser les paramètres aux valeurs par défaut ?" "message": "Voulez-vous vraiment réinitialiser les paramètres aux valeurs par défaut ?"
}, },
"UVLOWarningString": { "UVLOWarningString": {
"message": "DC FAIBL" "message": "TENSION FAIBLE"
}, },
"UndervoltageString": { "UndervoltageString": {
"message": "Sous-tension\n" "message": "Sous-tension\n"
}, },
"InputVoltageString": { "InputVoltageString": {
"message": "V d'entrée: \n" "message": "Tension d'entrée:\n"
}, },
"SleepingAdvancedString": { "SleepingAdvancedString": {
"message": "En veille...\n" "message": "En veille...\n"
@@ -58,10 +58,10 @@
"message": "Panne: \n" "message": "Panne: \n"
}, },
"ProfilePreheatString": { "ProfilePreheatString": {
"message": "Preheat\n" "message": "Préchauffage\n"
}, },
"ProfileCooldownString": { "ProfileCooldownString": {
"message": "Cooldown\n" "message": "Refroidissement\n"
}, },
"DeviceFailedValidationWarning": { "DeviceFailedValidationWarning": {
"message": "Votre appareil semble être une contrefaçon !" "message": "Votre appareil semble être une contrefaçon !"
@@ -107,22 +107,22 @@
}, },
"menuValues": { "menuValues": {
"USBPDModeDefault": { "USBPDModeDefault": {
"displayText": "Default\nMode" "displayText": "Mode\npar Défaut"
}, },
"USBPDModeNoDynamic": { "USBPDModeNoDynamic": {
"displayText": "No\nDynamic" "displayText": "Non\nDynamique"
}, },
"USBPDModeSafe": { "USBPDModeSafe": {
"displayText": "Safe\nMode" "displayText": "Mode\nSafe"
}, },
"TipTypeAuto": { "TipTypeAuto": {
"displayText": "Auto\nSense" "displayText": "Détéction\nAuto."
}, },
"TipTypeT12Long": { "TipTypeT12Long": {
"displayText": "TS100\nLong" "displayText": "TS100\nLong"
}, },
"TipTypeT12Short": { "TipTypeT12Short": {
"displayText": "Pine\nShort" "displayText": "Pine\nCourt"
}, },
"TipTypeT12PTS": { "TipTypeT12PTS": {
"displayText": "PTS\n200" "displayText": "PTS\n200"
@@ -137,11 +137,11 @@
"menuOptions": { "menuOptions": {
"DCInCutoff": { "DCInCutoff": {
"displayText": "Source\nd'alim.", "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": { "MinVolCell": {
"displayText": "Tension\nminimale", "displayText": "Tension\nminimale",
"description": "Tension minimale autorisée par cellule (3S: 3 - 3.7V | 4-6S: 2.4 - 3.7V)" "description": "Tension minimale autorisée par cellule (3S : 3 - 3.7V | 4-6S : 2.4 - 3.7V)"
}, },
"QCMaxVoltage": { "QCMaxVoltage": {
"displayText": "Tension\nQC", "displayText": "Tension\nQC",
@@ -149,18 +149,18 @@
}, },
"PDNegTimeout": { "PDNegTimeout": {
"displayText": "Délai\nexpir. PD", "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 gociation PD par paliers de 100ms pour la compatibilité avec certains chargeurs QC"
}, },
"USBPDMode": { "USBPDMode": {
"displayText": "PD\nMode", "displayText": "Mode\nPD",
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance" "description": "Aucune dynamique ne désactive EPR & PPS, le mode sécurisé n'utilise pas de résistance de protection"
}, },
"BoostTemperature": { "BoostTemperature": {
"displayText": "Temp.\nboost", "displayText": "Temp.\nboost",
"description": "Température utilisée en \"mode boost\"" "description": "Température utilisée en \"mode boost\""
}, },
"AutoStart": { "AutoStart": {
"displayText": "Chauffer au\ndémarrage", "displayText": "Chauffer audémarrage",
"description": "A=activé | V=mode veille | O=mode veille à température ambiante" "description": "A=activé | V=mode veille | O=mode veille à température ambiante"
}, },
"TempChangeShortStep": { "TempChangeShortStep": {
@@ -177,23 +177,23 @@
}, },
"ProfilePhases": { "ProfilePhases": {
"displayText": "Profile\nPhases", "displayText": "Profile\nPhases",
"description": "Number of phases in profile mode" "description": "Nombre de phases dans le mode de profile"
}, },
"ProfilePreheatTemp": { "ProfilePreheatTemp": {
"displayText": "Preheat\nTemp", "displayText": "Temp.\nPréchauffage",
"description": "Preheat to this temperature at the start of profile mode" "description": "Préchauffer à cette température au début du mode de profile"
}, },
"ProfilePreheatSpeed": { "ProfilePreheatSpeed": {
"displayText": "Preheat\nSpeed", "displayText": "Vitesse\nPréchauffage",
"description": "Preheat at this rate (degrees per second)" "description": "Préchauffer à cette vitesse (degrés par seconde)"
}, },
"ProfilePhase1Temp": { "ProfilePhase1Temp": {
"displayText": "Phase 1\nTemp", "displayText": "Temp.\nPhase 1",
"description": "Target temperature for the end of this phase" "description": "Température séléctionnée pour la fin de cette phase"
}, },
"ProfilePhase1Duration": { "ProfilePhase1Duration": {
"displayText": "Phase 1\nDuration", "displayText": "Durée\nPhase 1",
"description": "Target duration of this phase (seconds)" "description": "Durée séléctionnée pour cette phase (secondes)"
}, },
"ProfilePhase2Temp": { "ProfilePhase2Temp": {
"displayText": "Phase 2\nTemp", "displayText": "Phase 2\nTemp",
@@ -228,12 +228,12 @@
"description": "" "description": ""
}, },
"ProfileCooldownSpeed": { "ProfileCooldownSpeed": {
"displayText": "Cooldown\nSpeed", "displayText": "Vitesse de\nRefroidissement",
"description": "Cooldown at this rate at the end of profile mode (degrees per second)" "description": "Refroidissement à ce rythme à la fin du mode profil (degrés par seconde)"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"displayText": "Sensibilité\nau mouvement", "displayText": "Sensibilité\nau mouvement",
"description": "1=peu sensible | ... | 9=très sensible" "description": "1=très peu sensible | ... | 9=extrêmement sensible"
}, },
"SleepTemperature": { "SleepTemperature": {
"displayText": "Temp.\nveille", "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)" "description": "Sensibilité du capteur à effet Hall pour la mise en veille (1=peu sensible | ... | 9=très sensible)"
}, },
"HallEffSleepTimeout": { "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" "description": "Intervalle avant le démarrage du \"mode veille\" lorsque l'effet Hall est supérieur au seuil"
}, },
"TemperatureUnit": { "TemperatureUnit": {
"displayText": "Unité de\ntempérature", "displayText": "Unité de température",
"description": "C=Celsius | F=Fahrenheit" "description": "C=Celsius | F=Fahrenheit"
}, },
"DisplayRotation": { "DisplayRotation": {
"displayText": "Orientation\nde l'écran", "displayText": "Orientation de l'écran",
"description": "D=droitier | G=gaucher | A=automatique" "description": "D=droitier | G=gaucher | A=automatique"
}, },
"CooldownBlink": { "CooldownBlink": {
@@ -268,7 +268,7 @@
"description": "Faire clignoter la température lors du refroidissement tant que la panne est chaude" "description": "Faire clignoter la température lors du refroidissement tant que la panne est chaude"
}, },
"ScrollingSpeed": { "ScrollingSpeed": {
"displayText": "Vitesse de\ndéfilement", "displayText": "Vitesse de défilement",
"description": "Vitesse de défilement du texte (R=rapide | L=lent)" "description": "Vitesse de défilement du texte (R=rapide | L=lent)"
}, },
"ReverseButtonTempChange": { "ReverseButtonTempChange": {
@@ -276,7 +276,7 @@
"description": "Inverser les boutons d'ajustement de température" "description": "Inverser les boutons d'ajustement de température"
}, },
"AnimSpeed": { "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)" "description": "Vitesse des animations des icônes dans le menu (L=lente | M=moyenne | R=rapide)"
}, },
"AnimLoop": { "AnimLoop": {
@@ -340,8 +340,8 @@
"description": "" "description": ""
}, },
"SolderingTipType": { "SolderingTipType": {
"displayText": "Soldering\nTip Type", "displayText": "Soudure\nType de panne",
"description": "Select the tip type fitted" "description": "Séléctionner le type de panne utilisé"
} }
} }
} }

View File

@@ -18,7 +18,7 @@
}, },
{ {
"id": "NoPowerDeliveryMessage", "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." "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", "id": "PDNegTimeout",
"maxLen": 8, "maxLen": 8,
"maxLen2": 15, "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." "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", "id": "USBPDMode",
"maxLen": 7, "maxLen": 7,
"maxLen2": 15, "maxLen2": 15,
"include": ["POW_PD"], "include": ["POW_PD", "POW_PD_EXT"],
"description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance" "description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance"
}, },
{ {

View File

@@ -1,7 +1,7 @@
# Default Reference Distro for development env & deploy: # 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>" LABEL maintainer="Ben V. Brown <ralim@ralimtek.com>"
# Default current dir when container starts # Default current dir when container starts

View File

@@ -105,12 +105,12 @@ extern uint32_t SystemCoreClock;
#define configMINIMAL_STACK_SIZE ((uint16_t)256) #define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/ #define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
#define configMAX_TASK_NAME_LEN (32) #define configMAX_TASK_NAME_LEN (32)
#define configUSE_16_BIT_TICKS 0
#define configUSE_MUTEXES 1 #define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8 #define configQUEUE_REGISTRY_SIZE 8
#define configUSE_TIMERS 0 #define configUSE_TIMERS 0
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configCHECK_FOR_STACK_OVERFLOW 2 /*Bump this to 2 during development and bug hunting*/ #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. */ /* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0 #define configUSE_CO_ROUTINES 0
@@ -156,11 +156,11 @@ extern uint32_t SystemCoreClock;
/* Normal assert() semantics without relying on the provision of an assert.h /* Normal assert() semantics without relying on the provision of an assert.h
header file. */ header file. */
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
#define configASSERT(x) \ #define configASSERT(x) \
if ((x) == 0) { \ if ((x) == 0) { \
taskDISABLE_INTERRUPTS(); \ taskDISABLE_INTERRUPTS(); \
for (;;) \ for (;;) \
; \ ; \
} }
/* USER CODE END 1 */ /* USER CODE END 1 */

View File

@@ -153,6 +153,7 @@
#define PROFILE_SUPPORT #define PROFILE_SUPPORT
#define OLED_96x16 1 #define OLED_96x16 1
#define POW_PD 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 POW_PD_EXT 0
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/ #define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define TEMP_NTC #define TEMP_NTC

View File

@@ -105,12 +105,12 @@ extern uint32_t SystemCoreClock;
#define configMINIMAL_STACK_SIZE ((uint16_t)256) #define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/ #define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
#define configMAX_TASK_NAME_LEN (32) #define configMAX_TASK_NAME_LEN (32)
#define configUSE_16_BIT_TICKS 0
#define configUSE_MUTEXES 1 #define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8 #define configQUEUE_REGISTRY_SIZE 8
#define configUSE_TIMERS 0 #define configUSE_TIMERS 0
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configCHECK_FOR_STACK_OVERFLOW 2 /*Bump this to 2 during development and bug hunting*/ #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. */ /* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0 #define configUSE_CO_ROUTINES 0
@@ -156,11 +156,11 @@ extern uint32_t SystemCoreClock;
/* Normal assert() semantics without relying on the provision of an assert.h /* Normal assert() semantics without relying on the provision of an assert.h
header file. */ header file. */
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
#define configASSERT(x) \ #define configASSERT(x) \
if ((x) == 0) { \ if ((x) == 0) { \
taskDISABLE_INTERRUPTS(); \ taskDISABLE_INTERRUPTS(); \
for (;;) \ for (;;) \
; \ ; \
} }
/* USER CODE END 1 */ /* USER CODE END 1 */

View File

@@ -132,6 +132,7 @@
#define ADC_VDD_MV 3300 // ADC max reading millivolts #define ADC_VDD_MV 3300 // ADC max reading millivolts
#define POW_PD_EXT 0 #define POW_PD_EXT 0
#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms
// Deriving the Voltage div: // Deriving the Voltage div:
// Vin_max = (3.3*(r1+r2))/(r2) // Vin_max = (3.3*(r1+r2))/(r2)

View File

@@ -11,6 +11,7 @@
#define configMAX_PRIORITIES (4) #define configMAX_PRIORITIES (4)
#define configMINIMAL_STACK_SIZE ((unsigned short)128) #define configMINIMAL_STACK_SIZE ((unsigned short)128)
#define configMAX_TASK_NAME_LEN 24 #define configMAX_TASK_NAME_LEN 24
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0 #define configIDLE_SHOULD_YIELD 0
#define configUSE_TASK_NOTIFICATIONS 1 #define configUSE_TASK_NOTIFICATIONS 1
#define configUSE_MUTEXES 1 #define configUSE_MUTEXES 1
@@ -21,7 +22,6 @@
#define configUSE_TIME_SLICING 1 #define configUSE_TIME_SLICING 1
#define configUSE_NEWLIB_REENTRANT 0 #define configUSE_NEWLIB_REENTRANT 0
#define configENABLE_BACKWARD_COMPATIBILITY 0 #define configENABLE_BACKWARD_COMPATIBILITY 0
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
#define INCLUDE_uxTaskGetStackHighWaterMark 1 #define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1 #define INCLUDE_xTaskGetSchedulerState 1
@@ -62,11 +62,11 @@
#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
/* Define to trap errors during development. */ /* Define to trap errors during development. */
#define configASSERT(x) \ #define configASSERT(x) \
if ((x) == 0) { \ if ((x) == 0) { \
taskDISABLE_INTERRUPTS(); \ taskDISABLE_INTERRUPTS(); \
for (;;) \ for (;;) \
; \ ; \
} }
#define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_vTaskPrioritySet 1

View File

@@ -149,6 +149,7 @@
#define POW_PD 1 #define POW_PD 1
#define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */ #define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */
#define POW_PD_EXT 0 #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_QC 1
#define POW_DC 1 #define POW_DC 1
#define POW_QC_20V 1 #define POW_QC_20V 1

View File

@@ -17,6 +17,7 @@
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 8) #define configTOTAL_HEAP_SIZE ((size_t)1024 * 8)
#define configMAX_TASK_NAME_LEN (24) #define configMAX_TASK_NAME_LEN (24)
#define configUSE_TRACE_FACILITY 0 #define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0 #define configIDLE_SHOULD_YIELD 0
#define configUSE_MUTEXES 1 #define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8 #define configQUEUE_REGISTRY_SIZE 8
@@ -29,7 +30,6 @@
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configUSE_STATS_FORMATTING_FUNCTIONS 0 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
#define configUSE_TICKLESS_IDLE 0 #define configUSE_TICKLESS_IDLE 0
#define configTICK_TYPE_WIDTH_IN_BITS TICK_TYPE_WIDTH_32_BITS
/* Co-routine definitions. */ /* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0 #define configUSE_CO_ROUTINES 0

View File

@@ -133,8 +133,6 @@ int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_att
memcpy(buf, &temp, sizeof(temp)); memcpy(buf, &temp, sizeof(temp));
return sizeof(temp); return sizeof(temp);
break; break;
default:
break;
} }
MSG((char *)"Unhandled attr read %d | %d\n", (uint32_t)attr->uuid, uuid_value); MSG((char *)"Unhandled attr read %d | %d\n", (uint32_t)attr->uuid, uuid_value);
return 0; return 0;
@@ -152,7 +150,7 @@ int ble_char_read_bulk_value_callback(struct bt_conn *conn, const struct bt_gatt
// Bulk data // Bulk data
{ {
uint32_t bulkData[] = { uint32_t bulkData[] = {
(uint32_t)TipThermoModel::getTipInC(), // 0 - Current temp TipThermoModel::getTipInC(), // 0 - Current temp
getSettingValue(SettingsOptions::SolderingTemp), // 1 - Setpoint getSettingValue(SettingsOptions::SolderingTemp), // 1 - Setpoint
getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0), // 2 - Input voltage getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0), // 2 - Input voltage
getHandleTemperature(0), // 3 - Handle X10 Temp in C 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 getTipResistanceX10(), // 6 - Tip resistance
xTaskGetTickCount() / TICKS_100MS, // 7 - uptime in deciseconds xTaskGetTickCount() / TICKS_100MS, // 7 - uptime in deciseconds
lastMovementTime / TICKS_100MS, // 8 - last movement time (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 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 (uint32_t)currentOperatingMode, // 12 - Operating mode
x10WattHistory.average(), // 13 - Estimated Wattage *10 x10WattHistory.average(), // 13 - Estimated Wattage *10
}; };

View File

@@ -148,6 +148,7 @@
#define POW_PD 1 // Supported features #define POW_PD 1 // Supported features
#define USB_PD_EPR_WATTAGE 140 // USB PD EPR Wattage #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 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_QC 1 // Supported features
#define POW_DC 1 // Supported features #define POW_DC 1 // Supported features
#define POW_QC_20V 1 // Supported features #define POW_QC_20V 1 // Supported features

View File

@@ -126,77 +126,7 @@ void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) {
} }
} }
void unstick_I2C() { 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
}
uint8_t getButtonA() { return HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0; } 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; } uint8_t getButtonB() { return HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ? 1 : 0; }

View File

@@ -105,12 +105,12 @@ extern uint32_t SystemCoreClock;
#define configMINIMAL_STACK_SIZE ((uint16_t)256) #define configMINIMAL_STACK_SIZE ((uint16_t)256)
#define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/ #define configTOTAL_HEAP_SIZE ((size_t)1024 * 14) /*Currently use about 9000*/
#define configMAX_TASK_NAME_LEN (32) #define configMAX_TASK_NAME_LEN (32)
#define configUSE_16_BIT_TICKS 0
#define configUSE_MUTEXES 1 #define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8 #define configQUEUE_REGISTRY_SIZE 8
#define configUSE_TIMERS 0 #define configUSE_TIMERS 0
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configCHECK_FOR_STACK_OVERFLOW 2 /*Bump this to 2 during development and bug hunting*/ #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. */ /* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0 #define configUSE_CO_ROUTINES 0
@@ -156,11 +156,11 @@ extern uint32_t SystemCoreClock;
/* Normal assert() semantics without relying on the provision of an assert.h /* Normal assert() semantics without relying on the provision of an assert.h
header file. */ header file. */
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
#define configASSERT(x) \ #define configASSERT(x) \
if ((x) == 0) { \ if ((x) == 0) { \
taskDISABLE_INTERRUPTS(); \ taskDISABLE_INTERRUPTS(); \
for (;;) \ for (;;) \
; \ ; \
} }
/* USER CODE END 1 */ /* USER CODE END 1 */

View File

@@ -5,8 +5,8 @@
* Author: Ralim * Author: Ralim
*/ */
#ifndef BSP_MINIWARE_PINS_H_ #ifndef BSP_SEQURE_PINS_H_
#define BSP_MINIWARE_PINS_H_ #define BSP_SEQURE_PINS_H_
#include "configuration.h" #include "configuration.h"
#ifdef MODEL_S60 #ifdef MODEL_S60
@@ -65,6 +65,45 @@
#define SCL2_GPIO_Port GPIOB #define SCL2_GPIO_Port GPIOB
#define SDA2_Pin GPIO_PIN_7 #define SDA2_Pin GPIO_PIN_7
#define SDA2_GPIO_Port GPIOB #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 // Pin gets pulled high on movement
#define MOVEMENT_Pin GPIO_PIN_3 #define MOVEMENT_Pin GPIO_PIN_3
#define MOVEMENT_GPIO_Port GPIOA #define MOVEMENT_GPIO_Port GPIOA
@@ -98,4 +137,4 @@
#endif // MODEL_T55 #endif // MODEL_T55
#endif /* BSP_MINIWARE_PINS_H_ */ #endif /* BSP_SEQURE_PINS_H_ */

View File

@@ -1,5 +1,6 @@
#include "BSP.h" #include "BSP.h"
#include "BSP_Power.h" #include "BSP_Power.h"
#include "FS2711.hpp"
#include "Pins.h" #include "Pins.h"
#include "QC3.h" #include "QC3.h"
#include "Settings.h" #include "Settings.h"
@@ -16,9 +17,26 @@ void power_check() {
return; // We are using PD return; // We are using PD
} }
#endif #endif
#if POW_PD_EXT == 2
if (FS2711::has_run_selection()) {
return;
}
#endif
#ifdef POW_QC #ifdef POW_QC
QC_resync(); QC_resync();
#endif #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
}

View File

@@ -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 ## Main abstractions

View File

@@ -5,19 +5,32 @@
* Author: Ralim * Author: Ralim
*/ */
#ifndef BSP_MINIWARE_SOFTWARE_I2C_H_ #ifndef BSP_SEQURE_SOFTWARE_I2C_H_
#define BSP_MINIWARE_SOFTWARE_I2C_H_ #define BSP_SEQURE_SOFTWARE_I2C_H_
#include "BSP.h" #include "BSP.h"
#include "configuration.h" #include "configuration.h"
#include "stm32f1xx_hal.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_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_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_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_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_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) #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 // clang-format off
#define SOFT_I2C_DELAY() \ #define SOFT_I2C_DELAY() \
{ \ { \
@@ -27,7 +40,6 @@
} }
// clang-format on // clang-format on
#endif
// 40 ~= 100kHz; 15 gives around 250kHz or so which is fast _and_ stable // 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_ */

View File

@@ -83,3 +83,10 @@ TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) {
#ifdef TEMP_uV_LOOKUP_S60 #ifdef TEMP_uV_LOOKUP_S60
TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; } TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; }
#endif // TEMP_uV_LOOKUP_S60 #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

View File

@@ -116,7 +116,7 @@
// Vin_max = (3.3*(r1+r2))/(r2) // Vin_max = (3.3*(r1+r2))/(r2)
// vdiv = (32768*4)/(vin_max*10) // 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!" #error "No model defined!"
#endif #endif
@@ -131,9 +131,10 @@
#define POWER_LIMIT_STEPS 5 #define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE 536 #define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60 #define TEMP_uV_LOOKUP_S60
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate #define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define THERMAL_RUNAWAY_TIME_SEC 20 #define THERMAL_RUNAWAY_TIME_SEC 20
#define THERMAL_RUNAWAY_TEMP_C 3 #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 #define HARDWARE_MAX_WATTAGE_X10 600
@@ -165,9 +166,10 @@
#define POWER_LIMIT_STEPS 5 #define POWER_LIMIT_STEPS 5
#define OP_AMP_GAIN_STAGE 536 #define OP_AMP_GAIN_STAGE 536
#define TEMP_uV_LOOKUP_S60 #define TEMP_uV_LOOKUP_S60
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate #define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define THERMAL_RUNAWAY_TIME_SEC 20 #define THERMAL_RUNAWAY_TIME_SEC 20
#define THERMAL_RUNAWAY_TEMP_C 3 #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 #define HARDWARE_MAX_WATTAGE_X10 600
@@ -180,10 +182,13 @@
#define GPIO_VIBRATION #define GPIO_VIBRATION
#define POW_PD_EXT 2 #define POW_PD_EXT 2
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/ #define USB_PD_EPR_WATTAGE 0 /*No EPR*/
#define POW_DC
#define DEBUG_POWER_MENU_BUTTON_B 1 #define DEBUG_POWER_MENU_BUTTON_B 1
#define HAS_POWER_DEBUG_MENU #define HAS_POWER_DEBUG_MENU
#define TEMP_NTC #define TEMP_NTC
#define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues #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 OLED_I2CBB2
#define FILTER_DISPLAYED_TIP_TEMP 4 // Filtering for GUI display #define FILTER_DISPLAYED_TIP_TEMP 4 // Filtering for GUI display
@@ -206,6 +211,8 @@
#define OP_AMP_GAIN_STAGE 1 #define OP_AMP_GAIN_STAGE 1
#define TEMP_uV_LOOKUP_PT1000 #define TEMP_uV_LOOKUP_PT1000
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate #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 NO_DISPLAY_ROTATE // Disable OLED rotation by accel
#define MAX_TEMP_C 350 // Max soldering temp selectable °C #define MAX_TEMP_C 350 // Max soldering temp selectable °C
#define MAX_TEMP_F 660 // Max soldering temp selectable °F #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 #define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place
#endif /* T55 */ #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 FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))

View File

@@ -6,10 +6,14 @@
*/ */
#include "BSP.h" #include "BSP.h"
#include "I2CBB1.hpp"
#include "I2CBB2.hpp" #include "I2CBB2.hpp"
#include "Pins.h" #include "Pins.h"
#include "Setup.h" #include "Setup.h"
#include <I2C_Wrapper.hpp> #include <I2C_Wrapper.hpp>
#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2
#include "FS2711.hpp"
#endif
void preRToSInit() { void preRToSInit() {
/* Reset of all peripherals, Initializes the Flash interface and the Systick. /* Reset of all peripherals, Initializes the Flash interface and the Systick.
@@ -17,7 +21,14 @@ void preRToSInit() {
HAL_Init(); HAL_Init();
Setup_HAL(); // Setup all the HAL objects Setup_HAL(); // Setup all the HAL objects
BSPInit(); BSPInit();
#ifdef I2C_SOFT_BUS_1
I2CBB1::init();
#endif /* I2C_SOFT_BUS_1 */
#ifdef I2C_SOFT_BUS_2 #ifdef I2C_SOFT_BUS_2
I2CBB2::init(); 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 */
} }

View File

@@ -4,8 +4,10 @@
#include "BSP.h" #include "BSP.h"
#include "FS2711.hpp" #include "FS2711.hpp"
#include "FS2711_defines.h" #include "FS2711_defines.h"
#include "I2CBB1.hpp"
#include "I2CBB2.hpp" #include "I2CBB2.hpp"
#include "Settings.h" #include "Settings.h"
#include "Utils.h"
#include "cmsis_os.h" #include "cmsis_os.h"
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
@@ -15,31 +17,61 @@
#error Max PD Voltage must be defined #error Max PD Voltage must be defined
#endif #endif
#define PROTOCOL_TIMEOUT 100 // ms
extern int32_t powerSupplyWattageLimit; extern int32_t powerSupplyWattageLimit;
uint8_t I2C_PORT = 2;
fs2711_state_t FS2711::state; 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; uint8_t data = 0;
I2CBB2::Mem_Read(FS2711_ADDR, addr, &data, 1); 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; 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() { void FS2711::start() {
memset(&state, 0, sizeof(fs2711_state_t)); memset(&state, 0, sizeof(fs2711_state_t));
state.req_pdo_num = 0xFF; state.req_pdo_num = 0xFF;
enable_protocol(false); enable_protocol(false);
osDelay(PROTOCOL_TIMEOUT); // PDNegTimeout is in 100ms, so x100 for ms
osDelay(getSettingValue(SettingsOptions::PDNegTimeout) * 100);
select_protocol(FS2711_PROTOCOL_PD); select_protocol(FS2711_PROTOCOL_PD);
enable_protocol(true); enable_protocol(true);
osDelay(PROTOCOL_TIMEOUT); osDelay(getSettingValue(SettingsOptions::PDNegTimeout) * 100);
} }
uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); } 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) { if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
tip_resistance += 5; 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; 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; } 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::source_currentx100() { return state.source_current / 10; }
uint16_t FS2711::debug_pdo_max_voltage(uint8_t pdoid) { return state.pdo_max_volt[pdoid]; } uint16_t FS2711::debug_pdo_max_voltage(uint8_t pdoid) { return state.pdo_max_volt[pdoid]; }

View File

@@ -19,6 +19,8 @@ typedef struct {
class FS2711 { class FS2711 {
public: public:
static uint8_t detect_i2c_bus_num();
static bool probe(); static bool probe();
static void start(); static void start();

View File

@@ -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, 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}; 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) || defined(MODEL_TS101) || defined(MODEL_T55) || defined(MODEL_S99)
#if defined(MODEL_S60) || defined(MODEL_S60P) #if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_S99)
const uint8_t buttonA[] = { const uint8_t buttonA[] = {
// width = 56 // width = 56
// height = 32 // height = 32

View File

@@ -14,6 +14,7 @@ void I2CBB2::init() {
// Set GPIO's to output open drain // Set GPIO's to output open drain
GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitTypeDef GPIO_InitStruct;
__HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
GPIO_InitStruct.Pin = SDA2_Pin; GPIO_InitStruct.Pin = SDA2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;

View File

@@ -54,7 +54,7 @@ typedef struct {
} SettingConstants; } SettingConstants;
static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOptionsLength] = { static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOptionsLength] = {
//{ min, max, increment, default} //{ min, max, increment, default}
{ MIN_TEMP_C, MAX_TEMP_F, 5, SOLDERING_TEMP}, // SolderingTemp { MIN_TEMP_C, MAX_TEMP_F, 5, SOLDERING_TEMP}, // SolderingTemp
{ MIN_TEMP_C, MAX_TEMP_F, 5, 150}, // SleepTemp { MIN_TEMP_C, MAX_TEMP_F, 5, 150}, // SleepTemp
{ 0, 15, 1, SLEEP_TIME}, // SleepTime { 0, 15, 1, SLEEP_TIME}, // SleepTime
@@ -87,7 +87,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
{ 0, 9, 1, 0}, // AccelMissingWarningCounter { 0, 9, 1, 0}, // AccelMissingWarningCounter
{ 0, 9, 1, 0}, // PDMissingWarningCounter { 0, 9, 1, 0}, // PDMissingWarningCounter
{ 0, 0xFFFF, 0, 41431 /*EN*/}, // UILanguage { 0, 0xFFFF, 0, 41431 /*EN*/}, // UILanguage
{ 0, 50, 1, 20}, // PDNegTimeout { 0, 50, 1, USB_PD_TIMEOUT}, // PDNegTimeout
{ 0, 1, 1, 0}, // OLEDInversion { 0, 1, 1, 0}, // OLEDInversion
{ MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness { MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness
{ 0, 6, 1, 1}, // LOGOTime { 0, 6, 1, 1}, // LOGOTime

View File

@@ -26,7 +26,7 @@ static void displayInputMinVRange(void);
static void displayQCInputV(void); static void displayQCInputV(void);
#endif /* POW_QC */ #endif /* POW_QC */
#ifdef POW_PD #if defined(POW_PD) || POW_PD_EXT == 2
static void displayPDNegTimeout(void); static void displayPDNegTimeout(void);
static void displayUSBPDMode(void); static void displayUSBPDMode(void);
#endif /* POW_PD */ #endif /* POW_PD */
@@ -123,9 +123,9 @@ static bool showSolderingTipType(void);
// Menu functions // 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); 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 displaySolderingMenu(void);
static void displayPowerSavingMenu(void); static void displayPowerSavingMenu(void);
@@ -236,7 +236,7 @@ const menuitem rootSettingsMenu[] {
/* ^^^^ end of menu marker. DO NOT REMOVE ^^^^ */ /* ^^^^ 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[] = { const menuitem powerMenu[] = {
/* /*
* Power Source * Power Source
@@ -255,7 +255,7 @@ const menuitem powerMenu[] = {
/* Voltage input */ /* Voltage input */
{SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), nullptr, displayQCInputV, nullptr, SettingsOptions::QCIdealVoltage, SettingsItemIndex::QCMaxVoltage, 4}, {SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), nullptr, displayQCInputV, nullptr, SettingsOptions::QCIdealVoltage, SettingsItemIndex::QCMaxVoltage, 4},
#endif #endif
#ifdef POW_PD #if defined(POW_PD) || POW_PD_EXT == 2
/* PD timeout setup */ /* PD timeout setup */
{SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 6}, {SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 6},
/* Toggle PPS & EPR */ /* Toggle PPS & EPR */
@@ -451,7 +451,7 @@ const menuitem advancedMenu[] = {
/* clang-format on */ /* clang-format on */
const menuitem *subSettingsMenus[] { 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, powerMenu,
#endif #endif
solderingMenu, PowerSavingMenu, UIMenu, advancedMenu, solderingMenu, PowerSavingMenu, UIMenu, advancedMenu,
@@ -536,7 +536,7 @@ static void displayQCInputV(void) {
#endif /* POW_QC */ #endif /* POW_QC */
#ifdef POW_PD /* POW_PD */ #if defined(POW_PD) || POW_PD_EXT == 2 /* POW_PD */
static void displayPDNegTimeout(void) { static void displayPDNegTimeout(void) {
auto value = getSettingValue(SettingsOptions::PDNegTimeout); auto value = getSettingValue(SettingsOptions::PDNegTimeout);

View File

@@ -23,6 +23,10 @@ extern "C" {
#include "USBPD.h" #include "USBPD.h"
#include "pd.h" #include "pd.h"
#endif #endif
#if POW_PD_EXT == 2
#include "FS2711.hpp"
#include "FS2711_defines.h"
#endif
enum class OperatingMode { enum class OperatingMode {
StartupLogo=10, // Showing the startup logo StartupLogo=10, // Showing the startup logo

View File

@@ -63,6 +63,13 @@ int8_t getPowerSourceNumber(void) {
#endif #endif
} }
} }
#endif
#if POW_PD_EXT == 2
if (FS2711::has_run_selection()) {
poweredbyPD = true;
// FS2711IC has VBUS always connected
pdHasVBUSConnected = true;
}
#endif #endif
if (poweredbyPD) { if (poweredbyPD) {
if (pdHasVBUSConnected) { if (pdHasVBUSConnected) {

View File

@@ -6,7 +6,7 @@ ALL_MINIWARE_MODELS=TS100 TS80 TS80P TS101
ALL_PINECIL_MODELS=Pinecil ALL_PINECIL_MODELS=Pinecil
ALL_PINECIL_V2_MODELS=Pinecilv2 ALL_PINECIL_V2_MODELS=Pinecilv2
ALL_MHP30_MODELS=MHP30 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) ALL_MODELS=$(ALL_MINIWARE_MODELS) $(ALL_PINECIL_MODELS) $(ALL_MHP30_MODELS) $(ALL_PINECIL_V2_MODELS) $(ALL_SEQURE_MODELS)
ifneq ($(model),$(filter $(model),$(ALL_MODELS))) ifneq ($(model),$(filter $(model),$(ALL_MODELS)))
@@ -145,6 +145,9 @@ flash_size=62k
ifeq ($(model), S60P) ifeq ($(model), S60P)
bootldr_size=0x5000 bootldr_size=0x5000
DEVICE_DFU_ADDRESS=0x08005000 DEVICE_DFU_ADDRESS=0x08005000
else ifeq ($(model), S99)
bootldr_size=0x4c00
DEVICE_DFU_ADDRESS=0x08004c00
else else
# S60 or T55 # S60 or T55
bootldr_size=0x4400 bootldr_size=0x4400

File diff suppressed because it is too large Load Diff

View File

@@ -1,405 +1,361 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ #include "FreeRTOS.h"
#include "task.h"
#include "FreeRTOS.h" #include "croutine.h"
#include "task.h"
#include "croutine.h" /* Remove the whole file is co-routines are not being used. */
#if ( configUSE_CO_ROUTINES != 0 )
/* Remove the whole file if co-routines are not being used. */
#if ( configUSE_CO_ROUTINES != 0 ) /*
* Some kernel aware debuggers require data to be viewed to be global, rather
/* * than file scope.
* Some kernel aware debuggers require data to be viewed to be global, rather */
* than file scope. #ifdef portREMOVE_STATIC_QUALIFIER
*/ #define static
#ifdef portREMOVE_STATIC_QUALIFIER #endif
#define static
#endif
/* Lists for ready and blocked co-routines. --------------------*/
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /*< Prioritised ready co-routines. */
/* Lists for ready and blocked co-routines. --------------------*/ static List_t xDelayedCoRoutineList1; /*< Delayed co-routines. */
static List_t pxReadyCoRoutineLists[ configMAX_CO_ROUTINE_PRIORITIES ]; /**< Prioritised ready 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 xDelayedCoRoutineList1; /**< Delayed co-routines. */ static List_t * pxDelayedCoRoutineList = NULL; /*< Points to the delayed co-routine list currently being used. */
static List_t xDelayedCoRoutineList2; /**< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */ 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 * pxDelayedCoRoutineList = NULL; /**< Points to the delayed co-routine list currently being used. */ 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 * 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;
/* Other file private variables. --------------------------------*/ static UBaseType_t uxTopCoRoutineReadyPriority = 0;
CRCB_t * pxCurrentCoRoutine = NULL; static TickType_t xCoRoutineTickCount = 0, xLastTickCount = 0, xPassedTicks = 0;
static UBaseType_t uxTopCoRoutineReadyPriority = ( UBaseType_t ) 0U;
static TickType_t xCoRoutineTickCount = ( TickType_t ) 0U; /* The initial state of the co-routine when it is created. */
static TickType_t xLastTickCount = ( TickType_t ) 0U; #define corINITIAL_STATE ( 0 )
static TickType_t xPassedTicks = ( TickType_t ) 0U;
/*
/* The initial state of the co-routine when it is created. */ * Place the co-routine represented by pxCRCB into the appropriate ready queue
#define corINITIAL_STATE ( 0 ) * for the priority. It is inserted at the end of the list.
*
/* * This macro accesses the co-routine ready lists and therefore must not be
* Place the co-routine represented by pxCRCB into the appropriate ready queue * used from within an ISR.
* for the priority. It is inserted at the end of the list. */
* #define prvAddCoRoutineToReadyQueue( pxCRCB ) \
* This macro accesses the co-routine ready lists and therefore must not be { \
* used from within an ISR. if( pxCRCB->uxPriority > uxTopCoRoutineReadyPriority ) \
*/ { \
#define prvAddCoRoutineToReadyQueue( pxCRCB ) \ uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \
do { \ } \
if( ( pxCRCB )->uxPriority > uxTopCoRoutineReadyPriority ) \ vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \
{ \ }
uxTopCoRoutineReadyPriority = ( pxCRCB )->uxPriority; \
} \ /*
vListInsertEnd( ( List_t * ) &( pxReadyCoRoutineLists[ ( pxCRCB )->uxPriority ] ), &( ( pxCRCB )->xGenericListItem ) ); \ * Utility to ready all the lists used by the scheduler. This is called
} while( 0 ) * automatically upon the creation of the first co-routine.
*/
/* static void prvInitialiseCoRoutineLists( void );
* Utility to ready all the lists used by the scheduler. This is called
* automatically upon the creation of the first co-routine. /*
*/ * Co-routines that are readied by an interrupt cannot be placed directly into
static void prvInitialiseCoRoutineLists( void ); * the ready lists (there is no mutual exclusion). Instead they are placed in
* in the pending ready list in order that they can later be moved to the ready
/* * list by the co-routine scheduler.
* Co-routines that are readied by an interrupt cannot be placed directly into */
* the ready lists (there is no mutual exclusion). Instead they are placed in static void prvCheckPendingReadyList( void );
* in the pending ready list in order that they can later be moved to the ready
* list by the co-routine scheduler. /*
*/ * Macro that looks at the list of co-routines that are currently delayed to
static void prvCheckPendingReadyList( void ); * see if any require waking.
*
/* * Co-routines are stored in the queue in the order of their wake time -
* Macro that looks at the list of co-routines that are currently delayed to * meaning once one co-routine has been found whose timer has not expired
* see if any require waking. * we need not look any further down the list.
* */
* Co-routines are stored in the queue in the order of their wake time - static void prvCheckDelayedList( void );
* meaning once one co-routine has been found whose timer has not expired
* we need not look any further down the list. /*-----------------------------------------------------------*/
*/
static void prvCheckDelayedList( void ); BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
UBaseType_t uxPriority,
/*-----------------------------------------------------------*/ UBaseType_t uxIndex )
{
BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, BaseType_t xReturn;
UBaseType_t uxPriority, CRCB_t * pxCoRoutine;
UBaseType_t uxIndex )
{ /* Allocate the memory that will store the co-routine control block. */
BaseType_t xReturn; pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) );
CRCB_t * pxCoRoutine;
if( pxCoRoutine )
traceENTER_xCoRoutineCreate( pxCoRoutineCode, uxPriority, uxIndex ); {
/* If pxCurrentCoRoutine is NULL then this is the first co-routine to
/* Allocate the memory that will store the co-routine control block. */ * be created and the co-routine data structures need initialising. */
/* MISRA Ref 11.5.1 [Malloc memory assignment] */ if( pxCurrentCoRoutine == NULL )
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */ {
/* coverity[misra_c_2012_rule_11_5_violation] */ pxCurrentCoRoutine = pxCoRoutine;
pxCoRoutine = ( CRCB_t * ) pvPortMalloc( sizeof( CRCB_t ) ); prvInitialiseCoRoutineLists();
}
if( pxCoRoutine )
{ /* Check the priority is within limits. */
/* If pxCurrentCoRoutine is NULL then this is the first co-routine to if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES )
* be created and the co-routine data structures need initialising. */ {
if( pxCurrentCoRoutine == NULL ) uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1;
{ }
pxCurrentCoRoutine = pxCoRoutine;
prvInitialiseCoRoutineLists(); /* Fill out the co-routine control block from the function parameters. */
} pxCoRoutine->uxState = corINITIAL_STATE;
pxCoRoutine->uxPriority = uxPriority;
/* Check the priority is within limits. */ pxCoRoutine->uxIndex = uxIndex;
if( uxPriority >= configMAX_CO_ROUTINE_PRIORITIES ) pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode;
{
uxPriority = configMAX_CO_ROUTINE_PRIORITIES - 1; /* Initialise all the other co-routine control block parameters. */
} vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );
vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );
/* Fill out the co-routine control block from the function parameters. */
pxCoRoutine->uxState = corINITIAL_STATE; /* Set the co-routine control block as a link back from the ListItem_t.
pxCoRoutine->uxPriority = uxPriority; * This is so we can get back to the containing CRCB from a generic item
pxCoRoutine->uxIndex = uxIndex; * in a list. */
pxCoRoutine->pxCoRoutineFunction = pxCoRoutineCode; listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );
/* Initialise all the other co-routine control block parameters. */
vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) ); /* Event lists are always in priority order. */
vListInitialiseItem( &( pxCoRoutine->xEventListItem ) ); listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) );
/* Set the co-routine control block as a link back from the ListItem_t. /* Now the co-routine has been initialised it can be added to the ready
* This is so we can get back to the containing CRCB from a generic item * list at the correct priority. */
* in a list. */ prvAddCoRoutineToReadyQueue( pxCoRoutine );
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine ); xReturn = pdPASS;
}
/* Event lists are always in priority order. */ else
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), ( ( TickType_t ) configMAX_CO_ROUTINE_PRIORITIES - ( TickType_t ) uxPriority ) ); {
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
/* Now the co-routine has been initialised it can be added to the ready }
* list at the correct priority. */
prvAddCoRoutineToReadyQueue( pxCoRoutine ); return xReturn;
}
xReturn = pdPASS; /*-----------------------------------------------------------*/
}
else void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
{ List_t * pxEventList )
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY; {
} TickType_t xTimeToWake;
traceRETURN_xCoRoutineCreate( xReturn ); /* Calculate the time to wake - this may overflow but this is
* not a problem. */
return xReturn; xTimeToWake = xCoRoutineTickCount + xTicksToDelay;
}
/*-----------------------------------------------------------*/ /* We must remove ourselves from the ready list before adding
* ourselves to the blocked list as the same list item is used for
void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay, * both lists. */
List_t * pxEventList ) ( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
{
TickType_t xTimeToWake; /* The list item will be inserted in wake time order. */
listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake );
traceENTER_vCoRoutineAddToDelayedList( xTicksToDelay, pxEventList );
if( xTimeToWake < xCoRoutineTickCount )
/* Calculate the time to wake - this may overflow but this is {
* not a problem. */ /* Wake time has overflowed. Place this item in the
xTimeToWake = xCoRoutineTickCount + xTicksToDelay; * overflow list. */
vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
/* We must remove ourselves from the ready list before adding }
* ourselves to the blocked list as the same list item is used for else
* both lists. */ {
( void ) uxListRemove( ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); /* The wake time has not overflowed, so we can use the
* current block list. */
/* The list item will be inserted in wake time order. */ vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) );
listSET_LIST_ITEM_VALUE( &( pxCurrentCoRoutine->xGenericListItem ), xTimeToWake ); }
if( xTimeToWake < xCoRoutineTickCount ) if( pxEventList )
{ {
/* Wake time has overflowed. Place this item in the /* Also add the co-routine to an event list. If this is done then the
* overflow list. */ * function must be called with interrupts disabled. */
vListInsert( ( List_t * ) pxOverflowDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
} }
else }
{ /*-----------------------------------------------------------*/
/* The wake time has not overflowed, so we can use the
* current block list. */ static void prvCheckPendingReadyList( void )
vListInsert( ( List_t * ) pxDelayedCoRoutineList, ( ListItem_t * ) &( pxCurrentCoRoutine->xGenericListItem ) ); {
} /* Are there any co-routines waiting to get moved to the ready list? These
* are co-routines that have been readied by an ISR. The ISR cannot access
if( pxEventList ) * the ready lists itself. */
{ while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE )
/* Also add the co-routine to an event list. If this is done then the {
* function must be called with interrupts disabled. */ CRCB_t * pxUnblockedCRCB;
vListInsert( pxEventList, &( pxCurrentCoRoutine->xEventListItem ) );
} /* The pending ready list can be accessed by an ISR. */
portDISABLE_INTERRUPTS();
traceRETURN_vCoRoutineAddToDelayedList(); {
} pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyCoRoutineList ) );
/*-----------------------------------------------------------*/ ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
}
static void prvCheckPendingReadyList( void ) portENABLE_INTERRUPTS();
{
/* Are there any co-routines waiting to get moved to the ready list? These ( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );
* are co-routines that have been readied by an ISR. The ISR cannot access prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );
* the ready lists itself. */ }
while( listLIST_IS_EMPTY( &xPendingReadyCoRoutineList ) == pdFALSE ) }
{ /*-----------------------------------------------------------*/
CRCB_t * pxUnblockedCRCB;
static void prvCheckDelayedList( void )
/* The pending ready list can be accessed by an ISR. */ {
portDISABLE_INTERRUPTS(); CRCB_t * pxCRCB;
{
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyCoRoutineList ) ); xPassedTicks = xTaskGetTickCount() - xLastTickCount;
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
} while( xPassedTicks )
portENABLE_INTERRUPTS(); {
xCoRoutineTickCount++;
( void ) uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) ); xPassedTicks--;
prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );
} /* If the tick count has overflowed we need to swap the ready lists. */
} if( xCoRoutineTickCount == 0 )
/*-----------------------------------------------------------*/ {
List_t * pxTemp;
static void prvCheckDelayedList( void )
{ /* Tick count has overflowed so we need to swap the delay lists. If there are
CRCB_t * pxCRCB; * any items in pxDelayedCoRoutineList here then there is an error! */
pxTemp = pxDelayedCoRoutineList;
xPassedTicks = xTaskGetTickCount() - xLastTickCount; pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList;
pxOverflowDelayedCoRoutineList = pxTemp;
while( xPassedTicks ) }
{
xCoRoutineTickCount++; /* See if this tick has made a timeout expire. */
xPassedTicks--; while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE )
{
/* If the tick count has overflowed we need to swap the ready lists. */ pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );
if( xCoRoutineTickCount == 0 )
{ if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )
List_t * pxTemp; {
/* Timeout not yet expired. */
/* Tick count has overflowed so we need to swap the delay lists. If there are break;
* any items in pxDelayedCoRoutineList here then there is an error! */ }
pxTemp = pxDelayedCoRoutineList;
pxDelayedCoRoutineList = pxOverflowDelayedCoRoutineList; portDISABLE_INTERRUPTS();
pxOverflowDelayedCoRoutineList = pxTemp; {
} /* The event could have occurred just before this critical
* section. If this is the case then the generic list item will
/* See if this tick has made a timeout expire. */ * have been moved to the pending ready list and the following
while( listLIST_IS_EMPTY( pxDelayedCoRoutineList ) == pdFALSE ) * line is still valid. Also the pvContainer parameter will have
{ * been set to NULL so the following lines are also valid. */
pxCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList ); ( void ) uxListRemove( &( pxCRCB->xGenericListItem ) );
if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) ) /* Is the co-routine waiting on an event also? */
{ if( pxCRCB->xEventListItem.pxContainer )
/* Timeout not yet expired. */ {
break; ( void ) uxListRemove( &( pxCRCB->xEventListItem ) );
} }
}
portDISABLE_INTERRUPTS(); portENABLE_INTERRUPTS();
{
/* The event could have occurred just before this critical prvAddCoRoutineToReadyQueue( pxCRCB );
* section. If this is the case then the generic list item will }
* have been moved to the pending ready list and the following }
* line is still valid. Also the pvContainer parameter will have
* been set to NULL so the following lines are also valid. */ xLastTickCount = xCoRoutineTickCount;
( void ) uxListRemove( &( pxCRCB->xGenericListItem ) ); }
/*-----------------------------------------------------------*/
/* Is the co-routine waiting on an event also? */
if( pxCRCB->xEventListItem.pxContainer ) void vCoRoutineSchedule( void )
{ {
( void ) uxListRemove( &( pxCRCB->xEventListItem ) ); /* Only run a co-routine after prvInitialiseCoRoutineLists() has been
} * called. prvInitialiseCoRoutineLists() is called automatically when a
} * co-routine is created. */
portENABLE_INTERRUPTS(); if( pxDelayedCoRoutineList != NULL )
{
prvAddCoRoutineToReadyQueue( pxCRCB ); /* See if any co-routines readied by events need moving to the ready lists. */
} prvCheckPendingReadyList();
}
/* See if any delayed co-routines have timed out. */
xLastTickCount = xCoRoutineTickCount; prvCheckDelayedList();
}
/*-----------------------------------------------------------*/ /* Find the highest priority queue that contains ready co-routines. */
while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) )
void vCoRoutineSchedule( void ) {
{ if( uxTopCoRoutineReadyPriority == 0 )
traceENTER_vCoRoutineSchedule(); {
/* No more co-routines to check. */
/* Only run a co-routine after prvInitialiseCoRoutineLists() has been return;
* called. prvInitialiseCoRoutineLists() is called automatically when a }
* co-routine is created. */
if( pxDelayedCoRoutineList != NULL ) --uxTopCoRoutineReadyPriority;
{ }
/* See if any co-routines readied by events need moving to the ready lists. */
prvCheckPendingReadyList(); /* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines
* of the same priority get an equal share of the processor time. */
/* See if any delayed co-routines have timed out. */ listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) );
prvCheckDelayedList();
/* Call the co-routine. */
/* Find the highest priority queue that contains ready co-routines. */ ( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
while( listLIST_IS_EMPTY( &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ) ) }
{ }
if( uxTopCoRoutineReadyPriority == 0 ) /*-----------------------------------------------------------*/
{
/* No more co-routines to check. */ static void prvInitialiseCoRoutineLists( void )
return; {
} UBaseType_t uxPriority;
--uxTopCoRoutineReadyPriority; for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ )
} {
vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) );
/* listGET_OWNER_OF_NEXT_ENTRY walks through the list, so the co-routines }
* of the same priority get an equal share of the processor time. */
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentCoRoutine, &( pxReadyCoRoutineLists[ uxTopCoRoutineReadyPriority ] ) ); vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 );
vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 );
/* Call the co-routine. */ vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList );
( pxCurrentCoRoutine->pxCoRoutineFunction )( pxCurrentCoRoutine, pxCurrentCoRoutine->uxIndex );
} /* Start with pxDelayedCoRoutineList using list1 and the
* pxOverflowDelayedCoRoutineList using list2. */
traceRETURN_vCoRoutineSchedule(); pxDelayedCoRoutineList = &xDelayedCoRoutineList1;
} pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;
/*-----------------------------------------------------------*/ }
/*-----------------------------------------------------------*/
static void prvInitialiseCoRoutineLists( void )
{ BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList )
UBaseType_t uxPriority; {
CRCB_t * pxUnblockedCRCB;
for( uxPriority = 0; uxPriority < configMAX_CO_ROUTINE_PRIORITIES; uxPriority++ ) BaseType_t xReturn;
{
vListInitialise( ( List_t * ) &( pxReadyCoRoutineLists[ uxPriority ] ) ); /* 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. */
vListInitialise( ( List_t * ) &xDelayedCoRoutineList1 ); pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
vListInitialise( ( List_t * ) &xDelayedCoRoutineList2 ); ( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
vListInitialise( ( List_t * ) &xPendingReadyCoRoutineList ); vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );
/* Start with pxDelayedCoRoutineList using list1 and the if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
* pxOverflowDelayedCoRoutineList using list2. */ {
pxDelayedCoRoutineList = &xDelayedCoRoutineList1; xReturn = pdTRUE;
pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2; }
} else
/*-----------------------------------------------------------*/ {
xReturn = pdFALSE;
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList ) }
{
CRCB_t * pxUnblockedCRCB; return xReturn;
BaseType_t xReturn; }
traceENTER_xCoRoutineRemoveFromEventList( pxEventList ); #endif /* configUSE_CO_ROUTINES == 0 */
/* 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. */
pxUnblockedCRCB = ( CRCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxEventList );
( void ) uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );
vListInsertEnd( ( List_t * ) &( xPendingReadyCoRoutineList ), &( pxUnblockedCRCB->xEventListItem ) );
if( pxUnblockedCRCB->uxPriority >= pxCurrentCoRoutine->uxPriority )
{
xReturn = pdTRUE;
}
else
{
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 */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,34 +1,32 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/
#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 future released.
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */ #endif
#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.
#endif #include "stack_macros.h"
#include "stack_macros.h"

View File

@@ -1,427 +1,417 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ /**
* @file atomic.h
/** * @brief FreeRTOS atomic operation support.
* @file atomic.h *
* @brief FreeRTOS atomic operation support. * This file implements atomic functions by disabling interrupts globally.
* * Implementations with architecture specific atomic instructions can be
* This file implements atomic functions by disabling interrupts globally. * provided under each compiler directory.
* Implementations with architecture specific atomic instructions can be */
* provided under each compiler directory.
* #ifndef ATOMIC_H
* The atomic interface can be used in FreeRTOS tasks on all FreeRTOS ports. It #define ATOMIC_H
* 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 #ifndef INC_FREERTOS_H
* atomic interface must not be used in ISRs on FreeRTOS ports that do not #error "include FreeRTOS.h must appear in source files before include atomic.h"
* support nested interrupts (i.e. portHAS_NESTED_INTERRUPTS is set to 0) #endif
* because ISRs on these ports cannot be interrupted and therefore, do not need
* atomics in ISRs. /* Standard includes. */
*/ #include <stdint.h>
#ifndef ATOMIC_H /* *INDENT-OFF* */
#define ATOMIC_H #ifdef __cplusplus
extern "C" {
#ifndef INC_FREERTOS_H #endif
#error "include FreeRTOS.h must appear in source files before include atomic.h" /* *INDENT-ON* */
#endif
/*
/* Standard includes. */ * Port specific definitions -- entering/exiting critical section.
#include <stdint.h> * Refer template -- ./lib/FreeRTOS/portable/Compiler/Arch/portmacro.h
*
/* *INDENT-OFF* */ * Every call to ATOMIC_EXIT_CRITICAL() must be closely paired with
#ifdef __cplusplus * ATOMIC_ENTER_CRITICAL().
extern "C" { *
#endif */
/* *INDENT-ON* */ #if defined( portSET_INTERRUPT_MASK_FROM_ISR )
/* /* Nested interrupt scheme is supported in this port. */
* Port specific definitions -- entering/exiting critical section. #define ATOMIC_ENTER_CRITICAL() \
* Refer template -- ./lib/FreeRTOS/portable/Compiler/Arch/portmacro.h UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
*
* Every call to ATOMIC_EXIT_CRITICAL() must be closely paired with #define ATOMIC_EXIT_CRITICAL() \
* ATOMIC_ENTER_CRITICAL(). portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType )
*
*/ #else
#if ( portHAS_NESTED_INTERRUPTS == 1 )
/* Nested interrupt scheme is NOT supported in this port. */
/* Nested interrupt scheme is supported in this port. */ #define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL()
#define ATOMIC_ENTER_CRITICAL() \ #define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL()
UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */
#define ATOMIC_EXIT_CRITICAL() \
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType ) /*
* Port specific definition -- "always inline".
#else * Inline is compiler specific, and may not always get inlined depending on your
* optimization level. Also, inline is considered as performance optimization
/* Nested interrupt scheme is NOT supported in this port. */ * for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h,
#define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL() * instead of resulting error, simply define it away.
#define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL() */
#ifndef portFORCE_INLINE
#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */ #define portFORCE_INLINE
#endif
/*
* Port specific definition -- "always inline". #define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */
* Inline is compiler specific, and may not always get inlined depending on your #define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */
* optimization level. Also, inline is considered as performance optimization
* for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h, /*----------------------------- Swap && CAS ------------------------------*/
* instead of resulting error, simply define it away.
*/ /**
#ifndef portFORCE_INLINE * Atomic compare-and-swap
#define portFORCE_INLINE *
#endif * @brief Performs an atomic compare-and-swap operation on the specified values.
*
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */ * @param[in, out] pulDestination Pointer to memory location from where value is
#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */ * to be loaded and checked.
* @param[in] ulExchange If condition meets, write this value to memory.
/*----------------------------- Swap && CAS ------------------------------*/ * @param[in] ulComparand Swap condition.
*
/** * @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
* Atomic compare-and-swap *
* * @note This function only swaps *pulDestination with ulExchange, if previous
* @brief Performs an atomic compare-and-swap operation on the specified values. * *pulDestination value equals ulComparand.
* */
* @param[in, out] pulDestination Pointer to memory location from where value is static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination,
* to be loaded and checked. uint32_t ulExchange,
* @param[in] ulExchange If condition meets, write this value to memory. uint32_t ulComparand )
* @param[in] ulComparand Swap condition. {
* uint32_t ulReturnValue;
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
* ATOMIC_ENTER_CRITICAL();
* @note This function only swaps *pulDestination with ulExchange, if previous {
* *pulDestination value equals ulComparand. if( *pulDestination == ulComparand )
*/ {
static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination, *pulDestination = ulExchange;
uint32_t ulExchange, ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
uint32_t ulComparand ) }
{ else
uint32_t ulReturnValue; {
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
ATOMIC_ENTER_CRITICAL(); }
{ }
if( *pulDestination == ulComparand ) ATOMIC_EXIT_CRITICAL();
{
*pulDestination = ulExchange; return ulReturnValue;
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS; }
} /*-----------------------------------------------------------*/
else
{ /**
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE; * Atomic swap (pointers)
} *
} * @brief Atomically sets the address pointed to by *ppvDestination to the value
ATOMIC_EXIT_CRITICAL(); * of *pvExchange.
*
return ulReturnValue; * @param[in, out] ppvDestination Pointer to memory location from where a pointer
} * value is to be loaded and written back to.
/*-----------------------------------------------------------*/ * @param[in] pvExchange Pointer value to be written to *ppvDestination.
*
/** * @return The initial value of *ppvDestination.
* Atomic swap (pointers) */
* static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination,
* @brief Atomically sets the address pointed to by *ppvDestination to the value void * pvExchange )
* of *pvExchange. {
* void * pReturnValue;
* @param[in, out] ppvDestination Pointer to memory location from where a pointer
* value is to be loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param[in] pvExchange Pointer value to be written to *ppvDestination. {
* pReturnValue = *ppvDestination;
* @return The initial value of *ppvDestination. *ppvDestination = pvExchange;
*/ }
static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination, ATOMIC_EXIT_CRITICAL();
void * pvExchange )
{ return pReturnValue;
void * pReturnValue; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
pReturnValue = *ppvDestination; * Atomic compare-and-swap (pointers)
*ppvDestination = pvExchange; *
} * @brief Performs an atomic compare-and-swap operation on the specified pointer
ATOMIC_EXIT_CRITICAL(); * values.
*
return pReturnValue; * @param[in, out] ppvDestination Pointer to memory location from where a pointer
} * value is to be loaded and checked.
/*-----------------------------------------------------------*/ * @param[in] pvExchange If condition meets, write this value to memory.
* @param[in] pvComparand Swap condition.
/** *
* Atomic compare-and-swap (pointers) * @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
* *
* @brief Performs an atomic compare-and-swap operation on the specified pointer * @note This function only swaps *ppvDestination with pvExchange, if previous
* values. * *ppvDestination value equals pvComparand.
* */
* @param[in, out] ppvDestination Pointer to memory location from where a pointer static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination,
* value is to be loaded and checked. void * pvExchange,
* @param[in] pvExchange If condition meets, write this value to memory. void * pvComparand )
* @param[in] pvComparand Swap condition. {
* uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
* @return Unsigned integer of value 1 or 0. 1 for swapped, 0 for not swapped.
* ATOMIC_ENTER_CRITICAL();
* @note This function only swaps *ppvDestination with pvExchange, if previous {
* *ppvDestination value equals pvComparand. if( *ppvDestination == pvComparand )
*/ {
static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination, *ppvDestination = pvExchange;
void * pvExchange, ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
void * pvComparand ) }
{ }
uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE; ATOMIC_EXIT_CRITICAL();
ATOMIC_ENTER_CRITICAL(); return ulReturnValue;
{ }
if( *ppvDestination == pvComparand )
{
*ppvDestination = pvExchange; /*----------------------------- Arithmetic ------------------------------*/
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
} /**
} * Atomic add
ATOMIC_EXIT_CRITICAL(); *
* @brief Atomically adds count to the value of the specified pointer points to.
return ulReturnValue; *
} * @param[in,out] pulAddend Pointer to memory location from where value is to be
* loaded and written back to.
* @param[in] ulCount Value to be added to *pulAddend.
/*----------------------------- Arithmetic ------------------------------*/ *
* @return previous *pulAddend value.
/** */
* Atomic add static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend,
* uint32_t ulCount )
* @brief Atomically adds count to the value of the specified pointer points to. {
* uint32_t ulCurrent;
* @param[in,out] pulAddend Pointer to memory location from where value is to be
* loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param[in] ulCount Value to be added to *pulAddend. {
* ulCurrent = *pulAddend;
* @return previous *pulAddend value. *pulAddend += ulCount;
*/ }
static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend, ATOMIC_EXIT_CRITICAL();
uint32_t ulCount )
{ return ulCurrent;
uint32_t ulCurrent; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
ulCurrent = *pulAddend; * Atomic subtract
*pulAddend += ulCount; *
} * @brief Atomically subtracts count from the value of the specified pointer
ATOMIC_EXIT_CRITICAL(); * pointers to.
*
return ulCurrent; * @param[in,out] pulAddend Pointer to memory location from where value is to be
} * loaded and written back to.
/*-----------------------------------------------------------*/ * @param[in] ulCount Value to be subtract from *pulAddend.
*
/** * @return previous *pulAddend value.
* Atomic subtract */
* static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend,
* @brief Atomically subtracts count from the value of the specified pointer uint32_t ulCount )
* pointers to. {
* uint32_t ulCurrent;
* @param[in,out] pulAddend Pointer to memory location from where value is to be
* loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param[in] ulCount Value to be subtract from *pulAddend. {
* ulCurrent = *pulAddend;
* @return previous *pulAddend value. *pulAddend -= ulCount;
*/ }
static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend, ATOMIC_EXIT_CRITICAL();
uint32_t ulCount )
{ return ulCurrent;
uint32_t ulCurrent; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
ulCurrent = *pulAddend; * Atomic increment
*pulAddend -= ulCount; *
} * @brief Atomically increments the value of the specified pointer points to.
ATOMIC_EXIT_CRITICAL(); *
* @param[in,out] pulAddend Pointer to memory location from where value is to be
return ulCurrent; * loaded and written back to.
} *
/*-----------------------------------------------------------*/ * @return *pulAddend value before increment.
*/
/** static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
* Atomic increment {
* uint32_t ulCurrent;
* @brief Atomically increments the value of the specified pointer points to.
* ATOMIC_ENTER_CRITICAL();
* @param[in,out] pulAddend Pointer to memory location from where value is to be {
* loaded and written back to. ulCurrent = *pulAddend;
* *pulAddend += 1;
* @return *pulAddend value before increment. }
*/ ATOMIC_EXIT_CRITICAL();
static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
{ return ulCurrent;
uint32_t ulCurrent; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
ulCurrent = *pulAddend; * Atomic decrement
*pulAddend += 1; *
} * @brief Atomically decrements the value of the specified pointer points to
ATOMIC_EXIT_CRITICAL(); *
* @param[in,out] pulAddend Pointer to memory location from where value is to be
return ulCurrent; * loaded and written back to.
} *
/*-----------------------------------------------------------*/ * @return *pulAddend value before decrement.
*/
/** static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
* Atomic decrement {
* uint32_t ulCurrent;
* @brief Atomically decrements the value of the specified pointer points to
* ATOMIC_ENTER_CRITICAL();
* @param[in,out] pulAddend Pointer to memory location from where value is to be {
* loaded and written back to. ulCurrent = *pulAddend;
* *pulAddend -= 1;
* @return *pulAddend value before decrement. }
*/ ATOMIC_EXIT_CRITICAL();
static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
{ return ulCurrent;
uint32_t ulCurrent; }
ATOMIC_ENTER_CRITICAL(); /*----------------------------- Bitwise Logical ------------------------------*/
{
ulCurrent = *pulAddend; /**
*pulAddend -= 1; * Atomic OR
} *
ATOMIC_EXIT_CRITICAL(); * @brief Performs an atomic OR operation on the specified values.
*
return ulCurrent; * @param [in, out] pulDestination Pointer to memory location from where value is
} * to be loaded and written back to.
* @param [in] ulValue Value to be ORed with *pulDestination.
/*----------------------------- Bitwise Logical ------------------------------*/ *
* @return The original value of *pulDestination.
/** */
* Atomic OR static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination,
* uint32_t ulValue )
* @brief Performs an atomic OR operation on the specified values. {
* uint32_t ulCurrent;
* @param [in, out] pulDestination Pointer to memory location from where value is
* to be loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param [in] ulValue Value to be ORed with *pulDestination. {
* ulCurrent = *pulDestination;
* @return The original value of *pulDestination. *pulDestination |= ulValue;
*/ }
static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination, ATOMIC_EXIT_CRITICAL();
uint32_t ulValue )
{ return ulCurrent;
uint32_t ulCurrent; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
ulCurrent = *pulDestination; * Atomic AND
*pulDestination |= ulValue; *
} * @brief Performs an atomic AND operation on the specified values.
ATOMIC_EXIT_CRITICAL(); *
* @param [in, out] pulDestination Pointer to memory location from where value is
return ulCurrent; * to be loaded and written back to.
} * @param [in] ulValue Value to be ANDed with *pulDestination.
/*-----------------------------------------------------------*/ *
* @return The original value of *pulDestination.
/** */
* Atomic AND static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination,
* uint32_t ulValue )
* @brief Performs an atomic AND operation on the specified values. {
* uint32_t ulCurrent;
* @param [in, out] pulDestination Pointer to memory location from where value is
* to be loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param [in] ulValue Value to be ANDed with *pulDestination. {
* ulCurrent = *pulDestination;
* @return The original value of *pulDestination. *pulDestination &= ulValue;
*/ }
static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination, ATOMIC_EXIT_CRITICAL();
uint32_t ulValue )
{ return ulCurrent;
uint32_t ulCurrent; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
ulCurrent = *pulDestination; * Atomic NAND
*pulDestination &= ulValue; *
} * @brief Performs an atomic NAND operation on the specified values.
ATOMIC_EXIT_CRITICAL(); *
* @param [in, out] pulDestination Pointer to memory location from where value is
return ulCurrent; * to be loaded and written back to.
} * @param [in] ulValue Value to be NANDed with *pulDestination.
/*-----------------------------------------------------------*/ *
* @return The original value of *pulDestination.
/** */
* Atomic NAND static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination,
* uint32_t ulValue )
* @brief Performs an atomic NAND operation on the specified values. {
* uint32_t ulCurrent;
* @param [in, out] pulDestination Pointer to memory location from where value is
* to be loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param [in] ulValue Value to be NANDed with *pulDestination. {
* ulCurrent = *pulDestination;
* @return The original value of *pulDestination. *pulDestination = ~( ulCurrent & ulValue );
*/ }
static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination, ATOMIC_EXIT_CRITICAL();
uint32_t ulValue )
{ return ulCurrent;
uint32_t ulCurrent; }
/*-----------------------------------------------------------*/
ATOMIC_ENTER_CRITICAL();
{ /**
ulCurrent = *pulDestination; * Atomic XOR
*pulDestination = ~( ulCurrent & ulValue ); *
} * @brief Performs an atomic XOR operation on the specified values.
ATOMIC_EXIT_CRITICAL(); *
* @param [in, out] pulDestination Pointer to memory location from where value is
return ulCurrent; * to be loaded and written back to.
} * @param [in] ulValue Value to be XORed with *pulDestination.
/*-----------------------------------------------------------*/ *
* @return The original value of *pulDestination.
/** */
* Atomic XOR static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination,
* uint32_t ulValue )
* @brief Performs an atomic XOR operation on the specified values. {
* uint32_t ulCurrent;
* @param [in, out] pulDestination Pointer to memory location from where value is
* to be loaded and written back to. ATOMIC_ENTER_CRITICAL();
* @param [in] ulValue Value to be XORed with *pulDestination. {
* ulCurrent = *pulDestination;
* @return The original value of *pulDestination. *pulDestination ^= ulValue;
*/ }
static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination, ATOMIC_EXIT_CRITICAL();
uint32_t ulValue )
{ return ulCurrent;
uint32_t ulCurrent; }
ATOMIC_ENTER_CRITICAL(); /* *INDENT-OFF* */
{ #ifdef __cplusplus
ulCurrent = *pulDestination; }
*pulDestination ^= ulValue; #endif
} /* *INDENT-ON* */
ATOMIC_EXIT_CRITICAL();
#endif /* ATOMIC_H */
return ulCurrent;
}
/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* ATOMIC_H */

File diff suppressed because it is too large Load Diff

View 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 */

View File

@@ -1,8 +1,6 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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 * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -36,26 +34,6 @@
/* FreeRTOS includes. */ /* FreeRTOS includes. */
#include "timers.h" #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* */ /* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -85,6 +63,8 @@
* be set and then tested atomically - as is the case where event groups are * be set and then tested atomically - as is the case where event groups are
* used to create a synchronisation point between multiple tasks (a * used to create a synchronisation point between multiple tasks (a
* 'rendezvous'). * '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 * 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, * number of bits it holds is set by configUSE_16_BIT_TICKS (16 bits if set to 1,
* 32 bits if set to 1, 64 bits if set to 2. * 32 bits if set to 0.
* *
* \defgroup EventBits_t EventBits_t * \defgroup EventBits_t EventBits_t
* \ingroup EventGroup * \ingroup EventGroup
@@ -114,40 +94,36 @@ typedef TickType_t EventBits_t;
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventGroupHandle_t xEventGroupCreate( void ); * EventGroupHandle_t xEventGroupCreate( void );
* @endcode * </pre>
* *
* Create a new event group. * Create a new event group.
* *
* Internally, within the FreeRTOS implementation, event groups use a [small] * 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 * 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. * automatically dynamically allocated inside the xEventGroupCreate() function.
* (see https://www.FreeRTOS.org/a00111.html). If an event group is created * (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. * provide the memory that will get used by the event group.
* xEventGroupCreateStatic() therefore allows an event group to be created * xEventGroupCreateStatic() therefore allows an event group to be created
* without using any dynamic memory allocation. * without using any dynamic memory allocation.
* *
* Although event groups are not related to ticks, for internal implementation * 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 * 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 * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
* configTICK_TYPE_WIDTH_IN_BITS is 0 then each event group contains 8 usable bits (bit * configUSE_16_BIT_TICKS is 1 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 * 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). If configTICK_TYPE_WIDTH_IN_BITS is set to 2 then * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
* each event group has 56 usable bits (bit 0 to bit 53). The EventBits_t type * event bits within an event group.
* 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.
* *
* @return If the event group was created then a handle to the event group is * @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 * returned. If there was insufficient FreeRTOS heap available to create the
* event group then NULL is returned. See https://www.FreeRTOS.org/a00111.html * event group then NULL is returned. See https://www.FreeRTOS.org/a00111.html
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* // Declare a variable to hold the created event group. * // Declare a variable to hold the created event group.
* EventGroupHandle_t xCreatedEventGroup; * EventGroupHandle_t xCreatedEventGroup;
* *
@@ -164,7 +140,7 @@ typedef TickType_t EventBits_t;
* { * {
* // The event group was created. * // The event group was created.
* } * }
* @endcode * </pre>
* \defgroup xEventGroupCreate xEventGroupCreate * \defgroup xEventGroupCreate xEventGroupCreate
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -174,33 +150,29 @@ typedef TickType_t EventBits_t;
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventGroupHandle_t xEventGroupCreateStatic( EventGroupHandle_t * pxEventGroupBuffer ); * EventGroupHandle_t xEventGroupCreateStatic( EventGroupHandle_t * pxEventGroupBuffer );
* @endcode * </pre>
* *
* Create a new event group. * Create a new event group.
* *
* Internally, within the FreeRTOS implementation, event groups use a [small] * 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 * 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. * automatically dynamically allocated inside the xEventGroupCreate() function.
* (see https://www.FreeRTOS.org/a00111.html). If an event group is created * (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. * provide the memory that will get used by the event group.
* xEventGroupCreateStatic() therefore allows an event group to be created * xEventGroupCreateStatic() therefore allows an event group to be created
* without using any dynamic memory allocation. * without using any dynamic memory allocation.
* *
* Although event groups are not related to ticks, for internal implementation * 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 * 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 * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
* configTICK_TYPE_WIDTH_IN_BITS is 0 then each event group contains 8 usable bits (bit * configUSE_16_BIT_TICKS is 1 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 * 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). If configTICK_TYPE_WIDTH_IN_BITS is set to 2 then * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
* each event group has 56 usable bits (bit 0 to bit 53). The EventBits_t type * event bits within an event group.
* 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.
* *
* @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type * @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 * 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. * returned. If pxEventGroupBuffer was NULL then NULL is returned.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* // StaticEventGroup_t is a publicly accessible structure that has the same * // StaticEventGroup_t is a publicly accessible structure that has the same
* // size and alignment requirements as the real event group structure. It is * // 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 * // 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. * // Create the event group without dynamically allocating any memory.
* xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer ); * xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
* @endcode * </pre>
*/ */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION; EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
@@ -231,22 +203,19 @@ typedef TickType_t EventBits_t;
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, * EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
* const EventBits_t uxBitsToWaitFor, * const EventBits_t uxBitsToWaitFor,
* const BaseType_t xClearOnExit, * const BaseType_t xClearOnExit,
* const BaseType_t xWaitForAllBits, * const BaseType_t xWaitForAllBits,
* const TickType_t xTicksToWait ); * const TickType_t xTicksToWait );
* @endcode * </pre>
* *
* [Potentially] block to wait for one or more bits to be set within a * [Potentially] block to wait for one or more bits to be set within a
* previously created event group. * previously created event group.
* *
* This function cannot be called from an interrupt. * 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 * @param xEventGroup The event group in which the bits are being tested. The
* event group must have previously been created using a call to * event group must have previously been created using a call to
* xEventGroupCreate(). * xEventGroupCreate().
@@ -272,8 +241,7 @@ typedef TickType_t EventBits_t;
* *
* @param xTicksToWait The maximum amount of time (specified in 'ticks') to wait * @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 * 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 * uxBitsToWaitFor to become set.
* indefinitely (provided INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
* *
* @return The value of the event group at the time either the bits being waited * @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 * for became set, or the block time expired. Test the return value to know
@@ -285,9 +253,9 @@ typedef TickType_t EventBits_t;
* pdTRUE. * pdTRUE.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* #define BIT_0 ( 1 << 0 ) #define BIT_0 ( 1 << 0 )
* #define BIT_4 ( 1 << 4 ) #define BIT_4 ( 1 << 4 )
* *
* void aFunction( EventGroupHandle_t xEventGroup ) * void aFunction( EventGroupHandle_t xEventGroup )
* { * {
@@ -321,7 +289,7 @@ typedef TickType_t EventBits_t;
* // without either BIT_0 or BIT_4 becoming set. * // without either BIT_0 or BIT_4 becoming set.
* } * }
* } * }
* @endcode * </pre>
* \defgroup xEventGroupWaitBits xEventGroupWaitBits * \defgroup xEventGroupWaitBits xEventGroupWaitBits
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -333,16 +301,13 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear ); * 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 * Clear bits within an event group. This function cannot be called from an
* interrupt. * 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 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 * @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. * @return The value of the event group before the specified bits were cleared.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* #define BIT_0 ( 1 << 0 ) #define BIT_0 ( 1 << 0 )
* #define BIT_4 ( 1 << 4 ) #define BIT_4 ( 1 << 4 )
* *
* void aFunction( EventGroupHandle_t xEventGroup ) * 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. * // Neither bit 0 nor bit 4 were set in the first place.
* } * }
* } * }
* @endcode * </pre>
* \defgroup xEventGroupClearBits xEventGroupClearBits * \defgroup xEventGroupClearBits xEventGroupClearBits
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -394,9 +359,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ); * BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
* @endcode * </pre>
* *
* A version of xEventGroupClearBits() that can be called from an interrupt. * 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 * timer task to have the clear operation performed in the context of the timer
* task. * 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 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. * @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. * if the timer service queue was full.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* #define BIT_0 ( 1 << 0 ) #define BIT_0 ( 1 << 0 )
* #define BIT_4 ( 1 << 4 ) #define BIT_4 ( 1 << 4 )
* *
* // An event group which it is assumed has already been created by a call to * // An event group which it is assumed has already been created by a call to
* // xEventGroupCreate(). * // xEventGroupCreate().
@@ -445,10 +404,9 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
* if( xResult == pdPASS ) * if( xResult == pdPASS )
* { * {
* // The message was posted successfully. * // The message was posted successfully.
* portYIELD_FROM_ISR(pdTRUE);
* } * }
* } * }
* @endcode * </pre>
* \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR * \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -457,14 +415,14 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION; const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
#else #else
#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) \ #define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) \
xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) ( xEventGroup ), ( uint32_t ) ( uxBitsToClear ), NULL ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
#endif #endif
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet ); * EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
* @endcode * </pre>
* *
* Set bits within an event group. * Set bits within an event group.
* This function cannot be called from an interrupt. xEventGroupSetBitsFromISR() * 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 * Setting bits in an event group will automatically unblock tasks that are
* blocked waiting for the bits. * 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 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. * @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. * event group value before the call to xEventGroupSetBits() returns.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* #define BIT_0 ( 1 << 0 ) #define BIT_0 ( 1 << 0 )
* #define BIT_4 ( 1 << 4 ) #define BIT_4 ( 1 << 4 )
* *
* void aFunction( EventGroupHandle_t xEventGroup ) * void aFunction( EventGroupHandle_t xEventGroup )
* { * {
@@ -531,7 +486,7 @@ EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
* // cleared as the task left the Blocked state. * // cleared as the task left the Blocked state.
* } * }
* } * }
* @endcode * </pre>
* \defgroup xEventGroupSetBits xEventGroupSetBits * \defgroup xEventGroupSetBits xEventGroupSetBits
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -540,9 +495,9 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken ); * 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. * 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. * if the timer service queue was full.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* #define BIT_0 ( 1 << 0 ) #define BIT_0 ( 1 << 0 )
* #define BIT_4 ( 1 << 4 ) #define BIT_4 ( 1 << 4 )
* *
* // An event group which it is assumed has already been created by a call to * // An event group which it is assumed has already been created by a call to
* // xEventGroupCreate(). * // xEventGroupCreate().
@@ -606,7 +561,7 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken ); * portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* } * }
* } * }
* @endcode * </pre>
* \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR * \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -616,17 +571,17 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
#else #else
#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) \ #define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) \
xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) ( xEventGroup ), ( uint32_t ) ( uxBitsToSet ), ( pxHigherPriorityTaskWoken ) ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
#endif #endif
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, * EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
* const EventBits_t uxBitsToSet, * const EventBits_t uxBitsToSet,
* const EventBits_t uxBitsToWaitFor, * const EventBits_t uxBitsToWaitFor,
* TickType_t xTicksToWait ); * TickType_t xTicksToWait );
* @endcode * </pre>
* *
* Atomically set bits within an event group, then wait for a combination of * 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 * 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 * this case all the bits specified by uxBitsToWait will be automatically
* cleared before the function returns. * 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 * @param xEventGroup The event group in which the bits are being tested. The
* event group must have previously been created using a call to * event group must have previously been created using a call to
* xEventGroupCreate(). * xEventGroupCreate().
@@ -668,13 +620,13 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
* automatically cleared. * automatically cleared.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* // Bits used by the three tasks. * // Bits used by the three tasks.
* #define TASK_0_BIT ( 1 << 0 ) #define TASK_0_BIT ( 1 << 0 )
* #define TASK_1_BIT ( 1 << 1 ) #define TASK_1_BIT ( 1 << 1 )
* #define TASK_2_BIT ( 1 << 2 ) #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 * // Use an event group to synchronise three tasks. It is assumed this event
* // group has already been created elsewhere. * // group has already been created elsewhere.
@@ -742,7 +694,7 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
* } * }
* } * }
* *
* @endcode * </pre>
* \defgroup xEventGroupSync xEventGroupSync * \defgroup xEventGroupSync xEventGroupSync
* \ingroup EventGroup * \ingroup EventGroup
*/ */
@@ -754,16 +706,13 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup ); * EventBits_t xEventGroupGetBits( EventGroupHandle_t xEventGroup );
* @endcode * </pre>
* *
* Returns the current value of the bits in an event group. This function * Returns the current value of the bits in an event group. This function
* cannot be used from an interrupt. * 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. * @param xEventGroup The event group being queried.
* *
* @return The event group bits at the time xEventGroupGetBits() was called. * @return The event group bits at the time xEventGroupGetBits() was called.
@@ -771,19 +720,16 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
* \defgroup xEventGroupGetBits xEventGroupGetBits * \defgroup xEventGroupGetBits xEventGroupGetBits
* \ingroup EventGroup * \ingroup EventGroup
*/ */
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( ( xEventGroup ), 0 ) #define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
/** /**
* event_groups.h * event_groups.h
* @code{c} * <pre>
* EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ); * EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup );
* @endcode * </pre>
* *
* A version of xEventGroupGetBits() that can be called from an ISR. * 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. * @param xEventGroup The event group being queried.
* *
* @return The event group bits at the time xEventGroupGetBitsFromISR() was called. * @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 * event_groups.h
* @code{c} * <pre>
* void xEventGroupDelete( EventGroupHandle_t xEventGroup ); * void xEventGroupDelete( EventGroupHandle_t xEventGroup );
* @endcode * </pre>
* *
* Delete an event group that was previously created by a call to * Delete an event group that was previously created by a call to
* xEventGroupCreate(). Tasks that are blocked on the event group will be * xEventGroupCreate(). Tasks that are blocked on the event group will be
* unblocked and obtain 0 as the event group's value. * 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. * @param xEventGroup The event group being deleted.
*/ */
void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION; 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. */ /* For internal use only. */
void vEventGroupSetBitsCallback( void * pvEventGroup, void vEventGroupSetBitsCallback( void * pvEventGroup,
uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION; const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
void vEventGroupClearBitsCallback( void * pvEventGroup, void vEventGroupClearBitsCallback( void * pvEventGroup,
uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION; const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )

View File

@@ -1,511 +1,417 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ /*
* This is the list implementation used by the scheduler. While it is tailored
/* * heavily for the schedulers needs, it is also available for use by
* This is the list implementation used by the scheduler. While it is tailored * application code.
* heavily for the schedulers needs, it is also available for use by *
* application code. * 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
* list_ts can only store pointers to list_item_ts. Each ListItem_t contains a * descending item value order.
* numeric value (xItemValue). Most of the time the lists are sorted in *
* ascending 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
* Lists are created already containing one list item. The value of this * the end of the list and acts as a marker. The list member pxHead always
* item is the maximum possible that can be stored, it is therefore always at * points to this marker - even though it is at the tail of the list. This
* the end of the list and acts as a marker. The list member pxHead always * is because the tail contains a wrap back pointer to the true head of
* points to this marker - even though it is at the tail of the list. This * the list.
* is because the tail contains a wrap back pointer to the true head of *
* the list. * In addition to it's value, each list item contains a pointer to the next
* * item in the list (pxNext), a pointer to the list it is in (pxContainer)
* In addition to it's value, each list item contains a pointer to the next * and a pointer to back to the object that contains it. These later two
* item in the list (pxNext), a pointer to the list it is in (pxContainer) * pointers are included for efficiency of list manipulation. There is
* and a pointer to back to the object that contains it. These later two * effectively a two way link between the object containing the list item and
* pointers are included for efficiency of list manipulation. There is * the list item itself.
* effectively a two way link between the object containing the list item and *
* the list item itself. *
* * \page ListIntroduction List Implementation
* * \ingroup FreeRTOSIntro
* \page ListIntroduction List Implementation */
* \ingroup FreeRTOSIntro
*/
#ifndef LIST_H
#define LIST_H
#ifndef LIST_H
#define LIST_H #ifndef INC_FREERTOS_H
#error "FreeRTOS.h must be included before list.h"
#ifndef INC_FREERTOS_H #endif
#error "FreeRTOS.h must be included before list.h"
#endif /*
* The list structure members are modified from within interrupts, and therefore
/* * by rights should be declared volatile. However, they are only modified in a
* The list structure members are modified from within interrupts, and therefore * functionally atomic way (within critical sections of with the scheduler
* by rights should be declared volatile. However, they are only modified in a * suspended) and are either passed by reference into a function or indexed via
* functionally atomic way (within critical sections of with the scheduler * a volatile variable. Therefore, in all use cases tested so far, the volatile
* suspended) and are either passed by reference into a function or indexed via * qualifier can be omitted in order to provide a moderate performance
* a volatile variable. Therefore, in all use cases tested so far, the volatile * improvement without adversely affecting functional behaviour. The assembly
* qualifier can be omitted in order to provide a moderate performance * instructions generated by the IAR, ARM and GCC compilers when the respective
* improvement without adversely affecting functional behaviour. The assembly * compiler's options were set for maximum optimisation has been inspected and
* instructions generated by the IAR, ARM and GCC compilers when the respective * deemed to be as intended. That said, as compiler technology advances, and
* compiler's options were set for maximum optimisation has been inspected and * especially if aggressive cross module optimisation is used (a use case that
* deemed to be as intended. That said, as compiler technology advances, and * has not been exercised to any great extend) then it is feasible that the
* especially if aggressive cross module optimisation is used (a use case that * volatile qualifier will be needed for correct optimisation. It is expected
* has not been exercised to any great extend) then it is feasible that the * that a compiler removing essential code because, without the volatile
* volatile qualifier will be needed for correct optimisation. It is expected * qualifier on the list structure members and with aggressive cross module
* that a compiler removing essential code because, without the volatile * optimisation, the compiler deemed the code unnecessary will result in
* qualifier on the list structure members and with aggressive cross module * complete and obvious failure of the scheduler. If this is ever experienced
* optimisation, the compiler deemed the code unnecessary will result in * then the volatile qualifier can be inserted in the relevant places within the
* complete and obvious failure of the scheduler. If this is ever experienced * list structures by simply defining configLIST_VOLATILE to volatile in
* then the volatile qualifier can be inserted in the relevant places within the * FreeRTOSConfig.h (as per the example at the bottom of this comment block).
* list structures by simply defining configLIST_VOLATILE to volatile in * If configLIST_VOLATILE is not defined then the preprocessor directives below
* FreeRTOSConfig.h (as per the example at the bottom of this comment block). * will simply #define configLIST_VOLATILE away completely.
* If configLIST_VOLATILE is not defined then the preprocessor directives below *
* will simply #define configLIST_VOLATILE away completely. * To use volatile list structure members then add the following line to
* * FreeRTOSConfig.h (without the quotes):
* To use volatile list structure members then add the following line to * "#define configLIST_VOLATILE volatile"
* FreeRTOSConfig.h (without the quotes): */
* "#define configLIST_VOLATILE volatile" #ifndef configLIST_VOLATILE
*/ #define configLIST_VOLATILE
#ifndef configLIST_VOLATILE #endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
#define configLIST_VOLATILE
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */ /* *INDENT-OFF* */
#ifdef __cplusplus
/* *INDENT-OFF* */ extern "C" {
#ifdef __cplusplus #endif
extern "C" { /* *INDENT-ON* */
#endif
/* *INDENT-ON* */ /* Macros that can be used to place known values within the list structures,
* then check that the known values do not get corrupted during the execution of
/* Macros that can be used to place known values within the list structures, * the application. These may catch the list data structures being overwritten in
* then check that the known values do not get corrupted during the execution of * memory. They will not catch data errors caused by incorrect configuration or
* the application. These may catch the list data structures being overwritten in * use of FreeRTOS.*/
* memory. They will not catch data errors caused by incorrect configuration or #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
* use of FreeRTOS.*/ /* Define the macros to do nothing. */
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
/* Define the macros to do nothing. */ #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE #define listFIRST_LIST_INTEGRITY_CHECK_VALUE
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE #define listSECOND_LIST_INTEGRITY_CHECK_VALUE
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE #define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) #define listTEST_LIST_ITEM_INTEGRITY( pxItem )
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) #define listTEST_LIST_INTEGRITY( pxList )
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) #else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */
#define listTEST_LIST_INTEGRITY( pxList ) /* Define macros that add new members into the list structures. */
#else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */ #define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
/* Define macros that add new members into the list structures. */ #define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1; #define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2; #define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2; /* Define macros that set the new structure members to known values. */
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
/* Define macros that set the new structure members to known values. */ #define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE #define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE #define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE /* Define macros that will assert if one of the structure members does not
* contain its expected value. */
/* Define macros that will assert if one of the structure members does not #define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
* contain its expected value. */ #define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) ) #endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
#define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
/*
* Definition of the only type of object that a list can contain.
/* */
* Definition of the only type of object that a list can contain. struct xLIST;
*/ struct xLIST_ITEM
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 descending order. */
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
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 pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /**< Pointer to the next 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_ITEM * configLIST_VOLATILE pxPrevious; /**< Pointer to the previous ListItem_t in the list. */ struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
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. */ listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
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; /* For some reason lint wants this as two separate definitions. */
};
typedef struct xLIST_ITEM ListItem_t; struct xMINI_LIST_ITEM
{
#if ( configUSE_MINI_LIST_ITEM == 1 ) listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
struct xMINI_LIST_ITEM configLIST_VOLATILE TickType_t xItemValue;
{ struct xLIST_ITEM * configLIST_VOLATILE pxNext;
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
configLIST_VOLATILE TickType_t xItemValue; };
struct xLIST_ITEM * configLIST_VOLATILE pxNext; typedef struct xMINI_LIST_ITEM MiniListItem_t;
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
}; /*
typedef struct xMINI_LIST_ITEM MiniListItem_t; * Definition of the type of queue used by the scheduler.
#else */
typedef struct xLIST_ITEM MiniListItem_t; typedef struct xLIST
#endif {
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;
* Definition of the type of queue used by the scheduler. 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. */
typedef struct xLIST listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
{ } List_t;
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 (). */ * Access macro to set the owner of a list item. The owner of a list item
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. */ * is the object (usually a TCB) that contains the list item.
listSECOND_LIST_INTEGRITY_CHECK_VALUE /**< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ *
} List_t; * \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
* \ingroup LinkedList
/* */
* Access macro to set the owner of a list item. The owner of a list item #define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
* is the object (usually a TCB) that contains the list item.
* /*
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER * Access macro to get the owner of a list item. The owner of a list item
* \ingroup LinkedList * is the object (usually a TCB) that contains the list item.
*/ *
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) ) * \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
* \ingroup LinkedList
/* */
* Access macro to get the owner of a list item. The owner of a list item #define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
* is the object (usually a TCB) that contains the list item.
* /*
* \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER * Access macro to set the value of the list item. In most cases the value is
* \ingroup LinkedList * used to sort the list in descending order.
*/ *
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner ) * \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
* \ingroup LinkedList
/* */
* Access macro to set the value of the list item. In most cases the value is #define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
* used to sort the list in ascending order.
* /*
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE * Access macro to retrieve the value of the list item. The value can
* \ingroup LinkedList * represent anything - for example the priority of a task, or the time at
*/ * which a task should be unblocked.
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) ) *
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
/* * \ingroup LinkedList
* Access macro to retrieve the value of the list item. The value can */
* represent anything - for example the priority of a task, or the time at #define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
* which a task should be unblocked.
* /*
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE * Access macro to retrieve the value of the list item at the head of a given
* \ingroup LinkedList * list.
*/ *
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue ) * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
* \ingroup LinkedList
/* */
* Access macro to retrieve the value of the list item at the head of a given #define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
* list.
* /*
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE * Return the list item at the head of the list.
* \ingroup LinkedList *
*/ * \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue ) * \ingroup LinkedList
*/
/* #define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
* Return the list item at the head of the list.
* /*
* \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY * Return the next list item.
* \ingroup LinkedList *
*/ * \page listGET_NEXT listGET_NEXT
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext ) * \ingroup LinkedList
*/
/* #define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
* Return the next list item.
* /*
* \page listGET_NEXT listGET_NEXT * Return the list item that marks the end of the list
* \ingroup LinkedList *
*/ * \page listGET_END_MARKER listGET_END_MARKER
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext ) * \ingroup LinkedList
*/
/* #define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
* Return the list item that marks the end of the list
* /*
* \page listGET_END_MARKER listGET_END_MARKER * Access macro to determine if a list contains any items. The macro will
* \ingroup LinkedList * only have the value true if the list is empty.
*/ *
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) ) * \page listLIST_IS_EMPTY listLIST_IS_EMPTY
* \ingroup LinkedList
/* */
* Access macro to determine if a list contains any items. The macro will #define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
* only have the value true if the list is empty.
* /*
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY * Access macro to return the number of items in the list.
* \ingroup LinkedList */
*/ #define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
/*
/* * Access function to obtain the owner of the next entry in a list.
* Access macro to return the number of items in the list. *
*/ * The list member pxIndex is used to walk through a list. Calling
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems ) * listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list
* and returns that entry's pxOwner parameter. Using multiple calls to this
/* * function it is therefore possible to move through every item contained in
* Access function to obtain the owner of the next entry in a list. * a list.
* *
* The list member pxIndex is used to walk through a list. Calling * The pxOwner parameter of a list item is a pointer to the object that owns
* listGET_OWNER_OF_NEXT_ENTRY increments pxIndex to the next item in the list * the list item. In the scheduler this is normally a task control block.
* and returns that entry's pxOwner parameter. Using multiple calls to this * The pxOwner parameter effectively creates a two way link between the list
* function it is therefore possible to move through every item contained in * item and its owner.
* a list. *
* * @param pxTCB pxTCB is set to the address of the owner of the next list item.
* The pxOwner parameter of a list item is a pointer to the object that owns * @param pxList The list from which the next item owner is to be returned.
* the list item. In the scheduler this is normally a task control block. *
* The pxOwner parameter effectively creates a two way link between the list * \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
* item and its owner. * \ingroup LinkedList
* */
* @param pxTCB pxTCB is set to the address of the owner of the next list item. #define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
* @param pxList The list from which the next item owner is to be returned. { \
* List_t * const pxConstList = ( pxList ); \
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY /* Increment the index to the next item and return the item, ensuring */ \
* \ingroup LinkedList /* we don't return the marker used at the end of the list. */ \
*/ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
#if ( configNUMBER_OF_CORES == 1 ) if( ( void * ) ( pxConstList )->pxIndex == ( void * ) &( ( pxConstList )->xListEnd ) ) \
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \ { \
do { \ ( pxConstList )->pxIndex = ( pxConstList )->pxIndex->pxNext; \
List_t * const pxConstList = ( pxList ); \ } \
/* Increment the index to the next item and return the item, ensuring */ \ ( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
/* 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; \ * Access function to obtain the owner of the first entry in a list. Lists
} \ * are normally sorted in ascending item value order.
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \ *
} while( 0 ) * This function returns the pxOwner member of the first item in the list.
#else /* #if ( configNUMBER_OF_CORES == 1 ) */ * The pxOwner parameter of a list item is a pointer to the object that owns
* the list item. In the scheduler this is normally a task control block.
/* This function is not required in SMP. FreeRTOS SMP scheduler doesn't use * The pxOwner parameter effectively creates a two way link between the list
* pxIndex and it should always point to the xListEnd. Not defining this macro * item and its owner.
* here to prevent updating pxIndex. *
*/ * @param pxList The list from which the owner of the head item is to be
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */ * returned.
*
/* * \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
* Version of uxListRemove() that does not return a value. Provided as a slight * \ingroup LinkedList
* optimisation for xTaskIncrementTick() by being inline. */
* #define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner )
* 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. /*
* * Check to see if a list item is within a list. The list item maintains a
* @param uxListRemove The item to be removed. The item will remove itself from * "container" pointer that points to the list it is in. All this macro does
* the list pointed to by it's pxContainer parameter. * is check to see if the container and the list match.
* *
* @return The number of items that remain in the list after the list item has * @param pxList The list we want to know if the list item is within.
* been removed. * @param pxListItem The list item we want to know if is in the list.
* * @return pdTRUE if the list item is in the list, otherwise pdFALSE.
* \page listREMOVE_ITEM listREMOVE_ITEM */
* \ingroup LinkedList #define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
*/
#define listREMOVE_ITEM( pxItemToRemove ) \ /*
do { \ * Return the list a list item is contained within (referenced from).
/* The list item knows which list it is in. Obtain the list from the list \ *
* item. */ \ * @param pxListItem The list item being queried.
List_t * const pxList = ( pxItemToRemove )->pxContainer; \ * @return A pointer to the List_t object that references the pxListItem
\ */
( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \ #define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
/* Make sure the index is left pointing to a valid item. */ \ /*
if( pxList->pxIndex == ( pxItemToRemove ) ) \ * This provides a crude means of knowing if a list has been initialised, as
{ \ * pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \ * function.
} \ */
\ #define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
( pxItemToRemove )->pxContainer = NULL; \
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) - 1U ); \ /*
} while( 0 ) * Must be called before a list is used! This initialises all the members
* of the list structure and inserts the xListEnd item into the list as a
/* * marker to the back of the list.
* Inline version of vListInsertEnd() to provide slight optimisation for *
* xTaskIncrementTick(). * @param pxList Pointer to the list being initialised.
* *
* Insert a list item into a list. The item will be inserted in a position * \page vListInitialise vListInitialise
* such that it will be the last item within the list returned by multiple * \ingroup LinkedList
* calls to listGET_OWNER_OF_NEXT_ENTRY. */
* void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
* 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 * Must be called before a list item is used. This sets the list container to
* in the list position pointed to by pxIndex. This means that every other * null so the item does not think that it is already contained in a list.
* 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 pxItem Pointer to the list item being initialised.
* *
* @param pxList The list into which the item is to be inserted. * \page vListInitialiseItem vListInitialiseItem
* * \ingroup LinkedList
* @param pxNewListItem The list item to be inserted into the list. */
* void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
* \page listINSERT_END listINSERT_END
* \ingroup LinkedList /*
*/ * Insert a list item into a list. The item will be inserted into the list in
#define listINSERT_END( pxList, pxNewListItem ) \ * a position determined by its item value (descending item value order).
do { \ *
ListItem_t * const pxIndex = ( pxList )->pxIndex; \ * @param pxList The list into which the item is to be inserted.
\ *
/* Only effective when configASSERT() is also defined, these tests may catch \ * @param pxNewListItem The item that is to be placed in the list.
* the list data structures being overwritten in memory. They will not catch \ *
* data errors caused by incorrect configuration or use of FreeRTOS. */ \ * \page vListInsert vListInsert
listTEST_LIST_INTEGRITY( ( pxList ) ); \ * \ingroup LinkedList
listTEST_LIST_ITEM_INTEGRITY( ( pxNewListItem ) ); \ */
\ void vListInsert( List_t * const pxList,
/* Insert a new list item into ( pxList ), but rather than sort the list, \ ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
* makes the new list item the last item to be removed by a call to \
* listGET_OWNER_OF_NEXT_ENTRY(). */ \ /*
( pxNewListItem )->pxNext = pxIndex; \ * Insert a list item into a list. The item will be inserted in a position
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \ * such that it will be the last item within the list returned by multiple
\ * calls to listGET_OWNER_OF_NEXT_ENTRY.
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \ *
pxIndex->pxPrevious = ( pxNewListItem ); \ * 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.
/* Remember which list the item is in. */ \ * Placing an item in a list using vListInsertEnd effectively places the item
( pxNewListItem )->pxContainer = ( pxList ); \ * 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
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) + 1U ); \ * the pxIndex parameter again points to the item being inserted.
} while( 0 ) *
* @param pxList The list into which the item is to be inserted.
/* *
* Access function to obtain the owner of the first entry in a list. Lists * @param pxNewListItem The list item to be inserted into the list.
* are normally sorted in ascending item value order. *
* * \page vListInsertEnd vListInsertEnd
* This function returns the pxOwner member of the first item in the list. * \ingroup LinkedList
* The pxOwner parameter of a list item is a pointer to the object that owns */
* the list item. In the scheduler this is normally a task control block. void vListInsertEnd( List_t * const pxList,
* The pxOwner parameter effectively creates a two way link between the list ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
* item and its owner.
* /*
* @param pxList The list from which the owner of the head item is to be * Remove an item from a list. The list item has a pointer to the list that
* returned. * it is in, so only the list item need be passed into the function.
* *
* \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY * @param uxListRemove The item to be removed. The item will remove itself from
* \ingroup LinkedList * the list pointed to by it's pxContainer parameter.
*/ *
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner ) * @return The number of items that remain in the list after the list item has
* been removed.
/* *
* Check to see if a list item is within a list. The list item maintains a * \page uxListRemove uxListRemove
* "container" pointer that points to the list it is in. All this macro does * \ingroup LinkedList
* is check to see if the container and the list match. */
* UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
* @param pxList The list we want to know if the list item is within.
* @param pxListItem The list item we want to know if is in the list. /* *INDENT-OFF* */
* @return pdTRUE if the list item is in the list, otherwise pdFALSE. #ifdef __cplusplus
*/ }
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) ) #endif
/* *INDENT-ON* */
/*
* Return the list a list item is contained within (referenced from). #endif /* ifndef LIST_H */
*
* @param pxListItem The list item being queried.
* @return A pointer to the List_t object that references the pxListItem
*/
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
/*
* This provides a crude means of knowing if a list has been initialised, as
* pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
* function.
*/
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
/*
* Must be called before a list is used! This initialises all the members
* of the list structure and inserts the xListEnd item into the list as a
* marker to the back of the list.
*
* @param pxList Pointer to the list being initialised.
*
* \page vListInitialise vListInitialise
* \ingroup LinkedList
*/
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
/*
* Must be called before a list item is used. This sets the list container to
* null so the item does not think that it is already contained in a list.
*
* @param pxItem Pointer to the list item being initialised.
*
* \page vListInitialiseItem vListInitialiseItem
* \ingroup LinkedList
*/
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).
*
* @param pxList The list into which the item is to be inserted.
*
* @param pxNewListItem The item that is to be placed in the list.
*
* \page vListInsert vListInsert
* \ingroup LinkedList
*/
void vListInsert( List_t * const pxList,
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
/*
* 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 vListInsertEnd vListInsertEnd
* \ingroup LinkedList
*/
void vListInsertEnd( List_t * const pxList,
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
/*
* 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 uxListRemove uxListRemove
* \ingroup LinkedList
*/
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* ifndef LIST_H */

File diff suppressed because it is too large Load Diff

View File

@@ -1,389 +1,263 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ /*
* When the MPU is used the standard (non MPU) API functions are mapped to
/* * equivalents that start "MPU_", the prototypes for which are defined in this
* When the MPU is used the standard (non MPU) API functions are mapped to * header files. This will cause the application code to call the MPU_ version
* equivalents that start "MPU_", the prototypes for which are defined in this * which wraps the non-MPU version with privilege promoting then demoting code,
* header files. This will cause the application code to call the MPU_ version * so the kernel code always runs will full privileges.
* which wraps the non-MPU version with privilege promoting then demoting code, */
* so the kernel code always runs will full privileges.
*/
#ifndef MPU_PROTOTYPES_H
#define MPU_PROTOTYPES_H
#ifndef MPU_PROTOTYPES_H
#define MPU_PROTOTYPES_H /* MPU versions of tasks.h API functions. */
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode,
typedef struct xTaskGenericNotifyParams const char * const pcName,
{ const uint16_t usStackDepth,
TaskHandle_t xTaskToNotify; void * const pvParameters,
UBaseType_t uxIndexToNotify; UBaseType_t uxPriority,
uint32_t ulValue; TaskHandle_t * const pxCreatedTask ) FREERTOS_SYSTEM_CALL;
eNotifyAction eAction; TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode,
uint32_t * pulPreviousNotificationValue; const char * const pcName,
} xTaskGenericNotifyParams_t; const uint32_t ulStackDepth,
void * const pvParameters,
typedef struct xTaskGenericNotifyWaitParams UBaseType_t uxPriority,
{ StackType_t * const puxStackBuffer,
UBaseType_t uxIndexToWaitOn; StaticTask_t * const pxTaskBuffer ) FREERTOS_SYSTEM_CALL;
uint32_t ulBitsToClearOnEntry; BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
uint32_t ulBitsToClearOnExit; TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
uint32_t * pulNotificationValue; BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition,
TickType_t xTicksToWait; TaskHandle_t * pxCreatedTask ) FREERTOS_SYSTEM_CALL;
} xTaskGenericNotifyWaitParams_t; void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask,
const MemoryRegion_t * const pxRegions ) FREERTOS_SYSTEM_CALL;
typedef struct xTimerGenericCommandFromTaskParams void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) FREERTOS_SYSTEM_CALL;
{ void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL;
TimerHandle_t xTimer; void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
BaseType_t xCommandID; const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL;
TickType_t xOptionalValue; BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
BaseType_t * pxHigherPriorityTaskWoken; UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
TickType_t xTicksToWait; eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
} xTimerGenericCommandFromTaskParams_t; void MPU_vTaskGetInfo( TaskHandle_t xTask,
TaskStatus_t * pxTaskStatus,
typedef struct xEventGroupWaitBitsParams BaseType_t xGetFreeStackSpace,
{ eTaskState eState ) FREERTOS_SYSTEM_CALL;
EventGroupHandle_t xEventGroup; void MPU_vTaskPrioritySet( TaskHandle_t xTask,
EventBits_t uxBitsToWaitFor; UBaseType_t uxNewPriority ) FREERTOS_SYSTEM_CALL;
BaseType_t xClearOnExit; void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL;
BaseType_t xWaitForAllBits; void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL;
TickType_t xTicksToWait; void MPU_vTaskStartScheduler( void ) FREERTOS_SYSTEM_CALL;
} xEventGroupWaitBitsParams_t; void MPU_vTaskSuspendAll( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskResumeAll( void ) FREERTOS_SYSTEM_CALL;
/* MPU versions of task.h API functions. */ TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) FREERTOS_SYSTEM_CALL; UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) FREERTOS_SYSTEM_CALL;
const TickType_t xTimeIncrement ) FREERTOS_SYSTEM_CALL; TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction ) FREERTOS_SYSTEM_CALL;
TaskStatus_t * pxTaskStatus, TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL;
BaseType_t xGetFreeStackSpace, void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
eTaskState eState ) FREERTOS_SYSTEM_CALL; BaseType_t xIndex,
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) FREERTOS_SYSTEM_CALL; void * pvValue ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) FREERTOS_SYSTEM_CALL; void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
TickType_t MPU_xTaskGetTickCount( void ) FREERTOS_SYSTEM_CALL; BaseType_t xIndex ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask,
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; void * pvParameter ) FREERTOS_SYSTEM_CALL;
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
TaskHookFunction_t pxHookFunction ) FREERTOS_SYSTEM_CALL; const UBaseType_t uxArraySize,
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; uint32_t * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, uint32_t MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL;
BaseType_t xIndex, void MPU_vTaskList( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
void * pvValue ) FREERTOS_SYSTEM_CALL; void MPU_vTaskGetRunTimeStats( char * pcWriteBuffer ) FREERTOS_SYSTEM_CALL;
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify,
BaseType_t xIndex ) FREERTOS_SYSTEM_CALL; UBaseType_t uxIndexToNotify,
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) FREERTOS_SYSTEM_CALL; uint32_t ulValue,
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, eNotifyAction eAction,
const UBaseType_t uxArraySize, uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL;
configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn,
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; uint32_t ulBitsToClearOnEntry,
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) FREERTOS_SYSTEM_CALL; uint32_t ulBitsToClearOnExit,
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) FREERTOS_SYSTEM_CALL; uint32_t * pulNotificationValue,
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) FREERTOS_SYSTEM_CALL; TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
UBaseType_t uxIndexToNotify, BaseType_t xClearCountOnExit,
uint32_t ulValue, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
eNotifyAction eAction, BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
uint32_t * pulPreviousNotificationValue ) FREERTOS_SYSTEM_CALL; UBaseType_t uxIndexToClear ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) FREERTOS_SYSTEM_CALL; uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
BaseType_t MPU_xTaskGenericNotifyWait( UBaseType_t uxIndexToWaitOn, UBaseType_t uxIndexToClear,
uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL;
uint32_t ulBitsToClearOnExit, BaseType_t MPU_xTaskIncrementTick( void ) FREERTOS_SYSTEM_CALL;
uint32_t * pulNotificationValue, TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL;
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn, TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t xClearCountOnExit, void MPU_vTaskMissedYield( void ) FREERTOS_SYSTEM_CALL;
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask, BaseType_t MPU_xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) FREERTOS_SYSTEM_CALL;
UBaseType_t uxIndexToClear ) FREERTOS_SYSTEM_CALL;
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask, /* MPU versions of queue.h API functions. */
UBaseType_t uxIndexToClear, BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
uint32_t ulBitsToClear ) FREERTOS_SYSTEM_CALL; const void * const pvItemToQueue,
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) FREERTOS_SYSTEM_CALL; TickType_t xTicksToWait,
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, const BaseType_t xCopyPosition ) FREERTOS_SYSTEM_CALL;
TickType_t * const pxTicksToWait ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) FREERTOS_SYSTEM_CALL; void * const pvBuffer,
BaseType_t MPU_xTaskGetSchedulerState( void ) FREERTOS_SYSTEM_CALL; TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
/* Privileged only wrappers for Task APIs. These are needed so that void * const pvBuffer,
* the application can use opaque handles maintained in mpu_wrappers.c TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
* with all the APIs. */ BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
const char * const pcName, UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
const configSTACK_DEPTH_TYPE uxStackDepth, UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
void * const pvParameters, void MPU_vQueueDelete( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
UBaseType_t uxPriority, QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION; QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType,
TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
const char * const pcName, QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
const configSTACK_DEPTH_TYPE uxStackDepth, const UBaseType_t uxInitialCount ) FREERTOS_SYSTEM_CALL;
void * const pvParameters, QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
UBaseType_t uxPriority, const UBaseType_t uxInitialCount,
StackType_t * const puxStackBuffer, StaticQueue_t * pxStaticQueue ) FREERTOS_SYSTEM_CALL;
StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION; TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete ) PRIVILEGED_FUNCTION; BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
void MPU_vTaskPrioritySet( TaskHandle_t xTask, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
UBaseType_t uxNewPriority ) PRIVILEGED_FUNCTION; BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTaskGetHandle( const char * pcNameToQuery ) PRIVILEGED_FUNCTION; void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, const char * pcName ) FREERTOS_SYSTEM_CALL;
void * pvParameter ) PRIVILEGED_FUNCTION; void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength,
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION; const UBaseType_t uxItemSize,
BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition, const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION; QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTaskToModify, const UBaseType_t uxItemSize,
const MemoryRegion_t * const xRegions ) PRIVILEGED_FUNCTION; uint8_t * pucQueueStorage,
BaseType_t MPU_xTaskGetStaticBuffers( TaskHandle_t xTask, StaticQueue_t * pxStaticQueue,
StackType_t ** ppuxStackBuffer, const uint8_t ucQueueType ) FREERTOS_SYSTEM_CALL;
StaticTask_t ** ppxTaskBuffer ) PRIVILEGED_FUNCTION; QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskPriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION; BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
UBaseType_t MPU_uxTaskBasePriorityGet( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION; QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxTaskBasePriorityGetFromISR( const TaskHandle_t xTask ) PRIVILEGED_FUNCTION; BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
BaseType_t MPU_xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION; QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL;
TaskHookFunction_t MPU_xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask ) PRIVILEGED_FUNCTION; QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
BaseType_t MPU_xTaskGenericNotifyFromISR( TaskHandle_t xTaskToNotify, const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
UBaseType_t uxIndexToNotify, BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue,
uint32_t ulValue, BaseType_t xNewQueue ) FREERTOS_SYSTEM_CALL;
eNotifyAction eAction, void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue,
uint32_t * pulPreviousNotificationValue, UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL;
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
void MPU_vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify, uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL;
UBaseType_t uxIndexToNotify,
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; /* MPU versions of timers.h API functions. */
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName,
/* MPU versions of queue.h API functions. */ const TickType_t xTimerPeriodInTicks,
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const UBaseType_t uxAutoReload,
const void * const pvItemToQueue, void * const pvTimerID,
TickType_t xTicksToWait, TimerCallbackFunction_t pxCallbackFunction ) FREERTOS_SYSTEM_CALL;
const BaseType_t xCopyPosition ) FREERTOS_SYSTEM_CALL; TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue, const TickType_t xTimerPeriodInTicks,
void * const pvBuffer, const UBaseType_t uxAutoReload,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; void * const pvTimerID,
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue, TimerCallbackFunction_t pxCallbackFunction,
void * const pvBuffer, StaticTimer_t * pxTimerBuffer ) FREERTOS_SYSTEM_CALL;
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue, void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; void * pvNewID ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, void * pvParameter1,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; uint32_t ulParameter2,
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) FREERTOS_SYSTEM_CALL; TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
const char * pcName ) FREERTOS_SYSTEM_CALL; void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
QueueSetHandle_t xQueueSet ) FREERTOS_SYSTEM_CALL; TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, BaseType_t MPU_xTimerCreateTimerTask( void ) FREERTOS_SYSTEM_CALL;
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL; BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue, const BaseType_t xCommandID,
UBaseType_t uxQueueNumber ) FREERTOS_SYSTEM_CALL; const TickType_t xOptionalValue,
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; BaseType_t * const pxHigherPriorityTaskWoken,
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue ) FREERTOS_SYSTEM_CALL; const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
/* Privileged only wrappers for Queue APIs. These are needed so that /* MPU versions of event_group.h API functions. */
* the application can use opaque handles maintained in mpu_wrappers.c EventGroupHandle_t MPU_xEventGroupCreate( void ) FREERTOS_SYSTEM_CALL;
* with all the APIs. */ EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) FREERTOS_SYSTEM_CALL;
void MPU_vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; const EventBits_t uxBitsToWaitFor,
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, const BaseType_t xClearOnExit,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; const BaseType_t xWaitForAllBits,
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION; EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const EventBits_t uxBitsToClear ) FREERTOS_SYSTEM_CALL;
const UBaseType_t uxInitialCount, EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; const EventBits_t uxBitsToSet ) FREERTOS_SYSTEM_CALL;
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
const UBaseType_t uxItemSize, const EventBits_t uxBitsToSet,
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; const EventBits_t uxBitsToWaitFor,
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
const UBaseType_t uxItemSize, void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) FREERTOS_SYSTEM_CALL;
uint8_t * pucQueueStorage, UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) FREERTOS_SYSTEM_CALL;
StaticQueue_t * pxStaticQueue,
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; /* MPU versions of message/stream_buffer.h API functions. */
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION; size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, const void * pvTxData,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; size_t xDataLengthBytes,
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION; size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
BaseType_t MPU_xQueueGenericGetStaticBuffers( QueueHandle_t xQueue, void * pvRxData,
uint8_t ** ppucQueueStorage, size_t xBufferLengthBytes,
StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION; TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueGenericSendFromISR( QueueHandle_t xQueue, size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
const void * const pvItemToQueue, void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t * const pxHigherPriorityTaskWoken, BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION; BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueGiveFromISR( QueueHandle_t xQueue, BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue, size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
void * const pvBuffer ) PRIVILEGED_FUNCTION; BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
BaseType_t MPU_xQueueReceiveFromISR( QueueHandle_t xQueue, size_t xTriggerLevel ) FREERTOS_SYSTEM_CALL;
void * const pvBuffer, StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes,
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION; size_t xTriggerLevelBytes,
BaseType_t MPU_xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; BaseType_t xIsMessageBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
UBaseType_t MPU_uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; size_t xTriggerLevelBytes,
TaskHandle_t MPU_xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION; BaseType_t xIsMessageBuffer,
QueueSetMemberHandle_t MPU_xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION; uint8_t * const pucStreamBufferStorageArea,
StaticStreamBuffer_t * const pxStaticStreamBuffer ) FREERTOS_SYSTEM_CALL;
/* 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; #endif /* MPU_PROTOTYPES_H */
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;
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,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
/* MPU versions of event_group.h API functions. */
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,
const EventBits_t uxBitsToSet ) FREERTOS_SYSTEM_CALL;
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 )
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,
const void * pvTxData,
size_t xDataLengthBytes,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
void * pvRxData,
size_t xBufferLengthBytes,
TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xStreamBufferIsEmpty( 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;
StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
size_t xTriggerLevelBytes,
BaseType_t xStreamBufferType,
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;
#endif /* MPU_PROTOTYPES_H */

View File

@@ -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 */

View File

@@ -1,276 +1,186 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ #ifndef MPU_WRAPPERS_H
#define MPU_WRAPPERS_H
#ifndef MPU_WRAPPERS_H
#define MPU_WRAPPERS_H /* This file redefines API functions to be called through a wrapper macro, but
* only for ports that are using the MPU. */
/* This file redefines API functions to be called through a wrapper macro, but #ifdef portUSING_MPU_WRAPPERS
* only for ports that are using the MPU. */ #error MPU
#if ( portUSING_MPU_WRAPPERS == 1 )
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
/* 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
* included from queue.c or task.c to prevent it from having an effect within * those files. */
* those files. */ #ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/*
/* * Map standard (non MPU) API functions to equivalents that start
* Map standard (non MPU) API functions to equivalents that start * "MPU_". This will cause the application code to call the MPU_
* "MPU_". This will cause the application code to call the MPU_ * version, which wraps the non-MPU version with privilege promoting
* version, which wraps the non-MPU version with privilege promoting * then demoting code, so the kernel code always runs will full
* then demoting code, so the kernel code always runs will full * privileges.
* privileges. */
*/
/* Map standard tasks.h API functions to the MPU equivalents. */
/* Map standard task.h API functions to the MPU equivalents. */ #define xTaskCreate MPU_xTaskCreate
#define vTaskDelay MPU_vTaskDelay #define xTaskCreateStatic MPU_xTaskCreateStatic
#define xTaskDelayUntil MPU_xTaskDelayUntil #define xTaskCreateRestricted MPU_xTaskCreateRestricted
#define xTaskAbortDelay MPU_xTaskAbortDelay #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
#define uxTaskPriorityGet MPU_uxTaskPriorityGet #define vTaskDelete MPU_vTaskDelete
#define eTaskGetState MPU_eTaskGetState #define vTaskDelay MPU_vTaskDelay
#define vTaskGetInfo MPU_vTaskGetInfo #define vTaskDelayUntil MPU_vTaskDelayUntil
#define vTaskSuspend MPU_vTaskSuspend #define xTaskAbortDelay MPU_xTaskAbortDelay
#define vTaskResume MPU_vTaskResume #define uxTaskPriorityGet MPU_uxTaskPriorityGet
#define xTaskGetTickCount MPU_xTaskGetTickCount #define eTaskGetState MPU_eTaskGetState
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks #define vTaskGetInfo MPU_vTaskGetInfo
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark #define vTaskPrioritySet MPU_vTaskPrioritySet
#define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2 #define vTaskSuspend MPU_vTaskSuspend
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag #define vTaskResume MPU_vTaskResume
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag #define vTaskSuspendAll MPU_vTaskSuspendAll
#define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer #define xTaskResumeAll MPU_xTaskResumeAll
#define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer #define xTaskGetTickCount MPU_xTaskGetTickCount
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
#define uxTaskGetSystemState MPU_uxTaskGetSystemState #define pcTaskGetName MPU_pcTaskGetName
#define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter #define xTaskGetHandle MPU_xTaskGetHandle
#define ulTaskGetIdleRunTimePercent MPU_ulTaskGetIdleRunTimePercent #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
#define xTaskGenericNotify MPU_xTaskGenericNotify #define uxTaskGetStackHighWaterMark2 MPU_uxTaskGetStackHighWaterMark2
#define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
#define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
#define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear #define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
#define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear #define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
#define vTaskSetTimeOutState MPU_vTaskSetTimeOutState #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
#define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle #define uxTaskGetSystemState MPU_uxTaskGetSystemState
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState #define vTaskList MPU_vTaskList
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
#if ( configUSE_MPU_WRAPPERS_V1 == 0 ) #define ulTaskGetIdleRunTimeCounter MPU_ulTaskGetIdleRunTimeCounter
#define ulTaskGetRunTimeCounter MPU_ulTaskGetRunTimeCounter #define xTaskGenericNotify MPU_xTaskGenericNotify
#define ulTaskGetRunTimePercent MPU_ulTaskGetRunTimePercent #define xTaskGenericNotifyWait MPU_xTaskGenericNotifyWait
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */ #define ulTaskGenericNotifyTake MPU_ulTaskGenericNotifyTake
#define xTaskGenericNotifyStateClear MPU_xTaskGenericNotifyStateClear
/* Privileged only wrappers for Task APIs. These are needed so that #define ulTaskGenericNotifyValueClear MPU_ulTaskGenericNotifyValueClear
* the application can use opaque handles maintained in mpu_wrappers.c #define xTaskCatchUpTicks MPU_xTaskCatchUpTicks
* with all the APIs. */
#define xTaskCreate MPU_xTaskCreate #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
#define xTaskCreateStatic MPU_xTaskCreateStatic #define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
#define vTaskDelete MPU_vTaskDelete #define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
#define vTaskPrioritySet MPU_vTaskPrioritySet #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
#define xTaskGetHandle MPU_xTaskGetHandle
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook /* Map standard queue.h API functions to the MPU equivalents. */
#define xQueueGenericSend MPU_xQueueGenericSend
#if ( configUSE_MPU_WRAPPERS_V1 == 0 ) #define xQueueReceive MPU_xQueueReceive
#define pcTaskGetName MPU_pcTaskGetName #define xQueuePeek MPU_xQueuePeek
#define xTaskCreateRestricted MPU_xTaskCreateRestricted #define xQueueSemaphoreTake MPU_xQueueSemaphoreTake
#define xTaskCreateRestrictedStatic MPU_xTaskCreateRestrictedStatic #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions #define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
#define xTaskGetStaticBuffers MPU_xTaskGetStaticBuffers #define vQueueDelete MPU_vQueueDelete
#define uxTaskPriorityGetFromISR MPU_uxTaskPriorityGetFromISR #define xQueueCreateMutex MPU_xQueueCreateMutex
#define uxTaskBasePriorityGet MPU_uxTaskBasePriorityGet #define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
#define uxTaskBasePriorityGetFromISR MPU_uxTaskBasePriorityGetFromISR #define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
#define xTaskResumeFromISR MPU_xTaskResumeFromISR #define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
#define xTaskGetApplicationTaskTagFromISR MPU_xTaskGetApplicationTaskTagFromISR #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
#define xTaskGenericNotifyFromISR MPU_xTaskGenericNotifyFromISR #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
#define vTaskGenericNotifyGiveFromISR MPU_vTaskGenericNotifyGiveFromISR #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */ #define xQueueGenericCreate MPU_xQueueGenericCreate
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
/* Map standard queue.h API functions to the MPU equivalents. */ #define xQueueCreateSet MPU_xQueueCreateSet
#define xQueueGenericSend MPU_xQueueGenericSend #define xQueueAddToSet MPU_xQueueAddToSet
#define xQueueReceive MPU_xQueueReceive #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
#define xQueuePeek MPU_xQueuePeek #define xQueueSelectFromSet MPU_xQueueSelectFromSet
#define xQueueSemaphoreTake MPU_xQueueSemaphoreTake #define xQueueGenericReset MPU_xQueueGenericReset
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
#define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable #if (configQUEUE_REGISTRY_SIZE > 0)
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder #define vQueueAddToRegistry MPU_vQueueAddToRegistry
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive #define pcQueueGetName MPU_pcQueueGetName
#define xQueueAddToSet MPU_xQueueAddToSet #endif
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
/* Map standard timer.h API functions to the MPU equivalents. */
#if ( configQUEUE_REGISTRY_SIZE > 0 ) #define xTimerCreate MPU_xTimerCreate
#define vQueueAddToRegistry MPU_vQueueAddToRegistry #define xTimerCreateStatic MPU_xTimerCreateStatic
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue #define pvTimerGetTimerID MPU_pvTimerGetTimerID
#define pcQueueGetName MPU_pcQueueGetName #define vTimerSetTimerID MPU_vTimerSetTimerID
#endif /* #if ( configQUEUE_REGISTRY_SIZE > 0 ) */ #define xTimerIsTimerActive MPU_xTimerIsTimerActive
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
/* Privileged only wrappers for Queue APIs. These are needed so that #define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
* the application can use opaque handles maintained in mpu_wrappers.c #define pcTimerGetName MPU_pcTimerGetName
* with all the APIs. */ #define vTimerSetReloadMode MPU_vTimerSetReloadMode
#define vQueueDelete MPU_vQueueDelete #define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
#define xQueueCreateMutex MPU_xQueueCreateMutex #define xTimerGetPeriod MPU_xTimerGetPeriod
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore #define xTimerGenericCommand MPU_xTimerGenericCommand
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
#define xQueueGenericCreate MPU_xQueueGenericCreate /* Map standard event_group.h API functions to the MPU equivalents. */
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic #define xEventGroupCreate MPU_xEventGroupCreate
#define xQueueGenericReset MPU_xQueueGenericReset #define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
#define xQueueCreateSet MPU_xQueueCreateSet #define xEventGroupWaitBits MPU_xEventGroupWaitBits
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet #define xEventGroupClearBits MPU_xEventGroupClearBits
#define xEventGroupSetBits MPU_xEventGroupSetBits
#if ( configUSE_MPU_WRAPPERS_V1 == 0 ) #define xEventGroupSync MPU_xEventGroupSync
#define xQueueGenericGetStaticBuffers MPU_xQueueGenericGetStaticBuffers #define vEventGroupDelete MPU_vEventGroupDelete
#define xQueueGenericSendFromISR MPU_xQueueGenericSendFromISR
#define xQueueGiveFromISR MPU_xQueueGiveFromISR /* Map standard message/stream_buffer.h API functions to the MPU
#define xQueuePeekFromISR MPU_xQueuePeekFromISR * equivalents. */
#define xQueueReceiveFromISR MPU_xQueueReceiveFromISR #define xStreamBufferSend MPU_xStreamBufferSend
#define xQueueIsQueueEmptyFromISR MPU_xQueueIsQueueEmptyFromISR #define xStreamBufferReceive MPU_xStreamBufferReceive
#define xQueueIsQueueFullFromISR MPU_xQueueIsQueueFullFromISR #define xStreamBufferNextMessageLengthBytes MPU_xStreamBufferNextMessageLengthBytes
#define uxQueueMessagesWaitingFromISR MPU_uxQueueMessagesWaitingFromISR #define vStreamBufferDelete MPU_vStreamBufferDelete
#define xQueueGetMutexHolderFromISR MPU_xQueueGetMutexHolderFromISR #define xStreamBufferIsFull MPU_xStreamBufferIsFull
#define xQueueSelectFromSetFromISR MPU_xQueueSelectFromSetFromISR #define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
#endif /* if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */ #define xStreamBufferReset MPU_xStreamBufferReset
#define xStreamBufferSpacesAvailable MPU_xStreamBufferSpacesAvailable
/* Map standard timer.h API functions to the MPU equivalents. */ #define xStreamBufferBytesAvailable MPU_xStreamBufferBytesAvailable
#define pvTimerGetTimerID MPU_pvTimerGetTimerID #define xStreamBufferSetTriggerLevel MPU_xStreamBufferSetTriggerLevel
#define vTimerSetTimerID MPU_vTimerSetTimerID #define xStreamBufferGenericCreate MPU_xStreamBufferGenericCreate
#define xTimerIsTimerActive MPU_xTimerIsTimerActive #define xStreamBufferGenericCreateStatic MPU_xStreamBufferGenericCreateStatic
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
#define xTimerGenericCommandFromTask MPU_xTimerGenericCommandFromTask /* Remove the privileged function macro, but keep the PRIVILEGED_DATA
#define pcTimerGetName MPU_pcTimerGetName * macro so applications can place data in privileged access sections
#define vTimerSetReloadMode MPU_vTimerSetReloadMode * (useful when using statically allocated objects). */
#define uxTimerGetReloadMode MPU_uxTimerGetReloadMode #define PRIVILEGED_FUNCTION
#define xTimerGetPeriod MPU_xTimerGetPeriod #define PRIVILEGED_DATA __attribute__((section("privileged_data")))
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime #define FREERTOS_SYSTEM_CALL
/* Privileged only wrappers for Timer APIs. These are needed so that #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
* the application can use opaque handles maintained in mpu_wrappers.c
* with all the APIs. */ /* Ensure API functions go in the privileged execution section. */
#if ( configUSE_MPU_WRAPPERS_V1 == 0 ) #define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions")))
#define xTimerGetReloadMode MPU_xTimerGetReloadMode #define PRIVILEGED_DATA __attribute__((section("privileged_data")))
#define xTimerCreate MPU_xTimerCreate #define FREERTOS_SYSTEM_CALL __attribute__((section("freertos_system_calls")))
#define xTimerCreateStatic MPU_xTimerCreateStatic
#define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer #endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
#define xTimerGenericCommandFromISR MPU_xTimerGenericCommandFromISR
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */ #else /* portUSING_MPU_WRAPPERS */
/* Map standard event_group.h API functions to the MPU equivalents. */ #define PRIVILEGED_FUNCTION
#define xEventGroupWaitBits MPU_xEventGroupWaitBits #define PRIVILEGED_DATA
#define xEventGroupClearBits MPU_xEventGroupClearBits #define FREERTOS_SYSTEM_CALL
#define xEventGroupSetBits MPU_xEventGroupSetBits #define portUSING_MPU_WRAPPERS 0
#define xEventGroupSync MPU_xEventGroupSync
#endif /* portUSING_MPU_WRAPPERS */
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
#define uxEventGroupGetNumber MPU_uxEventGroupGetNumber #endif /* MPU_WRAPPERS_H */
#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 xStreamBufferIsFull MPU_xStreamBufferIsFull
#define xStreamBufferIsEmpty MPU_xStreamBufferIsEmpty
#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 ) */
#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 */
#define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
#define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
#else /* portUSING_MPU_WRAPPERS */
#define PRIVILEGED_FUNCTION
#define PRIVILEGED_DATA
#define FREERTOS_SYSTEM_CALL
#endif /* portUSING_MPU_WRAPPERS */
#endif /* MPU_WRAPPERS_H */

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -1,259 +1,216 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ /*-----------------------------------------------------------
* Portable layer API. Each function must be defined for each port.
/*----------------------------------------------------------- *----------------------------------------------------------*/
* Portable layer API. Each function must be defined for each port.
*----------------------------------------------------------*/ #ifndef PORTABLE_H
#define PORTABLE_H
#ifndef PORTABLE_H
#define PORTABLE_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
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a * portmacro.h file for the port being used. That scheme was deprecated in favour
* pre-processor definition was used to ensure the pre-processor found the correct * of setting the compiler's include path such that it found the correct
* portmacro.h file for the port being used. That scheme was deprecated in favour * portmacro.h file - removing the need for the constant and allowing the
* of setting the compiler's include path such that it found the correct * portmacro.h file to be located anywhere in relation to the port being used.
* portmacro.h file - removing the need for the constant and allowing the * Purely for reasons of backward compatibility the old method is still valid, but
* portmacro.h file to be located anywhere in relation to the port being used. * to make it clear that new projects should not use it, support for the port
* Purely for reasons of backward compatibility the old method is still valid, but * specific constants has been moved into the deprecated_definitions.h header
* to make it clear that new projects should not use it, support for the port * file. */
* specific constants has been moved into the deprecated_definitions.h header #include "deprecated_definitions.h"
* file. */
/* If portENTER_CRITICAL is not defined then including 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
* did not result in a portmacro.h header file being included - and it should be * included here. In this case the path to the correct portmacro.h header file
* included here. In this case the path to the correct portmacro.h header file * must be set in the compiler's include path. */
* must be set in the compiler's include path. */ #ifndef portENTER_CRITICAL
#ifndef portENTER_CRITICAL #include "portmacro.h"
#include "portmacro.h" #endif
#endif
#if portBYTE_ALIGNMENT == 32
#if portBYTE_ALIGNMENT == 32 #define portBYTE_ALIGNMENT_MASK ( 0x001f )
#define portBYTE_ALIGNMENT_MASK (0x001f) #endif
#elif portBYTE_ALIGNMENT == 16
#define portBYTE_ALIGNMENT_MASK (0x000f) #if portBYTE_ALIGNMENT == 16
#elif portBYTE_ALIGNMENT == 8 #define portBYTE_ALIGNMENT_MASK ( 0x000f )
#define portBYTE_ALIGNMENT_MASK (0x0007) #endif
#elif portBYTE_ALIGNMENT == 4
#define portBYTE_ALIGNMENT_MASK (0x0003) #if portBYTE_ALIGNMENT == 8
#elif portBYTE_ALIGNMENT == 2 #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
#define portBYTE_ALIGNMENT_MASK (0x0001) #endif
#elif portBYTE_ALIGNMENT == 1
#define portBYTE_ALIGNMENT_MASK (0x0000) #if portBYTE_ALIGNMENT == 4
#else /* if portBYTE_ALIGNMENT == 32 */ #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
#error "Invalid portBYTE_ALIGNMENT definition" #endif
#endif /* if portBYTE_ALIGNMENT == 32 */
#if portBYTE_ALIGNMENT == 2
#ifndef portUSING_MPU_WRAPPERS #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
#define portUSING_MPU_WRAPPERS 0 #endif
#endif
#if portBYTE_ALIGNMENT == 1
#ifndef portNUM_CONFIGURABLE_REGIONS #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
#define portNUM_CONFIGURABLE_REGIONS 1 #endif
#endif
#ifndef portBYTE_ALIGNMENT_MASK
#ifndef portHAS_STACK_OVERFLOW_CHECKING #error "Invalid portBYTE_ALIGNMENT definition"
#define portHAS_STACK_OVERFLOW_CHECKING 0 #endif
#endif
#ifndef portNUM_CONFIGURABLE_REGIONS
#ifndef portARCH_NAME #define portNUM_CONFIGURABLE_REGIONS 1
#define portARCH_NAME NULL #endif
#endif
#ifndef portHAS_STACK_OVERFLOW_CHECKING
#ifndef configSTACK_DEPTH_TYPE #define portHAS_STACK_OVERFLOW_CHECKING 0
#define configSTACK_DEPTH_TYPE StackType_t #endif
#endif
#ifndef portARCH_NAME
#ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP #define portARCH_NAME NULL
/* Defaults to 0 for backward compatibility. */ #endif
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
#endif /* *INDENT-OFF* */
#ifdef __cplusplus
/* *INDENT-OFF* */ extern "C" {
#ifdef __cplusplus #endif
extern "C" { /* *INDENT-ON* */
#endif
/* *INDENT-ON* */ #include "mpu_wrappers.h"
#include "mpu_wrappers.h" /*
* Setup the stack of a new task so it is ready to be placed under the
/* * scheduler control. The registers have to be placed on the stack in
* Setup the stack of a new task so it is ready to be placed under the * the order that the port expects to find them.
* scheduler control. The registers have to be placed on the stack in *
* the order that the port expects to find them. */
* #if ( portUSING_MPU_WRAPPERS == 1 )
*/ #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
#if (portUSING_MPU_WRAPPERS == 1) StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
#if (portHAS_STACK_OVERFLOW_CHECKING == 1) StackType_t * pxEndOfStack,
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged, TaskFunction_t pxCode,
xMPU_SETTINGS *xMPUSettings) PRIVILEGED_FUNCTION; void * pvParameters,
#else BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged, xMPU_SETTINGS *xMPUSettings) PRIVILEGED_FUNCTION; #else
#endif /* if ( portHAS_STACK_OVERFLOW_CHECKING == 1 ) */ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */ TaskFunction_t pxCode,
#if (portHAS_STACK_OVERFLOW_CHECKING == 1) void * pvParameters,
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, StackType_t *pxEndOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION; BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
#else #endif
StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters) PRIVILEGED_FUNCTION; #else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
#endif #if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
StackType_t * pxEndOfStack,
/* Used by heap_5.c to define the start address and size of each memory region TaskFunction_t pxCode,
* that together comprise the total FreeRTOS heap space. */ void * pvParameters ) PRIVILEGED_FUNCTION;
typedef struct HeapRegion { #else
uint8_t *pucStartAddress; StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
size_t xSizeInBytes; TaskFunction_t pxCode,
} HeapRegion_t; void * pvParameters ) PRIVILEGED_FUNCTION;
#endif
/* Used to pass information about the heap out of vPortGetHeapStats(). */ #endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
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. */ /* Used by heap_5.c to define the start address and size of each memory region
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */ * that together comprise the total FreeRTOS heap space. */
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */ typedef struct HeapRegion
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */ {
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */ uint8_t * pucStartAddress;
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */ size_t xSizeInBytes;
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */ } HeapRegion_t;
} HeapStats_t;
/* Used to pass information about the heap out of vPortGetHeapStats(). */
/* typedef struct xHeapStats
* Used to define multiple heap regions for use by heap_5.c. This function {
* must be called before any calls to pvPortMalloc() - not creating a task, 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. */
* queue, semaphore, mutex, software timer, event group, etc. will result in size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
* pvPortMalloc being called. size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
* size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
* pxHeapRegions passes in an array of HeapRegion_t structures - each of which size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
* defines a region of memory that can be used as the heap. The array is size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
* terminated by a HeapRegions_t structure that has a size of 0. The region size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
* with the lowest start address must appear first in the array. } HeapStats_t;
*/
void vPortDefineHeapRegions(const HeapRegion_t *const pxHeapRegions) PRIVILEGED_FUNCTION; /*
* Used to define multiple heap regions for use by heap_5.c. This function
/* * must be called before any calls to pvPortMalloc() - not creating a task,
* Returns a HeapStats_t structure filled with information about the current * queue, semaphore, mutex, software timer, event group, etc. will result in
* heap state. * pvPortMalloc being called.
*/ *
void vPortGetHeapStats(HeapStats_t *pxHeapStats); * pxHeapRegions passes in an array of HeapRegion_t structures - each of which
* defines a region of memory that can be used as the heap. The array is
/* * terminated by a HeapRegions_t structure that has a size of 0. The region
* Map to the memory management routines required for the port. * with the lowest start address must appear first in the array.
*/ */
void *pvPortMalloc(size_t xWantedSize) PRIVILEGED_FUNCTION; void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
void *pvPortCalloc(size_t xNum, size_t xSize) PRIVILEGED_FUNCTION;
void vPortFree(void *pv) PRIVILEGED_FUNCTION; /*
void vPortInitialiseBlocks(void) PRIVILEGED_FUNCTION; * Returns a HeapStats_t structure filled with information about the current
size_t xPortGetFreeHeapSize(void) PRIVILEGED_FUNCTION; * heap state.
size_t xPortGetMinimumEverFreeHeapSize(void) PRIVILEGED_FUNCTION; */
void vPortGetHeapStats( HeapStats_t * pxHeapStats );
#if (configSTACK_ALLOCATION_FROM_SEPARATE_HEAP == 1)
void *pvPortMallocStack(size_t xSize) PRIVILEGED_FUNCTION; /*
void vPortFreeStack(void *pv) PRIVILEGED_FUNCTION; * Map to the memory management routines required for the port.
#else */
#define pvPortMallocStack pvPortMalloc void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
#define vPortFreeStack vPortFree void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
#endif void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
/* size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
* This function resets the internal state of the heap module. It must be called
* by the application before restarting the scheduler. /*
*/ * Setup the hardware ready for the scheduler to take control. This generally
void vPortHeapResetState(void) PRIVILEGED_FUNCTION; * sets up a tick interrupt and sets timers for the correct tick frequency.
*/
#if (configUSE_MALLOC_FAILED_HOOK == 1) BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
/** /*
* task.h * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
* @code{c} * the hardware is left in its original condition after the scheduler stops
* void vApplicationMallocFailedHook( void ) * executing.
* @endcode */
* void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
* This hook function is called when allocation failed.
*/ /*
void vApplicationMallocFailedHook(void); * The structures and methods of manipulating the MPU are contained within the
#endif * port layer.
*
/* * Fills the xMPUSettings structure with the memory region information
* Setup the hardware ready for the scheduler to take control. This generally * contained in xRegions.
* sets up a tick interrupt and sets timers for the correct tick frequency. */
*/ #if ( portUSING_MPU_WRAPPERS == 1 )
BaseType_t xPortStartScheduler(void) PRIVILEGED_FUNCTION; struct xMEMORY_REGION;
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
/* const struct xMEMORY_REGION * const xRegions,
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so StackType_t * pxBottomOfStack,
* the hardware is left in its original condition after the scheduler stops uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
* executing. #endif
*/
void vPortEndScheduler(void) PRIVILEGED_FUNCTION; /* *INDENT-OFF* */
#ifdef __cplusplus
/* }
* The structures and methods of manipulating the MPU are contained within the #endif
* port layer. /* *INDENT-ON* */
*
* Fills the xMPUSettings structure with the memory region information #endif /* PORTABLE_H */
* contained in xRegions.
*/
#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;
#endif
/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* PORTABLE_H */

View File

@@ -1,138 +1,120 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ #ifndef PROJDEFS_H
#define PROJDEFS_H
#ifndef PROJDEFS_H
#define PROJDEFS_H /*
* Defines the prototype to which task functions must conform. Defined in this
/* * file to ensure the type is known before portable.h is included.
* 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 * );
*/
typedef void (* TaskFunction_t)( void * arg ); /* 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
/* Converts a time in milliseconds to a time in ticks. This macro can be * definition here is not suitable for your application. */
* overridden by a macro of the same name defined in FreeRTOSConfig.h in case the #ifndef pdMS_TO_TICKS
* definition here is not suitable for your application. */ #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000U ) )
#ifndef pdMS_TO_TICKS #endif
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInMs ) * ( uint64_t ) configTICK_RATE_HZ ) / ( uint64_t ) 1000U ) )
#endif #define pdFALSE ( ( BaseType_t ) 0 )
#define pdTRUE ( ( BaseType_t ) 1 )
/* 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 #define pdPASS ( pdTRUE )
* definition here is not suitable for your application. */ #define pdFAIL ( pdFALSE )
#ifndef pdTICKS_TO_MS #define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
#define pdTICKS_TO_MS( xTimeInTicks ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInTicks ) * ( uint64_t ) 1000U ) / ( uint64_t ) configTICK_RATE_HZ ) ) #define errQUEUE_FULL ( ( BaseType_t ) 0 )
#endif
/* FreeRTOS error definitions. */
#define pdFALSE ( ( BaseType_t ) 0 ) #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
#define pdTRUE ( ( BaseType_t ) 1 ) #define errQUEUE_BLOCKED ( -4 )
#define pdFALSE_SIGNED ( ( BaseType_t ) 0 ) #define errQUEUE_YIELD ( -5 )
#define pdTRUE_SIGNED ( ( BaseType_t ) 1 )
#define pdFALSE_UNSIGNED ( ( UBaseType_t ) 0 ) /* Macros used for basic data corruption checks. */
#define pdTRUE_UNSIGNED ( ( UBaseType_t ) 1 ) #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
#define pdPASS ( pdTRUE ) #endif
#define pdFAIL ( pdFALSE )
#define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) #if ( configUSE_16_BIT_TICKS == 1 )
#define errQUEUE_FULL ( ( BaseType_t ) 0 ) #define pdINTEGRITY_CHECK_VALUE 0x5a5a
#else
/* FreeRTOS error definitions. */ #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
#define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) #endif
#define errQUEUE_BLOCKED ( -4 )
#define errQUEUE_YIELD ( -5 ) /* The following errno values are used by FreeRTOS+ components, not FreeRTOS
* itself. */
/* Macros used for basic data corruption checks. */ #define pdFREERTOS_ERRNO_NONE 0 /* No errors */
#ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
#define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 #define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
#endif #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS ) #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
#define pdINTEGRITY_CHECK_VALUE 0x5a5a #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS ) #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS ) #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
#define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5a5a5a5a5aULL #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
#else #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
#error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width. #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
#endif #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
/* The following errno values are used by FreeRTOS+ components, not FreeRTOS #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
* itself. */ #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
#define pdFREERTOS_ERRNO_NONE 0 /* No errors */ #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
#define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */ #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
#define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */ #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
#define pdFREERTOS_ERRNO_EIO 5 /* I/O error */ #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
#define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */ #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
#define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */ #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
#define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */ #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
#define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */ #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
#define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */ #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
#define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */ #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
#define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */ #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */ #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
#define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */ #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
#define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */ #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
#define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */ #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
#define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */ #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
#define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */ #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
#define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */ #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
#define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */ #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
#define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */ #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
#define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */ #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
#define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */ #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
#define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */ #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
#define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
#define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */ /* The following endian values are used by FreeRTOS+ components, not FreeRTOS
#define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */ * itself. */
#define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */ #define pdFREERTOS_LITTLE_ENDIAN 0
#define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define pdFREERTOS_BIG_ENDIAN 1
#define pdFREERTOS_ERRNO_EAFNOSUPPORT 97 /* Address family not supported by protocol */
#define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */ /* Re-defining endian values for generic naming. */
#define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */ #define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN
#define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */ #define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN
#define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
#define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
#define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */ #endif /* PROJDEFS_H */
#define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
#define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
#define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
#define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
#define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
#define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
/* The following endian values are used by FreeRTOS+ components, not FreeRTOS
* itself. */
#define pdFREERTOS_LITTLE_ENDIAN 0
#define pdFREERTOS_BIG_ENDIAN 1
/* Re-defining endian values for generic naming. */
#define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN
#define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN
#endif /* PROJDEFS_H */

View File

@@ -1,8 +1,6 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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 * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -79,12 +77,12 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* QueueHandle_t xQueueCreate( * QueueHandle_t xQueueCreate(
* UBaseType_t uxQueueLength, * UBaseType_t uxQueueLength,
* UBaseType_t uxItemSize * UBaseType_t uxItemSize
* ); * );
* @endcode * </pre>
* *
* Creates a new queue instance, and returns a handle by which the new queue * Creates a new queue instance, and returns a handle by which the new queue
* can be referenced. * can be referenced.
@@ -113,7 +111,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* returned. * returned.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
@@ -141,7 +139,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueCreate xQueueCreate * \defgroup xQueueCreate xQueueCreate
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -151,14 +149,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* QueueHandle_t xQueueCreateStatic( * QueueHandle_t xQueueCreateStatic(
* UBaseType_t uxQueueLength, * UBaseType_t uxQueueLength,
* UBaseType_t uxItemSize, * UBaseType_t uxItemSize,
* uint8_t *pucQueueStorage, * uint8_t *pucQueueStorageBuffer,
* StaticQueue_t *pxQueueBuffer * StaticQueue_t *pxQueueBuffer
* ); * );
* @endcode * </pre>
* *
* Creates a new queue instance, and returns a handle by which the new queue * Creates a new queue instance, and returns a handle by which the new queue
* can be referenced. * 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 * that will be copied for each posted item. Each item on the queue must be
* the same size. * the same size.
* *
* @param pucQueueStorage If uxItemSize is not zero then * @param pucQueueStorageBuffer If uxItemSize is not zero then
* pucQueueStorage must point to a uint8_t array that is at least large * 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 * 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 * 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 * @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which
* will be used to hold the queue's data structure. * 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. * returned. If pxQueueBuffer is NULL then NULL is returned.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
@@ -214,7 +212,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* void vATask( void *pvParameters ) * void vATask( void *pvParameters )
* { * {
* QueueHandle_t xQueue1; * QueueHandle_t xQueue1;
* *
* // Create a queue capable of containing 10 uint32_t values. * // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold. * xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold.
@@ -227,7 +225,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueCreateStatic xQueueCreateStatic * \defgroup xQueueCreateStatic xQueueCreateStatic
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -237,42 +235,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueGetStaticBuffers( QueueHandle_t xQueue, * BaseType_t xQueueSendToToFront(
* 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(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void *pvItemToQueue, * const void *pvItemToQueue,
* TickType_t xTicksToWait * TickType_t xTicksToWait
* ); * );
* @endcode * </pre>
* *
* Post an item to the front of a queue. The item is queued by copy, not by * 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 * 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. * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
* char ucData[ 20 ]; * char ucData[ 20 ];
* } xMessage; * } xMessage;
* *
* uint32_t ulVar = 10U; * uint32_t ulVar = 10UL;
* *
* void vATask( void *pvParameters ) * void vATask( void *pvParameters )
* { * {
@@ -338,7 +307,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueSend xQueueSend * \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -347,13 +316,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueSendToBack( * BaseType_t xQueueSendToBack(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void *pvItemToQueue, * const void *pvItemToQueue,
* TickType_t xTicksToWait * TickType_t xTicksToWait
* ); * );
* @endcode * </pre>
* *
* This is a macro that calls xQueueGenericSend(). * 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. * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
* char ucData[ 20 ]; * char ucData[ 20 ];
* } xMessage; * } xMessage;
* *
* uint32_t ulVar = 10U; * uint32_t ulVar = 10UL;
* *
* void vATask( void *pvParameters ) * void vATask( void *pvParameters )
* { * {
@@ -421,7 +390,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueSend xQueueSend * \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -430,13 +399,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueSend( * BaseType_t xQueueSend(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void * pvItemToQueue, * const void * pvItemToQueue,
* TickType_t xTicksToWait * TickType_t xTicksToWait
* ); * );
* @endcode * </pre>
* *
* This is a macro that calls xQueueGenericSend(). It is included for * This is a macro that calls xQueueGenericSend(). It is included for
* backward compatibility with versions of FreeRTOS.org that did not * 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. * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
* char ucData[ 20 ]; * char ucData[ 20 ];
* } xMessage; * } xMessage;
* *
* uint32_t ulVar = 10U; * uint32_t ulVar = 10UL;
* *
* void vATask( void *pvParameters ) * void vATask( void *pvParameters )
* { * {
@@ -506,7 +475,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueSend xQueueSend * \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -515,12 +484,12 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueOverwrite( * BaseType_t xQueueOverwrite(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void * pvItemToQueue * const void * pvItemToQueue
* ); * );
* @endcode * </pre>
* *
* Only for use with queues that have a length of one - so the queue is either * Only for use with queues that have a length of one - so the queue is either
* empty or full. * empty or full.
@@ -544,7 +513,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* to the queue even when the queue is already full. * to the queue even when the queue is already full.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* *
* void vFunction( void *pvParameters ) * void vFunction( void *pvParameters )
* { * {
@@ -590,7 +559,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... * // ...
* } * }
* @endcode * </pre>
* \defgroup xQueueOverwrite xQueueOverwrite * \defgroup xQueueOverwrite xQueueOverwrite
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -600,14 +569,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueGenericSend( * BaseType_t xQueueGenericSend(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void * pvItemToQueue, * const void * pvItemToQueue,
* TickType_t xTicksToWait * TickType_t xTicksToWait
* BaseType_t xCopyPosition * BaseType_t xCopyPosition
* ); * );
* @endcode * </pre>
* *
* It is preferred that the macros xQueueSend(), xQueueSendToFront() and * It is preferred that the macros xQueueSend(), xQueueSendToFront() and
* xQueueSendToBack() are used in place of calling this function directly. * 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. * @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
* char ucData[ 20 ]; * char ucData[ 20 ];
* } xMessage; * } xMessage;
* *
* uint32_t ulVar = 10U; * uint32_t ulVar = 10UL;
* *
* void vATask( void *pvParameters ) * void vATask( void *pvParameters )
* { * {
@@ -679,7 +648,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueSend xQueueSend * \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -690,13 +659,13 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueuePeek( * BaseType_t xQueuePeek(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* void * const pvBuffer, * void * const pvBuffer,
* TickType_t xTicksToWait * TickType_t xTicksToWait
* ); * );
* @endcode * </pre>
* *
* Receive an item from a queue without removing the item from the queue. * 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 * 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. * otherwise pdFALSE.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
@@ -777,7 +746,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueuePeek xQueuePeek * \defgroup xQueuePeek xQueuePeek
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -787,12 +756,12 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueuePeekFromISR( * BaseType_t xQueuePeekFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* void *pvBuffer, * void *pvBuffer,
* ); * );
* @endcode * </pre>
* *
* A version of xQueuePeek() that can be called from an interrupt service * A version of xQueuePeek() that can be called from an interrupt service
* routine (ISR). * routine (ISR).
@@ -822,13 +791,13 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueReceive( * BaseType_t xQueueReceive(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* void *pvBuffer, * void *pvBuffer,
* TickType_t xTicksToWait * TickType_t xTicksToWait
* ); * );
* @endcode * </pre>
* *
* Receive an item from a queue. The item is received by copy so a buffer of * 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 * 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. * otherwise pdFALSE.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* struct AMessage * struct AMessage
* { * {
* char ucMessageID; * char ucMessageID;
@@ -906,7 +875,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
* *
* // ... Rest of task code. * // ... Rest of task code.
* } * }
* @endcode * </pre>
* \defgroup xQueueReceive xQueueReceive * \defgroup xQueueReceive xQueueReceive
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -916,9 +885,9 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ); * UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
* @endcode * </pre>
* *
* Return the number of messages stored in a queue. * Return the number of messages stored in a queue.
* *
@@ -933,9 +902,9 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNC
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ); * UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
* @endcode * </pre>
* *
* Return the number of free spaces available in a queue. This is equal to the * 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 * 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 * queue. h
* @code{c} * <pre>
* void vQueueDelete( QueueHandle_t xQueue ); * void vQueueDelete( QueueHandle_t xQueue );
* @endcode * </pre>
* *
* Delete a queue - freeing all the memory allocated for storing of items * Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue. * placed on the queue.
@@ -968,13 +937,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueSendToFrontFromISR( * BaseType_t xQueueSendToFrontFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void *pvItemToQueue, * const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken * BaseType_t *pxHigherPriorityTaskWoken
* ); * );
* @endcode * </pre>
* *
* This is a macro that calls xQueueGenericSendFromISR(). * This is a macro that calls xQueueGenericSendFromISR().
* *
@@ -995,7 +964,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set * @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task * *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently * 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. * a context switch should be requested before the interrupt is exited.
* *
* @return pdTRUE if the data was successfully sent to the queue, otherwise * @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 * Example usage for buffered IO (where the ISR can obtain more than one value
* per call): * per call):
* @code{c} * <pre>
* void vBufferISR( void ) * void vBufferISR( void )
* { * {
* char cIn; * char cIn;
* BaseType_t xHigherPriorityTaskWoken; * BaseType_t xHigherPrioritTaskWoken;
* *
* // We have not woken a task at the start of the ISR. * // We have not woken a task at the start of the ISR.
* xHigherPriorityTaskWoken = pdFALSE; * xHigherPriorityTaskWoken = pdFALSE;
@@ -1029,7 +998,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* taskYIELD (); * taskYIELD ();
* } * }
* } * }
* @endcode * </pre>
* *
* \defgroup xQueueSendFromISR xQueueSendFromISR * \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement * \ingroup QueueManagement
@@ -1040,13 +1009,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueSendToBackFromISR( * BaseType_t xQueueSendToBackFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void *pvItemToQueue, * const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken * BaseType_t *pxHigherPriorityTaskWoken
* ); * );
* @endcode * </pre>
* *
* This is a macro that calls xQueueGenericSendFromISR(). * 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 * Example usage for buffered IO (where the ISR can obtain more than one value
* per call): * per call):
* @code{c} * <pre>
* void vBufferISR( void ) * void vBufferISR( void )
* { * {
* char cIn; * char cIn;
@@ -1101,7 +1070,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* taskYIELD (); * taskYIELD ();
* } * }
* } * }
* @endcode * </pre>
* *
* \defgroup xQueueSendFromISR xQueueSendFromISR * \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement * \ingroup QueueManagement
@@ -1111,13 +1080,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueOverwriteFromISR( * BaseType_t xQueueOverwriteFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void * pvItemToQueue, * const void * pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken * BaseType_t *pxHigherPriorityTaskWoken
* ); * );
* @endcode * </pre>
* *
* A version of xQueueOverwrite() that can be used in an interrupt service * A version of xQueueOverwrite() that can be used in an interrupt service
* routine (ISR). * routine (ISR).
@@ -1148,7 +1117,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* the queue is already full. * the queue is already full.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* *
* QueueHandle_t xQueue; * QueueHandle_t xQueue;
* *
@@ -1185,15 +1154,12 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* { * {
* // Writing to the queue caused a task to unblock and the unblocked task * // Writing to the queue caused a task to unblock and the unblocked task
* // has a priority higher than or equal to the priority of the currently * // has a priority higher than or equal to the priority of the currently
* // executing task (the task this interrupt interrupted). Perform a context * // executing task (the task this interrupt interrupted). Perform a context
* // switch so this interrupt returns directly to the unblocked task. * // 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() depending on the port.
* // portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to the documentation
* // page for the port being used.
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* } * }
* } * }
* @endcode * </pre>
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR * \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
* \ingroup QueueManagement * \ingroup QueueManagement
*/ */
@@ -1202,13 +1168,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueSendFromISR( * BaseType_t xQueueSendFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void *pvItemToQueue, * const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken * BaseType_t *pxHigherPriorityTaskWoken
* ); * );
* @endcode * </pre>
* *
* This is a macro that calls xQueueGenericSendFromISR(). It is included * This is a macro that calls xQueueGenericSendFromISR(). It is included
* for backward compatibility with versions of FreeRTOS.org that did not * 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 * Example usage for buffered IO (where the ISR can obtain more than one value
* per call): * per call):
* @code{c} * <pre>
* void vBufferISR( void ) * void vBufferISR( void )
* { * {
* char cIn; * char cIn;
@@ -1263,14 +1229,11 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* // Now the buffer is empty we can switch context if necessary. * // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWoken ) * if( xHigherPriorityTaskWoken )
* { * {
* // As xHigherPriorityTaskWoken is now set to pdTRUE then a context * // Actual macro used here is port specific.
* // switch should be requested. The macro used is port specific and * portYIELD_FROM_ISR ();
* // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
* // refer to the documentation page for the port being used.
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* } * }
* } * }
* @endcode * </pre>
* *
* \defgroup xQueueSendFromISR xQueueSendFromISR * \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement * \ingroup QueueManagement
@@ -1280,14 +1243,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueGenericSendFromISR( * BaseType_t xQueueGenericSendFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* const void *pvItemToQueue, * const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken, * BaseType_t *pxHigherPriorityTaskWoken,
* BaseType_t xCopyPosition * BaseType_t xCopyPosition
* ); * );
* @endcode * </pre>
* *
* It is preferred that the macros xQueueSendFromISR(), * It is preferred that the macros xQueueSendFromISR(),
* xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place * 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 * Example usage for buffered IO (where the ISR can obtain more than one value
* per call): * per call):
* @code{c} * <pre>
* void vBufferISR( void ) * void vBufferISR( void )
* { * {
* char cIn; * char cIn;
@@ -1343,17 +1306,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* *
* } while( portINPUT_BYTE( BUFFER_COUNT ) ); * } 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 ) * if( xHigherPriorityTaskWokenByPost )
* { * {
* // As xHigherPriorityTaskWokenByPost is now set to pdTRUE then a context * portYIELD_FROM_ISR();
* // 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 );
* } * }
* } * }
* @endcode * </pre>
* *
* \defgroup xQueueSendFromISR xQueueSendFromISR * \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement * \ingroup QueueManagement
@@ -1367,13 +1327,13 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
/** /**
* queue. h * queue. h
* @code{c} * <pre>
* BaseType_t xQueueReceiveFromISR( * BaseType_t xQueueReceiveFromISR(
* QueueHandle_t xQueue, * QueueHandle_t xQueue,
* void *pvBuffer, * void *pvBuffer,
* BaseType_t *pxTaskWoken * BaseType_t *pxTaskWoken
* ); * );
* @endcode * </pre>
* *
* Receive an item from a queue. It is safe to use this function from within an * Receive an item from a queue. It is safe to use this function from within an
* interrupt service routine. * 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 * @param pvBuffer Pointer to the buffer into which the received item will
* be copied. * be copied.
* *
* @param pxHigherPriorityTaskWoken A task may be blocked waiting for space to * @param pxTaskWoken A task may be blocked waiting for space to become
* become available on the queue. If xQueueReceiveFromISR causes such a task * available on the queue. If xQueueReceiveFromISR causes such a task to
* to unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will * unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
* remain unchanged. * remain unchanged.
* *
* @return pdTRUE if an item was successfully received from the queue, * @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE. * otherwise pdFALSE.
* *
* Example usage: * Example usage:
* @code{c} * <pre>
* *
* QueueHandle_t xQueue; * QueueHandle_t xQueue;
* *
@@ -1438,17 +1398,17 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* vOutputCharacter( cRxedChar ); * vOutputCharacter( cRxedChar );
* *
* // If removing the character from the queue woke the task that was * // 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 * // pdTRUE. No matter how many times this loop iterates only one
* // task will be woken. * // task will be woken.
* } * }
* *
* if( xTaskWokenByReceive != ( char ) pdFALSE; * if( cTaskWokenByPost != ( char ) pdFALSE;
* { * {
* taskYIELD (); * taskYIELD ();
* } * }
* } * }
* @endcode * </pre>
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR * \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
* \ingroup QueueManagement * \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 * 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 xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueMessagesWaitingFromISR( 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 * The functions defined above are for passing data to and from tasks. The
* functions below are the equivalents for passing data to and from * functions below are the equivalents for passing data to and from
@@ -1475,20 +1433,18 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEG
* should not be called directly from application code. Instead use the macro * should not be called directly from application code. Instead use the macro
* wrappers defined within croutine.h. * wrappers defined within croutine.h.
*/ */
BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue, BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
const void * pvItemToQueue, const void * pvItemToQueue,
BaseType_t xCoRoutinePreviouslyWoken ); BaseType_t xCoRoutinePreviouslyWoken );
BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue, BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
void * pvBuffer, void * pvBuffer,
BaseType_t * pxTaskWoken ); BaseType_t * pxTaskWoken );
BaseType_t xQueueCRSend( QueueHandle_t xQueue, BaseType_t xQueueCRSend( QueueHandle_t xQueue,
const void * pvItemToQueue, const void * pvItemToQueue,
TickType_t xTicksToWait ); TickType_t xTicksToWait );
BaseType_t xQueueCRReceive( QueueHandle_t xQueue, BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
void * pvBuffer, void * pvBuffer,
TickType_t xTicksToWait ); TickType_t xTicksToWait );
#endif /* if ( configUSE_CO_ROUTINES == 1 ) */
/* /*
* For internal use only. Use xSemaphoreCreateMutex(), * For internal use only. Use xSemaphoreCreateMutex(),
@@ -1496,34 +1452,21 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEG
* these functions directly. * these functions directly.
*/ */
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType, QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION; const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
#endif QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount,
#if ( configUSE_COUNTING_SEMAPHORES == 1 ) StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
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, BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) ) TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
#endif
/* /*
* For internal use only. Use xSemaphoreTakeRecursive() or * For internal use only. Use xSemaphoreTakeMutexRecursive() or
* xSemaphoreGiveRecursive() instead of calling these functions directly. * xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
*/ */
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; 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 * Reset a queue back to its original empty state. The return value is now
* obsolete and is always set to pdPASS. * 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 * 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 * configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
* registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0 * registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
* within FreeRTOSConfig.h for the registry to be available. Its value * 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. * 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 * @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 * is the handle returned by a call to xQueueCreate(). Semaphore and mutex
* handles can also be passed in here. * 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 * 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 * stores a pointer to the string - so the string must be persistent (global or
* preferably in ROM/Flash), not on the stack. * preferably in ROM/Flash), not on the stack.
*/ */
#if ( configQUEUE_REGISTRY_SIZE > 0 ) #if ( configQUEUE_REGISTRY_SIZE > 0 )
void vQueueAddToRegistry( QueueHandle_t xQueue, 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 #endif
/* /*
@@ -1592,7 +1531,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* returned. * returned.
*/ */
#if ( configQUEUE_REGISTRY_SIZE > 0 ) #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 #endif
/* /*
@@ -1619,18 +1558,6 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION; const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
#endif #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 * Queue sets provide a mechanism to allow a task to block (pend) on a read
* operation from multiple queues or semaphores simultaneously. * 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 * or semaphores contained in the set is in a state where a queue read or
* semaphore take operation would be successful. * 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 * for reasons why queue sets are very rarely needed in practice as there are
* simpler methods of blocking on multiple objects. * 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 * @return If the queue set is created successfully then a handle to the created
* queue set is returned. Otherwise NULL is returned. * 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;
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 * 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 * queue set because it is already a member of a different queue set then pdFAIL
* is returned. * is returned.
*/ */
#if ( configUSE_QUEUE_SETS == 1 ) BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#endif
/* /*
* Removes a queue or semaphore from a queue set. A queue or semaphore can only * 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 * 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. * queue (or semaphore) was not empty, then pdFAIL is returned.
*/ */
#if ( configUSE_QUEUE_SETS == 1 ) BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#endif
/* /*
* xQueueSelectFromSet() selects from the members of a queue set a queue or * 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 * See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
* function. * 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 * for reasons why queue sets are very rarely needed in practice as there are
* simpler methods of blocking on multiple objects. * 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 * in the queue set that is available, or NULL if no such queue or semaphore
* exists before before the specified block time expires. * exists before before the specified block time expires.
*/ */
#if ( configUSE_QUEUE_SETS == 1 ) QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
#endif
/* /*
* A version of xQueueSelectFromSet() that can be used from an ISR. * A version of xQueueSelectFromSet() that can be used from an ISR.
*/ */
#if ( configUSE_QUEUE_SETS == 1 ) QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#endif
/* Not public API functions. */ /* Not public API functions. */
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
@@ -1784,22 +1701,11 @@ void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION; const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION; BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
void vQueueSetQueueNumber( QueueHandle_t xQueue,
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) 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* */ /* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus

File diff suppressed because it is too large Load Diff

View File

@@ -1,141 +1,127 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/ #ifndef STACK_MACROS_H
#define STACK_MACROS_H
#ifndef STACK_MACROS_H
#define STACK_MACROS_H /*
* Call the stack overflow hook function if the stack of the task being swapped
/* * out is currently overflowed, or looks like it might have overflowed in the
* Call the stack overflow hook function if the stack of the task being swapped * past.
* out is currently overflowed, or looks like it might have overflowed in the *
* past. * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
* * the current stack state only - comparing the current top of stack value to
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
* the current stack state only - comparing the current top of stack value to * will also cause the last few stack bytes to be checked to ensure the value
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 * to which the bytes were set when the task was created have not been
* will also cause the last few stack bytes to be checked to ensure the value * overwritten. Note this second test does not guarantee that an overflowed
* to which the bytes were set when the task was created have not been * stack will always be recognised.
* overwritten. Note this second test does not guarantee that an overflowed */
* stack will always be recognised.
*/ /*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/ #if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
/* /* Only the current stack state is to be checked. */
* portSTACK_LIMIT_PADDING is a number of extra words to consider to be in #define taskCHECK_FOR_STACK_OVERFLOW() \
* use on the stack. { \
*/ /* Is the currently saved stack pointer within the stack limit? */ \
#ifndef portSTACK_LIMIT_PADDING if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
#define portSTACK_LIMIT_PADDING 0 { \
#endif vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) }
/* Only the current stack state is to be checked. */ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
#define taskCHECK_FOR_STACK_OVERFLOW() \ /*-----------------------------------------------------------*/
do { \
/* Is the currently saved stack pointer within the stack limit? */ \ #if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack + portSTACK_LIMIT_PADDING ) \
{ \ /* Only the current stack state is to be checked. */
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ #define taskCHECK_FOR_STACK_OVERFLOW() \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ { \
} \ \
} while( 0 ) /* Is the currently saved stack pointer within the stack limit? */ \
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ { \
/*-----------------------------------------------------------*/ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) }
/* Only the current stack state is to be checked. */ #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
#define taskCHECK_FOR_STACK_OVERFLOW() \ /*-----------------------------------------------------------*/
do { \
\ #if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
/* Is the currently saved stack pointer within the stack limit? */ \
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack - portSTACK_LIMIT_PADDING ) \ #define taskCHECK_FOR_STACK_OVERFLOW() \
{ \ { \
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
} \ \
} while( 0 ) if( ( pulStack[ 0 ] != ulCheckValue ) || \
( pulStack[ 1 ] != ulCheckValue ) || \
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ ( pulStack[ 2 ] != ulCheckValue ) || \
/*-----------------------------------------------------------*/ ( pulStack[ 3 ] != ulCheckValue ) ) \
{ \
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
} \
#define taskCHECK_FOR_STACK_OVERFLOW() \ }
do { \
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5U; \ /*-----------------------------------------------------------*/
\
if( ( pulStack[ 0 ] != ulCheckValue ) || \ #if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
( pulStack[ 1 ] != ulCheckValue ) || \
( pulStack[ 2 ] != ulCheckValue ) || \ #define taskCHECK_FOR_STACK_OVERFLOW() \
( pulStack[ 3 ] != ulCheckValue ) ) \ { \
{ \ int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \ static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
} \ tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
} while( 0 ) tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ \
/*-----------------------------------------------------------*/ \
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) \
/* Has the extremity of the task stack ever been written over? */ \
#define taskCHECK_FOR_STACK_OVERFLOW() \ if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
do { \ { \
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
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, \ }
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ /*-----------------------------------------------------------*/
\
\ /* Remove stack overflow macro if not being used. */
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ #ifndef taskCHECK_FOR_STACK_OVERFLOW
\ #define taskCHECK_FOR_STACK_OVERFLOW()
/* Has the extremity of the task stack ever been written over? */ \ #endif
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
{ \
char * pcOverflowTaskName = pxCurrentTCB->pcTaskName; \
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pcOverflowTaskName ); \ #endif /* STACK_MACROS_H */
} \
} while( 0 )
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
/*-----------------------------------------------------------*/
/* Remove stack overflow macro if not being used. */
#ifndef taskCHECK_FOR_STACK_OVERFLOW
#define taskCHECK_FOR_STACK_OVERFLOW()
#endif
#endif /* STACK_MACROS_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,6 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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 * 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 * 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" #error "include FreeRTOS.h must appear in source files before include timers.h"
#endif #endif
/*lint -save -e537 This headers are only multiply included if the application code
* happens to also be including task.h. */
#include "task.h" #include "task.h"
/*lint -restore */
/* *INDENT-OFF* */ /* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
@@ -86,13 +86,13 @@ typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
* Defines the prototype to which functions used with the * Defines the prototype to which functions used with the
* xTimerPendFunctionCallFromISR() function must conform. * xTimerPendFunctionCallFromISR() function must conform.
*/ */
typedef void (* PendedFunction_t)( void * arg1, typedef void (* PendedFunction_t)( void *,
uint32_t arg2 ); uint32_t );
/** /**
* TimerHandle_t xTimerCreate( const char * const pcTimerName, * TimerHandle_t xTimerCreate( const char * const pcTimerName,
* TickType_t xTimerPeriodInTicks, * TickType_t xTimerPeriodInTicks,
* BaseType_t xAutoReload, * UBaseType_t uxAutoReload,
* void * pvTimerID, * void * pvTimerID,
* TimerCallbackFunction_t pxCallbackFunction ); * 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 * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or
* equal to 1000. Time timer period must be greater than 0. * 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. * 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. * enter the dormant state after it expires.
* *
* @param pvTimerID An identifier that is assigned to the timer being created. * @param pvTimerID An identifier that is assigned to the timer being created.
@@ -190,11 +190,11 @@ typedef void (* PendedFunction_t)( void * arg1,
* // the scheduler starts. * // the scheduler starts.
* for( x = 0; x < NUM_TIMERS; x++ ) * for( x = 0; x < NUM_TIMERS; x++ )
* { * {
* xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel. * 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. * pdTRUE, // The timers will auto-reload themselves when they expire.
* ( void * ) x, // Assign each timer a unique id equal to its array index. * ( void * ) x, // Assign each timer a unique id equal to its array index.
* vTimerCallback // Each timer calls the same callback when it expires. * vTimerCallback // Each timer calls the same callback when it expires.
* ); * );
* *
* if( xTimers[ x ] == NULL ) * if( xTimers[ x ] == NULL )
@@ -227,9 +227,9 @@ typedef void (* PendedFunction_t)( void * arg1,
* @endverbatim * @endverbatim
*/ */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #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 TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload, const UBaseType_t uxAutoReload,
void * const pvTimerID, void * const pvTimerID,
TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION; TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
#endif #endif
@@ -237,7 +237,7 @@ typedef void (* PendedFunction_t)( void * arg1,
/** /**
* TimerHandle_t xTimerCreateStatic(const char * const pcTimerName, * TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,
* TickType_t xTimerPeriodInTicks, * TickType_t xTimerPeriodInTicks,
* BaseType_t xAutoReload, * UBaseType_t uxAutoReload,
* void * pvTimerID, * void * pvTimerID,
* TimerCallbackFunction_t pxCallbackFunction, * TimerCallbackFunction_t pxCallbackFunction,
* StaticTimer_t *pxTimerBuffer ); * 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 * to ( 500 / portTICK_PERIOD_MS ) provided configTICK_RATE_HZ is less than or
* equal to 1000. The timer period must be greater than 0. * 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. * 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. * enter the dormant state after it expires.
* *
* @param pvTimerID An identifier that is assigned to the timer being created. * @param pvTimerID An identifier that is assigned to the timer being created.
@@ -357,9 +357,9 @@ typedef void (* PendedFunction_t)( void * arg1,
* @endverbatim * @endverbatim
*/ */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #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 TickType_t xTimerPeriodInTicks,
const BaseType_t xAutoReload, const UBaseType_t uxAutoReload,
void * const pvTimerID, void * const pvTimerID,
TimerCallbackFunction_t pxCallbackFunction, TimerCallbackFunction_t pxCallbackFunction,
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION; StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
@@ -1196,12 +1196,10 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
* } * }
* @endverbatim * @endverbatim
*/ */
#if ( INCLUDE_xTimerPendFunctionCall == 1 ) BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void * pvParameter1,
void * pvParameter1, uint32_t ulParameter2,
uint32_t ulParameter2, BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
#endif
/** /**
* BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, * BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
@@ -1235,12 +1233,10 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
* timer daemon task, otherwise pdFALSE is returned. * timer daemon task, otherwise pdFALSE is returned.
* *
*/ */
#if ( INCLUDE_xTimerPendFunctionCall == 1 ) BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void * pvParameter1,
void * pvParameter1, uint32_t ulParameter2,
uint32_t ulParameter2, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
#endif
/** /**
* const char * const pcTimerGetName( TimerHandle_t xTimer ); * 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. * @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 * 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 * 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 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 * expire repeatedly with a frequency set by the timer's period (see the
* xTimerPeriodInTicks parameter of the xTimerCreate() API function). If * 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. * enter the dormant state after it expires.
*/ */
void vTimerSetReloadMode( TimerHandle_t xTimer, void vTimerSetReloadMode( TimerHandle_t xTimer,
const BaseType_t xAutoReload ) PRIVILEGED_FUNCTION; const UBaseType_t uxAutoReload ) 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;
/** /**
* UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer ); * 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; 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 * Functions beyond this part are not part of the public API and are intended
* for use by the kernel only. * for use by the kernel only.
*/ */
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION; BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) 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,
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 ) #if ( configUSE_TRACE_FACILITY == 1 )
void vTimerSetTimerNumber( TimerHandle_t xTimer, void vTimerSetTimerNumber( TimerHandle_t xTimer,
UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION; UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;
@@ -1381,48 +1326,23 @@ BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/** /**
* task.h * task.h
* @code{c} * <pre>void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize ) </pre>
* void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, configSTACK_DEPTH_TYPE * puxTimerTaskStackSize ) *
* @endcode * 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
* 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 thie idle task
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer * @param pulTimerTaskStackSize 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 the idle task */
* @param puxTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
*/
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
StackType_t ** ppxTimerTaskStackBuffer, StackType_t ** ppxTimerTaskStackBuffer,
configSTACK_DEPTH_TYPE * puxTimerTaskStackSize ); uint32_t * pulTimerTaskStackSize );
#endif #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* */ /* *INDENT-OFF* */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -1,246 +1,210 @@
/* /*
* FreeRTOS Kernel V11.1.0 * FreeRTOS Kernel V10.4.1
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 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
* Permission is hereby granted, free of charge, to any person obtaining a copy of * the Software without restriction, including without limitation the rights to
* this software and associated documentation files (the "Software"), to deal in * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software without restriction, including without limitation the rights to * the Software, and to permit persons to whom the Software is furnished to do so,
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * subject to the following conditions:
* 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 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
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* 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
* https://www.FreeRTOS.org *
* https://github.com/FreeRTOS */
*
*/
#include <stdlib.h>
#include <stdlib.h> /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
* all the API functions to use the MPU wrappers. That should only be done when
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining * task.h is included from an application file. */
* all the API functions to use the MPU wrappers. That should only be done when #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
* task.h is included from an application file. */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE #include "FreeRTOS.h"
#include "list.h"
#include "FreeRTOS.h"
#include "list.h" /* 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
/* 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
* defined for the header files above, but not in this file, in order to * generate the correct privileged Vs unprivileged linkage and placement. */
* generate the correct privileged Vs unprivileged linkage and placement. */ #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/*-----------------------------------------------------------
/*----------------------------------------------------------- * PUBLIC LIST API documented in list.h
* PUBLIC LIST API documented in list.h *----------------------------------------------------------*/
*----------------------------------------------------------*/
void vListInitialise( List_t * const pxList )
void vListInitialise( List_t * const pxList ) {
{ /* The list structure contains a list item which is used to mark the
traceENTER_vListInitialise( pxList ); * end of the list. To initialise the list the list end is inserted
* as the only list entry. */
/* The list structure contains a list item which is used to mark the 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. */
* end of the list. To initialise the list the list end is inserted
* as the only list entry. */ /* The list end value is the highest possible value in the list to
pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); * ensure it remains at the end of the list. */
pxList->xListEnd.xItemValue = portMAX_DELAY;
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) );
/* The list end next and previous pointers point to itself so we know
/* The list end value is the highest possible value in the list to * when the list is empty. */
* ensure it remains at the end of the list. */ 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.xItemValue = portMAX_DELAY; 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. */
/* The list end next and previous pointers point to itself so we know pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
* when the list is empty. */
pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /* Write known values into the list if
pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd ); * configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
/* Initialize the remaining fields of xListEnd when it is a proper ListItem_t */ listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
#if ( configUSE_MINI_LIST_ITEM == 0 ) }
{ /*-----------------------------------------------------------*/
pxList->xListEnd.pvOwner = NULL;
pxList->xListEnd.pxContainer = NULL; void vListInitialiseItem( ListItem_t * const pxItem )
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( &( pxList->xListEnd ) ); {
} /* Make sure the list item is not recorded as being on a list. */
#endif pxItem->pxContainer = NULL;
pxList->uxNumberOfItems = ( UBaseType_t ) 0U; /* Write known values into the list item if
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
/* Write known values into the list if listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ); }
listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ); /*-----------------------------------------------------------*/
traceRETURN_vListInitialise(); void vListInsertEnd( List_t * const pxList,
} ListItem_t * const pxNewListItem )
/*-----------------------------------------------------------*/ {
ListItem_t * const pxIndex = pxList->pxIndex;
void vListInitialiseItem( ListItem_t * const pxItem )
{ /* Only effective when configASSERT() is also defined, these tests may catch
traceENTER_vListInitialiseItem( pxItem ); * the list data structures being overwritten in memory. They will not catch
* data errors caused by incorrect configuration or use of FreeRTOS. */
/* Make sure the list item is not recorded as being on a list. */ listTEST_LIST_INTEGRITY( pxList );
pxItem->pxContainer = NULL; listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
/* Write known values into the list item if /* Insert a new list item into pxList, but rather than sort the list,
* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ * makes the new list item the last item to be removed by a call to
listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ); * listGET_OWNER_OF_NEXT_ENTRY(). */
listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ); pxNewListItem->pxNext = pxIndex;
pxNewListItem->pxPrevious = pxIndex->pxPrevious;
traceRETURN_vListInitialiseItem();
} /* Only used during decision coverage testing. */
/*-----------------------------------------------------------*/ mtCOVERAGE_TEST_DELAY();
void vListInsertEnd( List_t * const pxList, pxIndex->pxPrevious->pxNext = pxNewListItem;
ListItem_t * const pxNewListItem ) pxIndex->pxPrevious = pxNewListItem;
{
ListItem_t * const pxIndex = pxList->pxIndex; /* Remember which list the item is in. */
pxNewListItem->pxContainer = pxList;
traceENTER_vListInsertEnd( pxList, pxNewListItem );
( pxList->uxNumberOfItems )++;
/* 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 ); void vListInsert( List_t * const pxList,
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); ListItem_t * const pxNewListItem )
{
/* Insert a new list item into pxList, but rather than sort the list, ListItem_t * pxIterator;
* makes the new list item the last item to be removed by a call to const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
* listGET_OWNER_OF_NEXT_ENTRY(). */
pxNewListItem->pxNext = pxIndex; /* Only effective when configASSERT() is also defined, these tests may catch
pxNewListItem->pxPrevious = pxIndex->pxPrevious; * the list data structures being overwritten in memory. They will not catch
* data errors caused by incorrect configuration or use of FreeRTOS. */
/* Only used during decision coverage testing. */ listTEST_LIST_INTEGRITY( pxList );
mtCOVERAGE_TEST_DELAY(); listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
pxIndex->pxPrevious->pxNext = pxNewListItem; /* Insert the new list item into the list, sorted in xItemValue order.
pxIndex->pxPrevious = pxNewListItem; *
* If the list already contains a list item with the same item value then the
/* Remember which list the item is in. */ * new list item should be placed after it. This ensures that TCBs which are
pxNewListItem->pxContainer = pxList; * stored in ready lists (all of which have the same xItemValue value) get a
* share of the CPU. However, if the xItemValue is the same as the back marker
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U ); * the iteration loop below will not end. Therefore the value is checked
* first, and the algorithm slightly modified if necessary. */
traceRETURN_vListInsertEnd(); if( xValueOfInsertion == portMAX_DELAY )
} {
/*-----------------------------------------------------------*/ pxIterator = pxList->xListEnd.pxPrevious;
}
void vListInsert( List_t * const pxList, else
ListItem_t * const pxNewListItem ) {
{ /* *** NOTE ***********************************************************
ListItem_t * pxIterator; * If you find your application is crashing here then likely causes are
const TickType_t xValueOfInsertion = pxNewListItem->xItemValue; * listed below. In addition see https://www.FreeRTOS.org/FAQHelp.html for
* more tips, and ensure configASSERT() is defined!
traceENTER_vListInsert( pxList, pxNewListItem ); * https://www.FreeRTOS.org/a00110.html#configASSERT
*
/* Only effective when configASSERT() is also defined, these tests may catch * 1) Stack overflow -
* the list data structures being overwritten in memory. They will not catch * see https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
* data errors caused by incorrect configuration or use of FreeRTOS. */ * 2) Incorrect interrupt priority assignment, especially on Cortex-M
listTEST_LIST_INTEGRITY( pxList ); * parts where numerically high priority values denote low actual
listTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); * interrupt priorities, which can seem counter intuitive. See
* https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html and the definition
/* Insert the new list item into the list, sorted in xItemValue order. * of configMAX_SYSCALL_INTERRUPT_PRIORITY on
* * https://www.FreeRTOS.org/a00110.html
* If the list already contains a list item with the same item value then the * 3) Calling an API function from within a critical section or when
* new list item should be placed after it. This ensures that TCBs which are * the scheduler is suspended, or calling an API function that does
* stored in ready lists (all of which have the same xItemValue value) get a * not end in "FromISR" from an interrupt.
* share of the CPU. However, if the xItemValue is the same as the back marker * 4) Using a queue or semaphore before it has been initialised or
* the iteration loop below will not end. Therefore the value is checked * before the scheduler has been started (are interrupts firing
* first, and the algorithm slightly modified if necessary. */ * before vTaskStartScheduler() has been called?).
if( xValueOfInsertion == portMAX_DELAY ) **********************************************************************/
{
pxIterator = pxList->xListEnd.pxPrevious; 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. */
} {
else /* There is nothing to do here, just iterating to the wanted
{ * insertion position. */
/* *** NOTE *********************************************************** }
* If you find your application is crashing here then likely causes are }
* listed below. In addition see https://www.FreeRTOS.org/FAQHelp.html for
* more tips, and ensure configASSERT() is defined! pxNewListItem->pxNext = pxIterator->pxNext;
* https://www.FreeRTOS.org/a00110.html#configASSERT pxNewListItem->pxNext->pxPrevious = pxNewListItem;
* pxNewListItem->pxPrevious = pxIterator;
* 1) Stack overflow - pxIterator->pxNext = pxNewListItem;
* see https://www.FreeRTOS.org/Stacks-and-stack-overflow-checking.html
* 2) Incorrect interrupt priority assignment, especially on Cortex-M /* Remember which list the item is in. This allows fast removal of the
* parts where numerically high priority values denote low actual * item later. */
* interrupt priorities, which can seem counter intuitive. See pxNewListItem->pxContainer = pxList;
* https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html and the definition
* of configMAX_SYSCALL_INTERRUPT_PRIORITY on ( pxList->uxNumberOfItems )++;
* https://www.FreeRTOS.org/a00110.html }
* 3) Calling an API function from within a critical section or when /*-----------------------------------------------------------*/
* the scheduler is suspended, or calling an API function that does
* not end in "FromISR" from an interrupt. UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
* 4) Using a queue or semaphore before it has been initialised or {
* before the scheduler has been started (are interrupts firing /* The list item knows which list it is in. Obtain the list from the list
* before vTaskStartScheduler() has been called?). * item. */
* 5) If the FreeRTOS port supports interrupt nesting then ensure that List_t * const pxList = pxItemToRemove->pxContainer;
* the priority of the tick interrupt is at or below
* configMAX_SYSCALL_INTERRUPT_PRIORITY. pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
**********************************************************************/ pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /* Only used during decision coverage testing. */
{ mtCOVERAGE_TEST_DELAY();
/* There is nothing to do here, just iterating to the wanted
* insertion position. */ /* Make sure the index is left pointing to a valid item. */
} if( pxList->pxIndex == pxItemToRemove )
} {
pxList->pxIndex = pxItemToRemove->pxPrevious;
pxNewListItem->pxNext = pxIterator->pxNext; }
pxNewListItem->pxNext->pxPrevious = pxNewListItem; else
pxNewListItem->pxPrevious = pxIterator; {
pxIterator->pxNext = pxNewListItem; mtCOVERAGE_TEST_MARKER();
}
/* Remember which list the item is in. This allows fast removal of the
* item later. */ pxItemToRemove->pxContainer = NULL;
pxNewListItem->pxContainer = pxList; ( pxList->uxNumberOfItems )--;
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U ); return pxList->uxNumberOfItems;
}
traceRETURN_vListInsert(); /*-----------------------------------------------------------*/
}
/*-----------------------------------------------------------*/
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;
/* Only used during decision coverage testing. */
mtCOVERAGE_TEST_DELAY();
/* Make sure the index is left pointing to a valid item. */
if( pxList->pxIndex == pxItemToRemove )
{
pxList->pxIndex = pxItemToRemove->pxPrevious;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
pxItemToRemove->pxContainer = NULL;
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems - 1U );
traceRETURN_uxListRemove( 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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ TRANSLATION_DIR="../Translations"
# AVAILABLE_LANGUAGES will be calculating according to json files in $TRANSLATION_DIR # AVAILABLE_LANGUAGES will be calculating according to json files in $TRANSLATION_DIR
AVAILABLE_LANGUAGES=() AVAILABLE_LANGUAGES=()
BUILD_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=() BUILD_MODELS=()
builder_info() { builder_info() {