RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Sep 25, 2018 5:27 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Dec 02, 2012 9:27 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
Several bugs have been fixed lately in SmallC and linker. Four new examples available in /share/smallc directory:
  • rain.c - shows a funny picture on screen, like drops of a rain.
  • adc.c - prints values of ADC inputs.
  • gpio.c - displays a state of all digital inputs.
  • webserver.c - runs a trivial web-server using Arduino Ethernet Shield (wiz5100).

To build all the examples, use make:
Code:
# cd /share/smallc
# make
scc  -o hello  hello.c
scc  -o primelist  primelist.c
scc  -o primesum  primesum.c
scc  -o test1  test1.c
scc  -o test2  test2.c
scc  -o test3  test3.c
scc  -o gpio  gpio.c
scc  -o adc  adc.c
scc  -o rain  rain.c
scc  -o webserver  webserver.c -lwiznet
# _


Top
 Profile  
 
PostPosted: Sun Dec 02, 2012 9:36 am 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi,

Double WOW :) ! VERY NICE :).

Wiz


Top
 Profile  
 
PostPosted: Tue Oct 07, 2014 10:21 am 

Joined: Thu May 01, 2014 7:17 am
Posts: 8
I get a number of error trying to compile (which I also get going the manual way
Code:
scc -o hello hello.c
btw.):

Code:
# make hello|more
scc  -o hello  hello.c

Stop.
#extern int printf();
#                 ^
#******  missing semicolon  ******
#extern int printf();
#                 ^
#******  illegal function or declaration  ******
#int main()
#        ^
#******  missing semicolon  ******
#int main()
#        ^
#******  illegal function or declaration  ******
#{
#^
#******  illegal function or declaration  ******
#    printf ("Hello, SmallC World!\n");
#          ^
#******  already defined  ******
#    printf ("Hello, SmallC World!\n");
#            ^
#******  illegal argument name  ******
#    printf ("Hello, SmallC World!\n");
#                           ^
#******  expected comma  ******
#    printf ("Hello, SmallC World!\n");
#                                ^
#******  expected comma  ******
#    printf ("Hello, SmallC World!\n");
#                                ^
#******  illegal argument name  ******
#    printf ("Hello, SmallC World!\n");
#                                 ^
#******  expected comma  ******
#    printf ("Hello, SmallC World!\n");
#                                 ^
#******  illegal argument name  ******
#    printf ("Hello, SmallC World!\n");
#                                   ^
#******  expected comma  ******
#    printf ("Hello, SmallC World!\n");
#                                   ^
#******  illegal argument name  ******
#    printf ("Hello, SmallC World!\n");
#                                     ^
#******  wrong number args  ******
#    printf ("Hello, SmallC World!\n");
#                                     ^
#******  function requires compound statement  ******
#}
#^
#******  illegal function or declaration  ******
Compilation failed: 17 error(s)
*** Exit 1


Any idea what could be going wrong here?

Thanks for a great tool, though!


Top
 Profile  
 
PostPosted: Tue Oct 07, 2014 7:39 pm 
Contributor

Joined: Mon Apr 29, 2013 1:56 am
Posts: 196
hello.c was written for Smaller C (and you should prefer it to Small C because it's a much more complete compiler, however it doesn't support implicit int and K&R syntax). Use cc to compile it.


Top
 Profile  
 
PostPosted: Thu Oct 09, 2014 5:46 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Alex,

Yup. Your compiler is VERY nice :).

So here is a question for the group. Has anyone gotten MP3 decoding to work on PIC32?

IIRC there was a 'known to work' example from Microchip at some point.

Does anyone know where I can find that code?

Wiz


Top
 Profile  
 
PostPosted: Sun Oct 12, 2014 8:49 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
So here is a question for the group. Has anyone gotten MP3 decoding to work on PIC32?

I got it work on my STM32F4 discovery kit. Works nice.
I doubt it may work w/ pic32mx..

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Sun Oct 12, 2014 9:15 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
I believe, Helix MP3 decoder should work just fine on pic32.
http://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en551513


Top
 Profile  
 
PostPosted: Mon Oct 13, 2014 12:39 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Serge and Matt and all,

Thanks that is the page I was remembering :).

I downloaded it and then discovered it unzips to a Microsoft file. Ugh.

Then I remembered how confused the last such Microchip code I looked at was. The Helix code itself is pretty dense as well. And loaded with you better license this as well! So much for simple code....

I think I will just write a simple record/playback routine and convert whatever to 16 bit linear. Memory is pretty cheap these days.

Matt: This code has USB host mode stuff in it too. Maybe that can help with getting USB to work on PIC32?

Wiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission