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

sys/tiny_strerror: make use of flash_utils.h #19332

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Feb 27, 2023

Contribution description

tiny_strerror was written specifically for AVR, so it makes sense to also use flash_utils there.

Testing procedure

Modify hello_world to print an error:

 #include <stdio.h>
+#include <string.h>
+#include <errno.h>
 
 int main(void)
 {
@@ -28,5 +30,7 @@ int main(void)
     printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
     printf("This board features a(n) %s MCU.\n", RIOT_MCU);
 
+    puts(strerror(EAGAIN));
+
     return 0;
 }

master

   text	   data	    bss	    dec	    hex	filename
   5520	   1098	    901	   7519	   1d5f	/home/benpicco/dev/RIOT/examples/hello-world/bin/avr-rss2/hello-world.elf

this PR

   text	   data	    bss	    dec	    hex	filename
   6532	    118	    917	   7567	   1d8f	/home/benpicco/dev/RIOT/examples/hello-world/bin/avr-rss2/hello-world.elf
2023-02-27 22:24:40,383 # main(): This is RIOT! (Version: 2023.04-devel-523-g6b501)
2023-02-27 22:24:40,385 # Hello World!
2023-02-27 22:24:40,388 # You are running RIOT on a(n) avr-rss2 board.
2023-02-27 22:24:40,393 # This board features a(n) atmega256rfr2 MCU.
2023-02-27 22:24:40,394 # EAGAIN

Issues/PRs references

Thanks to ChatGPT for helping with the tedious work!

@benpicco benpicco changed the title sys/: make use of flash_utils.h sys/tiny_strerror: make use of flash_utils.h Feb 27, 2023
@github-actions github-actions bot added the Area: sys Area: System label Feb 27, 2023
@benpicco benpicco force-pushed the sys/tiny_strerror-avr branch from f66be40 to 6eec8b3 Compare February 27, 2023 21:30
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 27, 2023
@benpicco benpicco requested a review from maribu February 27, 2023 21:30
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. This has a high bang for the buck ratio and is well contained.

@riot-ci
Copy link

riot-ci commented Feb 27, 2023

Murdock results

✔️ PASSED

b05292f sys/tiny_strerror: make use of flash_utils.h

Success Failures Total Runtime
6864 0 6864 09m:51s

Artifacts

@benpicco benpicco force-pushed the sys/tiny_strerror-avr branch from 6eec8b3 to b05292f Compare February 27, 2023 22:25
@benpicco
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Feb 28, 2023

Build succeeded:

@bors bors bot merged commit 2c1bd90 into RIOT-OS:master Feb 28, 2023
@benpicco benpicco deleted the sys/tiny_strerror-avr branch February 28, 2023 08:26
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants