| | |
| | | tob->toProc(); |
| | | |
| | | UpdateOutput(iid, DMACount[iid]&0x1); |
| | | //LP_transmit(); |
| | | // ModulesAsynSetInterval(proc_secs); |
| | | // fir_acc_startup(); |
| | | // LP_transmit(); |
| | | ModulesAsynSetInterval(proc_secs); |
| | | fir_acc_startup(); |
| | | clock_stop = clock(); |
| | | proc_secs = ((ufloat) (clock_stop - clock_start))/ CLOCKS_PER_SEC; |
| | | } |
| | |
| | | UpdateOutput(iid, DMACount[iid]&0x1); |
| | | } |
| | | |
| | | DMACount[iid]++; |
| | | ++DMACount[iid]; |
| | | } |
| | | |
| | | int main(int argc, char *argv[]) |
| | |
| | | memset(DMACount, 0, sizeof(DMACount)); |
| | | |
| | | Message* spiMsg = new Message(8); |
| | | //第一次启动上报特别是仿真的时候需要arm'重新发送消息. |
| | | spiMsg->DspStatusPush(DSP_EMULATE_DEBUG, 0, 0); |
| | | spiMsg->ReportDspStatus(&msg); |
| | | |
| | | SPI2_Init(); |
| | | |
| | |
| | | GPIO_SetOutPut(GPIOA, GPIO_Pin12, GPIO_HIGH); |
| | | GPIO_SetOutPut(GPIOB, GPIO_Pin5, GPIO_HIGH); |
| | | |
| | | // u32 ddrspace = sram_free_space(SRAM_DDR, mem_any); |
| | | // printf("ddrspace:%d\n", ddrspace); |
| | | //第一次启动上报特别是仿真的时候需要arm'重新发握手. |
| | | spiMsg->DspStatusPush(DSP_EMULATE_DEBUG, 0, 0); |
| | | spiMsg->ReportDspStatus(&msg); |
| | | |
| | | printf("free sram %d, L2 %d\n", sram_free_space(SRAM_DDR, mem_any), sram_free_space(SRAM_L2, mem_any)); |
| | | |
| | | while(1) { |
| | | asyn_proc_secs = ModulesAsynProcess(); |
| | |
| | | |
| | | //clock state will change after running,it need check always. |
| | | //about 1s |
| | | if(++loop_cnt > 100000000){ |
| | | if(clock_check_count == DMACount[var.master_intr]) { |
| | | if(++loop_cnt > 5e+6){ |
| | | if (var.clock_ok && clock_check_count == DMACount[var.master_intr]) { |
| | | var.dsp_status = dsp_no_clock; |
| | | spiMsg->DspStatusPush(DSP_CLOCK_STATUS, &var.dsp_status ,1); |
| | | spiMsg->DspStatusPush(DSP_RUNNING_STATUS, &var.dsp_status ,1); |
| | | spiMsg->ReportDspStatus(&msg); |
| | | printf("clk0 ok\n"); |
| | | } |
| | | loop_cnt =0; |
| | | clock_check_count = DMACount[var.master_intr]; |
| | | // printf("clk1 ok\n"); |
| | | } |
| | | |
| | | |
| | | if(!var.clock_ok && var.dsp_status == DSPStatus::dsp_running_ok && var.HandShakeSuccesful) { |
| | | //notify arm to work normaly. |
| | | spiMsg->DspStatusPush(DSP_CLOCK_STATUS, 0, 0); |
| | | spiMsg->DspStatusPush(DSP_CLOCK_STATUS, &var.dsp_status, 1); |
| | | request_topo_count = DMACount[var.master_intr] ; |
| | | var.clock_ok = utrue; |
| | | // printf("clk2 ok\n"); |
| | | spiMsg->ReportDspStatus(&msg); |
| | | printf("clk2 ok\n"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |