各位好!有如下问题,不知哪里的原因。
signed short register_task(void (*task)(void), byte task_No)
{
word a;
//-----
if (task_No < MAX_TASKS)
{
a = (word) (task);//-----此句编译通不过,显示Error [712] . can't generate code for this expression
task_PCL[task_No] = (byte) (a); // task address low byte
task_PCLATH[task_No] = (byte) (a >> 8); // task address hi byte
task_delay[task_No] = STOP;
return -1; // success
}
else
return 0; // because of invalid task_No
} // register_task |