请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:MSP430F5529 工具与软件:
这似乎是一个常见的问题、在读取搜索结果时未显示清晰的解决方案。
在 getVersionInfo()下面的代码中、在 main()中调用的例程挂起、我在释放模式下评论该例程。 调试运行正常。
有什么建议吗? 计时器中断问题?
static void getVersionInfo()
{
// Wait around for the bluebox to be awake, and try to get the verison info.
// But timeout eventually to allow for the case of an older bluebox that doesn't support reporting version
u8 attempts = 0;
while(attempts++ < 10)
{
if(strncmp(G.blueboxVersionInfo->ProcVariant, DEFAULT_VARIANT, VARIANT_INFO_SZ) != 0)
break;
bluebox_packetToRequestVersionInfo(&G.blueboxTxFifo);
bluebox_sendPacket(&G.blueboxTxFifo);
// Wait 0.1s; using LED timer for convenience
// hangs here in RELEASE mode AD
while(!G.ledTmr.timedOut) {}
RestartGenTimer(&G.ledTmr);
bluebox_periodic();
}
}
void getClkID()
{
// read 4 position dip switch
if (DIP_SW & 8) // screen alignment, hangs here as long as SW6-4 is on
{
drawAlign();
while(1);
}
else
clk_id= (DIP_SW & 3);
}
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop wdt
initHardware();
RUNledOff;
initGlobals();
bluebox_init();
_enable_interrupts();
// hangs in RELEASE mode AD
// getVersionInfo();
getClkID();
menus_init(); // I think it requires interrupts to be enabled, but I'm not sure. For now, don't put it before _enable_interrupts().
drawClkID();
RUNledOn;
for(;;)
{
buttons();
menu();
bluebox_periodic(); // parse and display received data packet AD
// LPM0;
}
}