void call_func( void (*func)(void)){ (*func)(); } void setup() { // put your setup code here, to run once: volatile uint8_t *PA=(volatile uint8_t *)0x103; Serial.begin(9600); Serial.println((int)PA);//0x103 Serial.println(*PA); //内容是PINJ Serial.println(PINJ); call_func(a); call_func(b); } void a(){ Serial.println("a func"); } void b(){ Serial.println("b func"); }
上面的0x103,是atmega2560 PINJ的寄存器地址
参考:http://blog.csdn.net/liming0931/article/details/7752248