改为中断方式就可以了。
static unsigned short sCnt = 0;
if(TIM_GetITStatus(TIM2,TIM_IT_CC2) != RESET)
{
TIM_ClearITPendingBit(TIM2,TIM_IT_CC2);
*(uint32_t *)((uint32_t)BITBAND_ALIAS_ADDRESS((uint32_t)cKey,0) + sCnt * 4) = *(uint32_t *)((uint32_t)BITBAND_ALIAS_ADDRESS(0x40010808,9));
if(++sCnt >= 256)
sCnt = 0;
} |