I came across this in embedded hardware using C.
#define EnterPWDN(clkcon) ( (void (*)(int))0xc0080e0 ) (clkcon)
I have no idea how this function macro works. I understand what clkconis the parameter to the EnterPWDN function, but what happens after that?
clkcon
It sends the address to a 0xc0080e0pointer to a function that receives intand returns void, and calls this function, passing it clkconas a parameter.
0xc0080e0
int
void
Highlighted:
typedef void (func_ptr*)(int); func_ptr func = (func_ptr)0xc0080e0; func(clkcon);
(If you haven't come across function pointers, you might want to grab a good introduction to C and read about this.)
void, int . 0xc0080e0.
(void (*)(int))
. void. , , , int , . - , , , "clkcon".
Goz sbi, , -:
(0xc0080e0) , , . int clkcon.
int clkcon