问答

汇集网友智慧,解决技术难题

钟爱柳州

TA的家园币:622  

  • 芯旺微KF8F中断编译错误

    本帖最后由AWAYWSNB于2025-2-1315:10编辑KF8CC编译器在将C语言的中断函数(如voidint_fun0()__interrupt(0)和voidint_fun1()__interrupt(1))转换为汇编代码时,自动生成了相同的interrupt_service_routine标签,从而导致了重复定义错误。这个问题怎么解决??KungFu8MCUCompilerV2.3.2Rev(Nov17202111:51:03)main.asm:441:Error[115]Duplicatelabelorredefiningsymbolthatcannotberedefined.(interrupt_service_routine)make:***[main.o]Error1make:Target`all'notremadebecauseoferrors.func._int_fun0.code;***;PostBlockStats:dbName=I;***;entry:_int_fun0;Functionstart;0exitpoints;;StartingPostCodeblock;.def_int_fun0_function_begin,debug,value=$;::->op:LABEL;::->op:FUNCTION_int_fun0;Functionstart;0exitpoints;::->op:GET_VALUE_AT_ADDRESS;R3resprentforwsave,R4resprentforssave,R5resprentforpsaveinterrupt_service_routine;.line44;"../main.c"if(T1IF)JB_EIF1_bits,0JMP_00012_DS_;::->op:*=;.line46;"../main.c"T1IF=0;//清零中断标志CLR_EIF1_bits,0;::->op:=;.line47;"../main.c"T1H=0xFC;//T1计数器重新赋值MOVR0,#0xfcMOV_T1H,R0;::->op:=;.line48;"../main.c"T1L=0x18;MOVR0,#0x18MOV_T1L,R0;::->op:=;.line50;"../main.c"SMFlag_Start=1;//设置状态机启动标志位MOVR0,#0x01BANKSEL_SMFlag_StartMOV_SMFlag_Start,R0BANKSEL_SMFlag_StartCLR(_SMFlag_Start+1);::->op:LABEL;::->op:ENDFUNCTION_00012_DS_MOVR1,R2MOVPCH,R5MOVPSW,R4MOVR0,R3IRET;.def_int_fun0_function_end,debug,value=$func._int_fun1.code;***;PostBlockStats:dbName=I;***;entry:_int_fun1;Functionstart;0exitpoints;;StartingPostCodeblock;.def_int_fun1_function_begin,debug,value=$;::->op:LABEL;::->op:FUNCTION_int_fun1;Functionstart;0exitpoints;::->op:LABEL;::->op:ENDFUNCTION;R3resprentforwsave,R4re

  • KF32A156参考例程将PE0配置PWM捕获,引脚有方波但不进中断

    #definePE0_CCP19_CH4_PINGPIOE_SFR,GPIO_PIN_MASK_0#definePE0_CCP19_CH4_AF9GPIOE_SFR,GPIO_Pin_Num_0,GPIO_RMP_AF9{GPIO_Write_Mode_Bits(PE0_CCP19_CH4_PIN,GPIO_MODE_RMP);GPIO_Pin_RMP_Config(PE0_CCP19_CH4_AF9);Ccp_IntConfig_tccpIntConfig;ccpIntConfig.ccpInterrupt=CCP_INT_CAPTURE_CH4;ccpIntConfig.intIndex=INT_T19;ccpIntConfig.newState=TRUE;ccpIntConfig.preemption=4;ccpIntConfig.subPriority=0;CCP_Capture_Mode_Init(CCP19_SFR,CCP_CHANNEL_4,CCP_CAP_RISING_EDGE);CCP_INT_Config(CCP19_SFR,&ccpIntConfig);INT_All_Enable(TRUE);}void__attribute__((interrupt))_T19_exception(void){if(0U!=CCP_Get_Channel_Trigger_INT_Flag(CCP19_SFR,CCP_CHANNEL_4)){/*Clearinterruptflag*/CCP_Clear_Channel_INT_Flag(CCP19_SFR,CCP_CHANNEL_4);}}