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

Unable to used the PSTR() macro #9

Closed
GoogleCodeExporter opened this issue Nov 30, 2015 · 4 comments
Closed

Unable to used the PSTR() macro #9

GoogleCodeExporter opened this issue Nov 30, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

The WebServer provides the very handy method printP to print a string stored in 
program space.

So, one basically expect that you can write:

  server.printP (PSTR("Hello World !")) ;
  /* the PSTR macro is defined in avr/pgmspace.h */

Unfortunately, you can't because the parameter for printP is of type 
prog_uchar*, whereas the PSTR macro builds a prog_char*.

The fix is very simple, I just replaced all occurrences of prog_uchar by 
prog_char in WebServer.h and now I can use the PSTR macro.

Original issue reported on code.google.com by benoit.blanchon on 9 Jul 2010 at 4:46

@GoogleCodeExporter
Copy link
Author

Ah, we're using a different macro for the same thing in the webduino examples.

The better fix is adding a second .printP method that takes the other kind of 
parameter and calls the first version with a cast.  Since it's inlined, there's 
no overhead.

Original comment by ben.combee on 9 Jul 2010 at 8:08

@GoogleCodeExporter
Copy link
Author

Original comment by ben.combee on 9 Jul 2010 at 8:12

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by ben.combee on 3 Nov 2010 at 12:58

  • Added labels: Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Fix getting pushed to GitHub

Original comment by ben.combee on 9 Jan 2012 at 4:44

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant