-
PC15 PC14怎样设置成普通的IO?
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOE, ENABLE); //使能相应GPIO的时钟 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;//10M时钟速度 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;//选择输入模式 //按键 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;//S1 GPIO_InitStructure.GPIO_Pin |= GPIO_Pin_0;//S2 GPIO_Init(GPIOA, &GPIO_InitStructure);//写入设置参数 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;//S3 GPIO_InitStructure.GPIO_Pin |= GPIO_Pin_2;//S4 GPIO_Init(GPIOC, &GPIO_InitStructure);//写入设置参数 //红外管信号 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;//PT1 GPIO_InitStructure.GPIO_Pin |= GPIO_Pin_0;//PT2 GPIO_Init(GPIOC, &GPIO_InitStructure);//写入设置参数 PWR_BackupAccessCmd(ENABLE);//允许修改RTC 和后备寄存器 RCC_LSEConfig(RCC_LSE_OFF);//关闭外部低速外部时钟信号功能 后,PC13 PC14 PC15 才可以当普通IO用。 BKP_TamperPinCmd(DISABLE);//关闭入侵检测功能,也就是 PC13,也可以当普通IO 使用 BKP_ITConfig(DISABLE); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;//选择输入模式 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;//PT3 GPIO_InitStructure.GPIO_Pin |= GPIO_Pin_14;//PT4 GPIO_InitStructure.GPIO_Pin |= GPIO_Pin_13;//PT5 GPIO_Init(GPIOC, &GPIO_InitStructure);//写入设置参数
1646浏览量 2回复量 关注量 -
无损压缩算法-AT403A sos
[i=s] 本帖最后由 tyw 于 2021-5-7 19:28 编辑 [/i] 链接:[url=https://blog.csdn.net/qq_34254642/article/details/104717110]https://blog.csdn.net/qq_34254642/article/details/104717110[/url] [b]无损压缩算法—miniLZO在AT403上面是ok的,跑在AT403ACGU7上就不行,求FAE[/b]
1633浏览量 0回复量 关注量 -
GD32E230使用高级定时器的比较输出 赏100家园币
[color=#383a42][backcolor=rgb(249, 249, 249)][size=16px][color=#0098dd]初始化的时候就死机了,不知道怎么使用高级定时器的比较输出模式[/color] [color=#0098dd]void[/color] [color=#23974a]b_timer_config[/color][color=#7a82da]([/color][color=#d52753]uint16_t[/color] [color=#40b8c5]__pres[/color][color=#7a82da],[/color] [color=#d52753]uint16_t[/color] [color=#40b8c5]__period[/color][color=#7a82da],[/color] [color=#d52753]uint16_t[/color] [color=#40b8c5]__pulse[/color][color=#7a82da])[/color] [color=#7a82da]{[/color] [color=#a0a1a7]// timer_oc_parameter_struct timer_ocinitpara;[/color] [color=#d52753]timer_parameter_struct[/color] timer_initpara[color=#7a82da];[/color] [color=#d52753]timer_break_parameter_struct[/color] timer_breakpara[color=#7a82da];[/color] [color=#23974a]rcu_periph_clock_enable[/color][color=#7a82da]([/color]RCU_TIMER0[color=#7a82da]);[/color] [color=#23974a]timer_deinit[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da]);[/color] [color=#23974a]timer_struct_para_init[/color][color=#7a82da](&[/color]timer_initpara[color=#7a82da]);[/color] timer_initpara[color=#7a82da].[/color][color=#a05a48]prescaler[/color] [color=#7a82da]=[/color] [color=#40b8c5]__pres[/color][color=#7a82da];[/color] timer_initpara[color=#7a82da].[/color][color=#a05a48]alignedmode[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_COUNTER_EDGE[/color][color=#7a82da];[/color] timer_initpara[color=#7a82da].[/color][color=#a05a48]counterdirection[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_COUNTER_UP[/color][color=#7a82da];[/color] timer_initpara[color=#7a82da].[/color][color=#a05a48]period[/color] [color=#7a82da]=[/color] [color=#40b8c5]__period[/color][color=#7a82da];[/color] [color=#a0a1a7]// 10KHz[/color] timer_initpara[color=#7a82da].[/color][color=#a05a48]clockdivision[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_CKDIV_DIV1[/color][color=#7a82da];[/color] timer_initpara[color=#7a82da].[/color][color=#a05a48]repetitioncounter[/color] [color=#7a82da]=[/color] [color=#ce33c0]0[/color][color=#7a82da];[/color] [color=#23974a]timer_init[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#7a82da]&[/color]timer_initpara[color=#7a82da]);[/color] [color=#a0a1a7]// timer_channel_output_struct_para_init(&timer_ocinitpara);[/color] [color=#a0a1a7]// timer_ocinitpara.outputstate = TIMER_CCX_ENABLE;[/color] [color=#a0a1a7]// timer_ocinitpara.outputnstate = TIMER_CCXN_DISABLE;[/color] [color=#a0a1a7]// timer_ocinitpara.ocpolarity = TIMER_OC_POLARITY_HIGH;[/color] [color=#a0a1a7]// timer_ocinitpara.ocnpolarity = TIMER_OCN_POLARITY_HIGH;[/color] [color=#a0a1a7]// timer_ocinitpara.ocidlestate = TIMER_OC_IDLE_STATE_LOW;[/color] [color=#a0a1a7]// timer_ocinitpara.ocnidlestate = TIMER_OCN_IDLE_STATE_LOW;[/color] [color=#a0a1a7]// timer_channel_output_config(TIMER0, TIMER_CH_0, &timer_ocinitpara);[/color] [color=#23974a]timer_break_struct_para_init[/color][color=#7a82da](&[/color]timer_breakpara[color=#7a82da]);[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]runoffstate[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_ROS_STATE_ENABLE[/color][color=#7a82da];[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]ideloffstate[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_IOS_STATE_ENABLE[/color][color=#7a82da];[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]deadtime[/color] [color=#7a82da]=[/color] [color=#ce33c0]164[/color][color=#7a82da];[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]breakpolarity[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_BREAK_POLARITY_LOW[/color][color=#7a82da];[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]outputautostate[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_OUTAUTO_ENABLE[/color][color=#7a82da];[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]protectmode[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_CCHP_PROT_OFF[/color][color=#7a82da];[/color] timer_breakpara[color=#7a82da].[/color][color=#a05a48]breakstate[/color] [color=#7a82da]=[/color] [color=#23974a]TIMER_BREAK_ENABLE[/color][color=#7a82da];[/color] [color=#23974a]timer_break_config[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#7a82da]&[/color]timer_breakpara[color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#40b8c5]__pulse[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_mode_config[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_OC_MODE_PWM0[/color][color=#7a82da]);[/color] [color=#a0a1a7]// timer_channel_output_shadow_config(TIMER0, TIMER_CH_0, TIMER_OC_SHADOW_DISABLE);[/color] [color=#a0a1a7]// timer_primary_output_config(TIMER0, ENABLE);[/color] [color=#23974a]nvic_irq_enable[/color][color=#7a82da]([/color]TIMER0_Channel_IRQn[color=#7a82da],[/color][color=#23974a] [/color][color=#ce33c0]1[/color][color=#7a82da]);[/color] [color=#23974a]timer_interrupt_enable[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_INT_CH0[/color][color=#7a82da]);[/color] [color=#23974a]timer_interrupt_disable[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_INT_BRK[/color][color=#7a82da]);[/color] [color=#23974a]timer_auto_reload_shadow_enable[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da]);[/color] [color=#23974a]timer_enable[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da]);[/color] [color=#7a82da]}[/color] [color=#0098dd]void[/color] [color=#23974a]TIMER0_IRQHandler[/color][color=#7a82da]([/color][color=#0098dd]void[/color][color=#7a82da])[/color] [color=#7a82da]{[/color] [color=#0098dd]static[/color] [color=#d52753]uint8_t[/color] status [color=#7a82da]=[/color] [color=#ce33c0]0[/color][color=#7a82da];[/color] [color=#0098dd]if[/color] [color=#7a82da]([/color]SET [color=#7a82da]==[/color] [color=#23974a]timer_interrupt_flag_get[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_INT_CH0[/color][color=#7a82da]))[/color] [color=#7a82da]{[/color] status[color=#7a82da]++;[/color] [color=#0098dd]switch[/color] [color=#7a82da]([/color]status [color=#7a82da]%[/color] [color=#ce33c0]3[/color][color=#7a82da]){[/color] [color=#0098dd]case[/color] [color=#ce33c0]0[/color][color=#7a82da]:[/color] [color=#23974a]printf[/color][color=#7a82da]([/color][color=#c5a332]"a[/color][color=#df631c]\n[/color][color=#c5a332]"[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color] [color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color] tim[color=#7a82da][[/color][color=#23974a]B[/color].[color=#a05a48]idle[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER15[/color][color=#7a82da],[/color] [color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color] [color=#ce33c0]0[/color][color=#7a82da]);[/color] [color=#0098dd]break[/color][color=#7a82da];[/color] [color=#0098dd]case[/color] [color=#ce33c0]1[/color][color=#7a82da]:[/color] [color=#23974a]printf[/color][color=#7a82da]([/color][color=#c5a332]"b[/color][color=#df631c]\n[/color][color=#c5a332]"[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color] [color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color] tim[color=#7a82da][[/color][color=#23974a]B[/color].[color=#a05a48]t_off[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER15[/color][color=#7a82da],[/color] [color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color] [color=#ce33c0]0[/color][color=#7a82da]);[/color] [color=#0098dd]break[/color][color=#7a82da];[/color] [color=#0098dd]case[/color] [color=#ce33c0]2[/color][color=#7a82da]:[/color] [color=#23974a]printf[/color][color=#7a82da]([/color][color=#c5a332]"c[/color][color=#df631c]\n[/color][color=#c5a332]"[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color] [color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color] tim[color=#7a82da][[/color][color=#23974a]B[/color].[color=#a05a48]t_on[/color][color=#7a82da]);[/color] [color=#23974a]timer_channel_output_pulse_value_config[/color][color=#7a82da]([/color][color=#23974a]TIMER15[/color][color=#7a82da],[/color] [color=#23974a]TIMER_CH_0[/color][color=#7a82da],[/color] pwm_ch[color=#7a82da][[/color][color=#23974a]B[/color].[color=#a05a48]pulse[/color][color=#7a82da]);[/color] [color=#0098dd]break[/color][color=#7a82da];[/color] [color=#0098dd]default[/color][color=#7a82da]:[/color] [color=#0098dd]break[/color][color=#7a82da];[/color] [color=#7a82da]}[/color] [color=#23974a]timer_interrupt_flag_clear[/color][color=#7a82da]([/color][color=#23974a]TIMER0[/color][color=#7a82da],[/color][color=#23974a] [/color][color=#23974a]TIMER_INT_CH0[/color][color=#7a82da]);[/color] [color=#7a82da]}[/color] [color=#7a82da]}[/color] [/size][/backcolor][/color]
16968浏览量 10回复量 关注量 -
Allegro 导出钻孔表的时候报错
Error* axlFormSetField: argument #1 should be any user-defined (other) type (type template = "otg") - nil
2498浏览量 3回复量 关注量 -
GD32E505计算16位CRC不对啊 sos
#define CRC_INITIAL_VALUE 0x0000 #define CRC_POLY_VALUE 0x1021 #define CRC_SET_CONTROL_REG CRC_CTLR = 0x09 // 输出数据不翻转,输入数据不翻转, 16位, 复位
1572浏览量 0回复量 关注量 -
AT32F421C8T7外部中断问题
程序将PB2引脚作为外部中断引脚,程序配置之后,引脚上电平变化时程序不能进入中断处理函数。以下为代码,请各位帮忙看看是否有配置不对的地方。 void check_gpio_init(void) { GPIO_InitType GPIO_InitStructure; EXTI_InitType EXTI_InitStructure; NVIC_InitType NVIC_InitStructure; RCC_AHBPeriphClockCmd(RCC_AHBPERIPH_GPIOB,ENABLE); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Pull = GPIO_Pull_NOPULL; GPIO_InitStructure.GPIO_MaxSpeed = GPIO_MaxSpeed_50MHz; GPIO_InitStructure.GPIO_OutType = GPIO_OutType_PP; GPIO_InitStructure.GPIO_Pins = GPIO_Pins_2; GPIO_Init(GPIOB,&GPIO_InitStructure); SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOB,EXTI_PinSource2); EXTI_InitStructure.EXTI_Line = EXTI_Line2; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; EXTI_InitStructure.EXTI_LineEnable = ENABLE; EXTI_Init(&EXTI_InitStructure); NVIC_InitStructure.NVIC_IRQChannel = EXTI3_2_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); } void EXTI3_2_IRQHandler(void) { if(EXTI_GetIntStatus(EXTI_Line2) != RESET) { if(check_pin_read() == RESET) { irq_count++; if(irq_count >= 20) { fault_status = 0; irq_count = 0; //device_check_en(DISABLE); } } EXTI_ClearIntPendingBit(EXTI_Line2); } } 下载视频
1204浏览量 1回复量 关注量 -
AT32F403A 使用ADC时候出的问题。
使用ADC 双模式时,程序卡在判断CAL 控制位为零的循环中,在使用ADC双模式时,由于硬件不会清除CAL控制位,可能导致程序会卡在ADC校准函数 while(ADC_GetCalibrationStatus(ADC1)); 我没有双使用ADC,还事卡住。 #define Channel_Num 2 #define Sample_Num 1 u16 ADC_ConvertedValue[Sample_Num][Channel_Num]; void ADC_DMA_Config(void) { DMA_InitTypeDef DMA_InitStructure; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); DMA_DeInit(DMA1_Channel1); DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&ADC1->DR; DMA_InitStructure.DMA_MemoryBaseAddr = (u32)&ADC_ConvertedValue; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; DMA_InitStructure.DMA_BufferSize = Sample_Num*Channel_Num; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;//外设地址不变 DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;//内存地址递增 DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; DMA_Init(DMA1_Channel1, &DMA_InitStructure); //DMA_Cmd(DMA1_Channel1,ENABLE); DMA_ClearITPendingBit(DMA1_IT_TC1);//清除DMA通道x中断待处理标志位 DMA_ITConfig(DMA1_Channel1,DMA_IT_TC, ENABLE); } //ADC配置函数 void ADC_Configuration(void) { u16 i; ADC_InitTypeDef ADC_InitStructure; RCC_ADCCLKConfig(RCC_PCLK2_Div6); //第二步:设置分频因子 ADC最大速率14M 72/6=12M ADC_DeInit(ADC1); //将外设 ADC1 的全部寄存器重设为默认值 //配置ADC1 ADC_InitStructure.ADC_Mode=ADC_Mode_Independent; //独立模式 ADC_InitStructure.ADC_ScanConvMode=ENABLE; //扫描 ADC_InitStructure.ADC_ContinuousConvMode=ENABLE; //ADC_InitStructure.ADC_ContinuousConvMode=DISABLE; ADC_InitStructure.ADC_ExternalTrigConv=ADC_ExternalTrigConv_None;//无外部触发,即软件触发 ADC_InitStructure.ADC_DataAlign=ADC_DataAlign_Right; ADC_InitStructure.ADC_NbrOfChannel=Channel_Num;//规则转换通道数量 ADC_Init(ADC1,&ADC_InitStructure); //ADC1通道采样配置,使用规则通道1-3 //测试使用中断方式读数据,采样周期不能太小.实际使用时考虑加DMA处理 ADC_RegularChannelConfig(ADC1,ADC_Channel_0,1,ADC_SampleTime_41Cycles5);//ADC8配置为通道1,周期239.5+12.5 ADC_RegularChannelConfig(ADC1,ADC_Channel_3,2,ADC_SampleTime_41Cycles5);//ADC8配置为通道1,周期239.5+12.5 //初始化AD缓冲 for(i=0;i<4;i++) { AD_value[i]=0; } //使能ADC1的DMA模式 ADC_DMACmd(ADC1,ENABLE); /* Enable ADC1 */ ADC_Cmd(ADC1,ENABLE); DELAY_1ms();//14*ADCCLK ADC_ExternalTrigConvCmd(ADC1, DISABLE); //禁止外部出发ADC转换 //清除ADC1校准值 ADC_ResetCalibration(ADC1); //等待清除完成 while(ADC_GetResetCalibrationStatus(ADC1)); //开始ADC1校准 ADC_StartCalibration(ADC1); //等待校准完成 //while(ADC_GetCalibrationStatus(ADC1)); DELAY_10ms(); DELAY_10ms(); DMA_Cmd(DMA1_Channel1,ENABLE); //开始ADC1转换 ADC_SoftwareStartConvCmd(ADC1,ENABLE); // ADC_ClearFlag(ADC1,ADC_FLAG_EOC);//清除中断标志 // ADC_ITConfig(ADC1,ADC_IT_EOC,ENABLE);//使能中断 }
2154浏览量 2回复量 关注量 -
Chip on IDE KF32 GPIO初始化问题
这个初始化是不是定义的输入口全部上拉,为什么只有定义的最后一个输入口有上拉,前面的口都没有上拉,求解 void GPIOInit_Input_Config(GPIO_SFRmap* GPIOx,uint16_t GpioPin) { /*初始化复位GPIOx外设,使能GPIOx外设时钟*/ GPIO_Reset(GPIOx); /* 配置 Pxy作为输入模式 */ GPIO_InitTypeDef GPIO_InitStructure; //GPIO_Struct_Init(&GPIO_InitStructure); GPIO_InitStructure.m_Pin = GpioPin; GPIO_InitStructure.m_Speed = GPIO_LOW_SPEED; //初始化 GPIO输出速度 GPIO_InitStructure.m_Mode = GPIO_MODE_IN; //初始化 GPIO方向为输入 GPIO_InitStructure.m_PullUp = GPIO_PULLUP;//GPIO_NOPULL; //初始化 GPIO是否上拉 不上拉 GPIO_InitStructure.m_PullDown = GPIO_NOPULL;//GPIO_PULLUP; //初始化 GPIO是否下拉 不下拉 GPIO_Configuration(GPIOx,&GPIO_InitStructure); } 搜索 [align=left]复制[/align]
4111浏览量 14回复量 关注量 -
NI采集卡有频率为4kHz左右的高频滋滋声,请问是何原因?
[url=ictopic-2.html]#技术资源#[/url][size=4]新买了一块NI的USB接口采集卡(NI-6322),将其用于对多个传感器的信号采集,系统供电为多路输出直流电源(朝阳电源)。上电后发现采集卡有滋滋的响声,靠近听很明显,分析发现该声音频率在4KHz左右。[/size][size=4]请教大家,这是何原因呢?有解决方法吗?[/size] [size=4]谢谢![/size]
1321浏览量 5回复量 关注量 -
mspg2553总中断问题
我刚刚开始学习单片机MSPG2553去图书馆借了几本书,我在对照范例写代码时用到 _EINT(); 就出错,发出警报。 使用环境为 IAR EW430 5.3 发出警报为: Warning[Pe223]: function "_EINT" declared implicitly F:\msp430-launchpad\频率\main.c 17 Error[e46]: Undefined external "_EINT" referred in main ( F:\msp430-launchpad\频率\Debug\Obj\main.r43 ) 这什么情况 _ENIT 未定义? 难道是头文件有缺失吗? (头文件未更改) 我该如何解决这个错误?
818浏览量 1回复量 关注量 -
stm32f0系列进入睡眠模式的困惑
[color=#222226]使用STM32F030F4P6做产品,[/color][color=#222226]现在是可以进入待机模式,使用RTC唤醒,然后能发送数据工作。[/color] [color=#222226]现在想让产品初始上电后先进入休眠,然后在RTC唤醒后,再发送数据;但是现在只要上电就直接发送数据,然后才进入休眠。[/color] [color=#222226]通过查看PWR->CSR寄存器,看到RM手册中说SBF和WUF位是可以用来判断是否从待机模式中醒来的,但是程序这么做了不起作用,还是上电就发送数据。[/color] [color=#222226]请各位大佬给看看可能因为什么导致的。[/color] [color=#222226]int main(void)[/color] [color=#222226]{[/color] [color=#222226] /* MCU Configuration--------------------------------------------------------*/[/color] [color=#222226] HAL_Init();[/color] [color=#222226] /* Configure the system clock */[/color] [color=#222226] SystemClock_Config();[/color] [color=#222226] [/color] [color=#222226] MX_GPIO_Init(); [/color] [color=#222226] MX_RTC_Init();[/color] [color=#222226] [/color] [color=#222226] RTC_AlarmConfig();[/color] [color=#222226] /* USER CODE BEGIN SysInit */[/color] [color=#222226] if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET ) //在此判断SBF标志位,若为1,则表明是被唤醒过[/color] [color=#222226] //if(__HAL_PWR_GET_FLAG(PWR_FLAG_WU)!= RESET)[/color] [color=#222226]{[/color] [color=#222226] __HAL_RCC_GPIOA_CLK_ENABLE();[/color] [color=#222226] MX_SPI1_Init();[/color] [color=#222226] Lora_init();[/color] [color=#222226] //HAL_Delay(10000);[/color] [color=#222226] Read_Ds18b20();[/color] [color=#222226] Lora_SendTemp1();[/color] [color=#222226] }[/color] [color=#222226] __HAL_RCC_PWR_CLK_ENABLE();[/color] [color=#222226] if (__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)[/color] [color=#222226]{[/color] [color=#222226] __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);[/color] [color=#222226] }[/color] [color=#222226] [/color] [color=#222226] HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);[/color] [color=#222226]if (__HAL_PWR_GET_FLAG(PWR_FLAG_WU) != RESET)[/color][img=0,24]https://img-bbs.csdn.net/upload/202005/26/1590486098_526184.png[/img] [color=#222226] HAL_PWR_EnterSTANDBYMode();[/color] [color=#222226] while (1)[/color] [color=#222226] {[/color] [color=#222226] [/color] [color=#222226] }[/color] [color=#222226]}[/color] [color=#222226]通过查看数据手册,说有2个标志位,一个是用来说明曾进入待机模式;另一个是曾被唤醒过,通过判断这个,认为设备进入过待机模式,那么就可以发送数据;若没进入过,那就先进入待机,不发数据。[/color] [color=#222226]这2个我都尝试了,没起作用,请大家指点。[/color]
1309浏览量 6回复量 关注量 -
CH579 TMOS问题
void TMOS_InitTasks( void ) { UINT8 taskID = 0; /* tmos Task */ TMOS_Init( taskID++ ); /* Hal Task */ Hal_Init( taskID++ ); //硬件初始化 /* LL Task */ LL_Init( taskID++ ); /* L2CAP Task */ L2CAP_Init( taskID++ ); /* GAP Task */ GAP_Init( taskID++ ); /* GATT Task */ GATT_Init( taskID++ ); /* SM Task */ SM_Init( taskID++ ); GAPBondMgr_Init( taskID++ ); GATTServApp_Init( taskID++ ); /* Role */ GAPRole_PeripheralInit( taskID++ ); /* hid */ HidDev_Init(taskID++); /* Application */ HidEmu_Init(taskID++); //USBHID task UsbHid_Init(taskID++); } 上面的函数上面时候执行的?原理什么的有人能解惑一下吗
1446浏览量 4回复量 关注量 -
关于mcc的library的问题
[img]C:\Users\Administrator\Desktop\1.png[/img] mplab中mcc插件使用中,设备资源下没有mikroe相关模板,这是什么问题????
802浏览量 2回复量 关注量 -
LM358仿真结果与实际结果不符,请大神指点,拜谢!
[i=s] 本帖最后由 yydianzi 于 2020-8-26 16:27 编辑 [/i] [img]C:\Users\Administrator\Desktop\1.png[/img]
2035浏览量 8回复量 关注量