Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow FreeRTOS hook for C33 only and improve its reliability #414

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Dec 9, 2024

This gives the chance for users to create new threads/queues in setup() without race conditions
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Dec 10, 2024
@gpb01
Copy link

gpb01 commented Dec 10, 2024

@facchinm: Perhaps it would be better to condition, with the same #ifdef, also the code within port.c so as to have it compiled only if it is really useful. This, for those who use in IDE a "Compiler warning" level higher than the minimum, could avoid a series of unnecessary warnings during compilation for UNO R4. :-)

Cordially,

Guglielmo

@hexnet1234
Copy link

I agree with @gpb01.

If I remember correctly, the built-in compiler of the Arduino IDE does strip unused functions out of the binary,
but adding this check seems like a good idea. Just to get rid of warnings, and (very slightly) improve compile time.
Compile-time improvements like this are small on their own, but do add up eventually.

Best regards
hexnet1234

@gpb01
Copy link

gpb01 commented Dec 10, 2024

If I remember correctly, the built-in compiler of the Arduino IDE does strip unused functions out of the binary

Yes, correct!

Just to get rid of warnings,

The compiler gives the following warning:

/Users/gpb01/Desktop/Arduino Portable 1.3.1.app/Contents/Java/portable/packages/arduino/hardware/renesas_uno/1.3.1/libraries/Arduino_FreeRTOS/src/portable/FSP/port.c: In function 'loop_thread_func':
/Users/gpb01/Desktop/Arduino Portable 1.3.1.app/Contents/Java/portable/packages/arduino/hardware/renesas_uno/1.3.1/libraries/Arduino_FreeRTOS/src/portable/FSP/port.c:238:9: warning: implicit declaration of function 'loop'; did you mean 'bool'? [-Wimplicit-function-declaration]
         loop();
         ^~~~
         bool

... and, since it is very easy to remove it, why not do it? :-)

Guglielmo

@facchinm
Copy link
Member Author

Done in b83fd20 , if the CI turns green I'm going to merge @pennam

@facchinm facchinm merged commit 51b909d into arduino:main Dec 12, 2024
7 checks passed
@gpb01
Copy link

gpb01 commented Dec 12, 2024

@facchinm: Thanks! :-)

Guglielmo

@hexnet1234
Copy link

Looks good 👍

Best regards
hexnet1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants