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
Reading the arm webradio codes
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
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
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


