Title: Arduino delay() changed its behavior to not do busy wait anymore · Issue #114 · feilipu/Arduino_FreeRTOS_Library · GitHub
Open Graph Title: Arduino delay() changed its behavior to not do busy wait anymore · Issue #114 · feilipu/Arduino_FreeRTOS_Library
X Title: Arduino delay() changed its behavior to not do busy wait anymore · Issue #114 · feilipu/Arduino_FreeRTOS_Library
Description: Describe the issue Since Release 10.4.6-3, the Arduino delay() function doesn't do a busy wait anymore. This broke the real-time behaviour on my Arduino Mega because it now uses vTaskDelay() under the hood, and on the Arduino Mega, there...
Open Graph Description: Describe the issue Since Release 10.4.6-3, the Arduino delay() function doesn't do a busy wait anymore. This broke the real-time behaviour on my Arduino Mega because it now uses vTaskDelay() under ...
X Description: Describe the issue Since Release 10.4.6-3, the Arduino delay() function doesn't do a busy wait anymore. This broke the real-time behaviour on my Arduino Mega because it now uses vTaskDelay() un...
Opengraph URL: https://github.com/feilipu/Arduino_FreeRTOS_Library/issues/114
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Arduino delay() changed its behavior to not do busy wait anymore","articleBody":"**Describe the issue**\r\nSince [Release 10.4.6-3](https://github.com/feilipu/Arduino_FreeRTOS_Library/releases/tag/10.4.6-3), the Arduino `delay()` function doesn't do a busy wait anymore. This broke the real-time behaviour on my Arduino Mega because it now uses `vTaskDelay()` under the hood, and on the Arduino Mega, there is no real SysTick (here, the watchdog timeout with a resolution of 15 ms is used), what doesn't allow fast task changes during the FreeRTOS scheduler. Furthermore, because of the crazy oscillator, it is also not very accurate (the watchdog oscillator frequency depends (see page 392 on [ATmega2560 datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega640-1280-1281-2560-2561-Datasheet-DS40002211A.pdf) on the voltage and the temperature). But in combination with ISRs and the direct call of `taskYIELD()` if required, this works well (here, if you are interested in what we do: https://www.youtube.com/watch?v=loU-Y_Ek8XI).\r\n\r\n**Expected behavior**\r\nThe `delay()` function comes from the Arduino framework and not from FreeRTOS. Therefore, it shouldn't be redefined. Or, when necessary, there should be an option where it is possible to decide whether to use the new behaviour or to use the well known \"busy wait\" behaviour.\r\n\r\n**Additional context**\r\nI read already https://github.com/feilipu/Arduino_FreeRTOS_Library/issues/113 and https://github.com/RalphBacon/244-RTOS-for-Arduino/issues/1, but I think redefining well-understood functions from a _non-sleep blocking busy wait_ to a _sleep blocking_ behaviour which breaks the real-time behaviour---where I don't expect changes---should be done very carefully.\r\n\r\nMaybe we can discuss about that?","author":{"url":"https://github.com/Prof-Florian-Kuenzner","@type":"Person","name":"Prof-Florian-Kuenzner"},"datePublished":"2022-05-27T18:27:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/114/Arduino_FreeRTOS_Library/issues/114"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf4eb9fe-bf83-dcd5-9369-f96f447c9f86 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD3E:6E631:220994A:2EC3716:6A630FC0 |
| html-safe-nonce | 19461f2a46385c846968e4ebe506a5ea088e387f377c6e9ccd384f75bcf50923 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDNFOjZFNjMxOjIyMDk5NEE6MkVDMzcxNjo2QTYzMEZDMCIsInZpc2l0b3JfaWQiOiI0ODMwODUxNzg4OTQwOTcxOTY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8d70f375231acaa338bc28b29a83908fb7652a77358b29106ba5e221fa9e40ec |
| hovercard-subject-tag | issue:1251130878 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feilipu/Arduino_FreeRTOS_Library/114/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc503fd4b079f43ef767d5e1f1eca8817161ecbd9754ba545c8b2f4c2d06d1c6/feilipu/Arduino_FreeRTOS_Library/issues/114 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc503fd4b079f43ef767d5e1f1eca8817161ecbd9754ba545c8b2f4c2d06d1c6/feilipu/Arduino_FreeRTOS_Library/issues/114 |
| og:image:alt | Describe the issue Since Release 10.4.6-3, the Arduino delay() function doesn't do a busy wait anymore. This broke the real-time behaviour on my Arduino Mega because it now uses vTaskDelay() under ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Prof-Florian-Kuenzner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1a6c056e02f174fffc096c521ec0ff6fb83e40a2ec8cb8875466ec1524872dd6 |
| turbo-cache-control | no-preview |
| go-import | github.com/feilipu/Arduino_FreeRTOS_Library git https://github.com/feilipu/Arduino_FreeRTOS_Library.git |
| octolytics-dimension-user_id | 3955592 |
| octolytics-dimension-user_login | feilipu |
| octolytics-dimension-repository_id | 46898167 |
| octolytics-dimension-repository_nwo | feilipu/Arduino_FreeRTOS_Library |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 46898167 |
| octolytics-dimension-repository_network_root_nwo | feilipu/Arduino_FreeRTOS_Library |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6a93e25585f487ddff9e3996c06d5b869d6e1828 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width