Reading the arm webradio codes

zhengrob 2009-09-08 04:51:24 Link
Dear Sir,

I did see the videos you put on the website. Congratulations to this great
projcet!

I am new to Cotext-M3 and trying to understand the codes. Just a silly
question, what kind of interrupt you used in this project and in which
file(s) they are implemented?

Cheers,

Robert

Andreas Watterott 2009-09-08 09:23:08 Link
Hello Robert.

> I am new to Cotext-M3 and trying to understand the codes. Just a silly
> question, what kind of interrupt you used in this project and in which
> file(s) they are implemented?

Currently there are 4 interrupts:

SysTick         - Timing stuff    - main.c
Timer0 & GPIO_D - IR receiver     - io.c
GPIO_A          - VS data request - vs.c

Regards
Andreas

zhengrob 2009-09-08 13:57:36 Link
Thank you Andreas!

zhengrob 2009-10-08 14:56:26 Link
Dear Andreas,

I got another question when trying to understand the codes:

in eth\http_files.h

...
typedef struct
{
 ...
  void*(*get)(void); 
} HTTPVAR;
...

Accordingly in eth\http_files.c

...
const HTTPVAR httpvars[HTTPVARS] =
{
  {"ONTIME",      VAR_NR,  (void*)getontime},
  {"DATE",        VAR_STR, (void*)getdate},
  {"CLOCK",       VAR_STR, (void*)getclock},
  ...
}

in menu.h
...
typedef struct
{
  ...
  void(*close)(void);                     //close item
  void(*service)(void);                   //service routine
} MAINMENUITEM;
...


and in menu.c
...
const MAINMENUITEM mainmenu[MAINITEMS] =
{
  {"Station",  {&img_station[0][0],  &img_station[1][0], 
&img_station[2][0]},  ...., station_service},
...
}


My question is, why convert the function  as (void *) in HTTPVAR struct (in
http_files.c/h) while in MAINMENUITEM struct( in  menu.c/h )do not need to
do as such. Does any particular purpose require this implementation in
HTTPVAR struct?

Best regards and thanks,

Zhengrob

Andreas Watterott 2009-10-08 15:12:52 Link
Hello,

Yes, because the functions in the HTTPVAR struct have different return
types. For example "long getontime()" and "char* getdate()". So they must
have this cast, otherwise you get warnings/errors from your compiler.

Regards,
Andreas

Reply

Name
eMail (not visible)
Subject (no text only in upper case; no HELP, URGENT...)
Text
HTML tags are not supported and links are generated automatically if they start with http or ftp.
Please submit long source code or log files as attachment (only registered users).
Please enter the number 2985