Author Topic: C: freedom from PICs  (Read 859 times)

0 Members and 1 Guest are viewing this topic.

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2009
  • Country: gb
Re: C: freedom from PICs
« Reply #25 on: May 21, 2020, 10:31:10 am »
You're lucky :D -nostdlib is par for the course
Actually I meant writing serial bytes... I used 'printf' as a generic term rather than a function call.  ;)
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 1506
  • Country: us
  • Formerly SiFive, Samsung R&D
Re: C: freedom from PICs
« Reply #26 on: May 21, 2020, 11:54:11 pm »
on the target it tends to be printf and pin wiggling.

You're lucky :D -nostdlib is par for the course when I have to do it so everything has to be from scratch. Granted, setting up a rudimentary printf is quite easy. Just send the string byte-for-byte until a 0 is encountered :)

Well ... that's puts() rather than printf(). A printf() that can handle %s and %d without field widths or number bases is about a dozen lines of code. Adding hex and octal and minimum widths with space or zero padding (99% of what people use) it's probably 50 to 100 lines of code.
 

Online chriva

  • Regular Contributor
  • *
  • Posts: 98
  • Country: se
Re: C: freedom from PICs
« Reply #27 on: May 22, 2020, 12:07:43 am »
You could even call the function printfart() if you wanted :p

On a more serious note tho: You are indeed correct.
I tend to use the term as an umbrella for all of them for some stupid reason. -sorry :)
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 3174
  • Country: us
Re: C: freedom from PICs
« Reply #28 on: May 22, 2020, 02:40:17 am »
Quote
I had totally forgotten about that horror
Mingw is a horror?  I recall it being relatively trivial to install.  I was just using the CLI tools; presumably that would be sufficient for "learning the basics of C"
(or, there is apparently VS Code support for mingw:  https://code.visualstudio.com/docs/cpp/config-mingw ) (although my very limited experience with VS Code seems to indicate that it's harder to set up than a CLI based build/compile/debug system...   Perhaps not ideal for short and sweet C training programs...)

Quote
I never use a debugger. Not on the desktop, not in embedded.
And... Are you just learning a new language?
« Last Edit: May 22, 2020, 02:50:18 am by westfw »
 

Online westfw

  • Super Contributor
  • ***
  • Posts: 3174
  • Country: us
Re: C: freedom from PICs
« Reply #29 on: May 22, 2020, 05:55:47 am »
oh, If you sort-of think that MPLABX is OK aside from the upload/reprogram/etc cycle, you might want to try installing Netbeans with mingw for "local" compilation.  MPLABX is built on top of NetBeans, and they might be similar (depending on how much customization Microchip has done.)https://netbeans.org/community/releases/80/cpp-setup-instructions.html#compilers_windows
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 2385
  • Country: gb
Re: C: freedom from PICs
« Reply #30 on: May 23, 2020, 01:30:17 pm »
I have Code::Blocks installed on all the machines I develop on, it will install GCC for you (if you download the full package) and it has a pretty decent IDE.  I use it for developing and unit testing algorithms/numerical functions and for knocking up small utilities for creating/reading files etc.
 
The following users thanked this post: NivagSwerdna

Online chriva

  • Regular Contributor
  • *
  • Posts: 98
  • Country: se
Re: C: freedom from PICs
« Reply #31 on: May 23, 2020, 01:45:15 pm »
Had no clue they were still around
If they're anything like they used to I can definitely vouch for this suggestion :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf