单片机KEIL出现了different length of parameter lists 的错误,如何修改?

#include

typedef unsigned int u16;

typedef unsigned char u8;

#define GPIO_DIG P0
#define GPIO_KEY P1

u8 KeyValue;

u8 code smgduan[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};//???0~F???

void delay(u16 i)
{
while(i--);
}
void KeyDown(void)

{
char a=0;
GPIO_KEY=0x0f;
if(GPIO_KEY!=0x0f)
图片说明
加粗处一直在提示错误,如何修改?

1个回答

delay函数参数不匹配

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求单片机Keil C51和PROTEUS实验报告
求单片机Keil C51和PROTEUS实验报告,谢谢啦!求单片机Keil C51和PROTEUS实验报告,谢谢啦!
单片机Keil C51和PROTEUS实验指导书
求单片机Keil C51和PROTEUS实验指导书,谢谢啦!
KEIL5选择不了芯片怎么办?
在新建STM32F103工程时,选择不了芯片类型(已经从官网上下载并安装了PACKS包),依旧在Select Device for Target 窗口中Data base中出现空白,请各位大佬帮忙解决一下,谢谢
我用keil5的时候始终提示Error: Could not load file 'C:\Keil_v5\build\rtthread-stm32.axf'. Debugger aborted !,怎么解决
我用keil5的时候始终提示Error: Could not load file 'C:\Keil_v5\build\rtthread-stm32.axf'. Debugger aborted !,怎么解决?我按照网上说的都解决不了,我初学rtthread,遇到这样的问题憋了我三天了,很打击信心。希望大神相救。![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011816_315880.png)![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011832_210722.png)![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011839_601161.png)![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011846_917633.png)![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011855_472577.png)![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011861_732610.png)![图片说明](https://img-ask.csdn.net/upload/202003/12/1584011868_665080.png)
请问一下大家,STM32的编程软件keil5为什么会在第一次编译的时候出现错误?
出现错误的情况是这样的,我用STM32CubeMX定义了一个GPIO口,准备做一个LED灯的实验,但是当我在CubeMX中配置完各项功能之后,我打开keil5准备初始化程序代码,发现在初始化完成的时候有一个错误,这个错误来自于keil5当中的stm32f1xx_ hal_gpio.h的这行代码:“#define GPIO_MODE_INPUT 0x00000000u /*!< Input Floating Mode */” 上面这行代码是正常初始化后的代码,而我遇到问题的代码是这一行:“#define GPIO_7MODE_INPUT 0x00000000u /*!< Input Floating Mode */” 上面是我出现错误的代码,它相较于之前的正常代码在MODE之前多出现了一个数字7,这也让我觉得很奇怪,这个数字7是在keil5程序初始化编译的时候就存在,当我把这个数字7给去除后再次进行编译就没有任何问题,我之前以为只是软件的问题后来我自己也重装了keil5好几遍,包括也重装过STM32CubeMX,但问题依然没有解决,顺便说一下我在电脑里的stm32f1xx_ hal_gpio.h这个文件中比较过代码发现这个文件里面的:“#define GPIO_MODE_INPUT 0x00000000u /*!< Input Floating Mode */”发现这行代码竟然是正常的,而它到了keil5里面的时候在初始化编译的时候就会莫名其妙的多出一个数字7,请问大家这个是什么问题,麻烦帮我解决一下,非常感谢。 ![图片说明](https://img-ask.csdn.net/upload/202002/12/1581475884_92104.png)
stm32f303 ADC 模拟看门狗不能中断
芯片:stm32f303CBT6 IDE:keil 我配置好后ADC后,当从ADC通道引脚输入的电压超过设置范围后, 不能进入ADC模拟看门狗中断。 但在main函数while循环里调用ADC_GetConversionValue(ADC1)时,才会进入 ADC模拟看门狗中断,请问有人用过stm32f303的看门狗吗? 如果只有在while循环体中不断调用ADC_GetConversionValue(ADC1)才能进入ADC 模拟中断的话,那这个中断失去意义了,那程序每次读取后也可判断范围。我想应该 是不用调用ADC_GetConversionValue(ADC1)也可以进入中断的,只不过我代码用得 不对,以下是代码,请用过stm32f303看门狗的帮忙指正,在这里谢谢了。 u32 calibration_value1 = 0; void ADC1_2_IRQHandler(void) { if(SET == ADC_GetFlagStatus(ADC1,ADC_FLAG_AWD1)) { ADC_ITConfig(ADC1,ADC_IT_AWD1,DISABLE); ADC_ClearFlag(ADC1,ADC_FLAG_AWD1); ADC_ClearITPendingBit(ADC1,ADC_IT_AWD1); } if(SET == ADC_GetFlagStatus(ADC2,ADC_FLAG_AWD2)) { ADC_ITConfig(ADC2,ADC_IT_AWD2,DISABLE); ADC_ClearITPendingBit(ADC2,ADC_IT_AWD2); } } void adc1_init(void) { ADC_CommonInitTypeDef cs; ADC_InitTypeDef adcs; ADC_VoltageRegulatorCmd(ADC1, ENABLE); delay_ms(1); ADC_SelectCalibrationMode(ADC1, ADC_CalibrationMode_Single); ADC_StartCalibration(ADC1); while(ADC_GetCalibrationStatus(ADC1) != RESET ); calibration_value1 = ADC_GetCalibrationValue(ADC1); adcs.ADC_ContinuousConvMode = ADC_ContinuousConvMode_Enable; adcs.ADC_Resolution = ADC_Resolution_12b; adcs.ADC_ExternalTrigConvEvent = ADC_ExternalTrigConvEvent_0;//ADC_ExternalTrigConvEvent_7 adcs.ADC_ExternalTrigEventEdge = ADC_ExternalTrigEventEdge_None; adcs.ADC_DataAlign = ADC_DataAlign_Right; adcs.ADC_OverrunMode = ADC_OverrunMode_Disable; adcs.ADC_AutoInjMode = ADC_AutoInjec_Disable; adcs.ADC_NbrOfRegChannel = 1; ADC_Init(ADC1, &adcs); cs.ADC_Clock = ADC_Clock_AsynClkMode; cs.ADC_Mode = ADC_Mode_Independent;//ADC_Mode_Interleave; cs.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;; cs.ADC_DMAMode = ADC_DMAMode_Circular; cs.ADC_TwoSamplingDelay = 0; ADC_CommonInit(ADC1, &cs); //Tconv = Sampling time + 12.5 ADC clock cycles (12.5+Sampling)/64M ADC_RegularChannelConfig(ADC1, ADC_Channel_3, 1, ADC_SampleTime_61Cycles5);//ADC_SampleTime_1Cycles5 ADC_Cmd(ADC1, ENABLE); } void adc1_watchDog_cfg(void) { ADC_AnalogWatchdog1SingleChannelConfig(ADC1,ADC_Channel_3); ADC_AnalogWatchdog1ThresholdsConfig(ADC1,400,0); ADC_AnalogWatchdogCmd(ADC1,ADC_AnalogWatchdog_SingleRegEnable); ADC_ITConfig(ADC1,ADC_IT_AWD1,ENABLE); } void ad_gpio_cfg(void) { GPIO_InitTypeDef gs; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); // RCC_AHB1PeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); gs.GPIO_Mode = GPIO_Mode_AN; gs.GPIO_OType = GPIO_OType_PP; gs.GPIO_PuPd = GPIO_PuPd_NOPULL; gs.GPIO_Speed = GPIO_Speed_50MHz; //PA1--->ADC1_IN2 PA2--->ADC1_IN3 PA4--->ADC2_IN1 gs.GPIO_Pin = GPIO_Pin_2|GPIO_Pin_4; GPIO_Init(GPIOA, &gs); } void adc_init(void) { //VrefintCal = *((u16 *)(VREFINT_CAL_ADDR)); ad_gpio_cfg(); RCC_ADCCLKConfig(RCC_ADC12PLLCLK_Div1);//RCC_ADC12PLLCLK_Div1 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_ADC12, ENABLE); ADC_DeInit(ADC1); adc1_init(); adc1_watchDog_cfg(); ADC_StartConversion(ADC1); } mai函数 int main(void) { ... while(1) { ADC_GetConversionValue(ADC1); } ... }
在keil5新建stm32工程时遇到的问题
我新建工程后立刻编译,系统报错.\Objects\templete.axf: error: L6002U: Could not open file .\objects\system_stm32f10x.o: No such file or directory,但是我第一次新建的时候是没有报错的,之后就一直报错了,请问有人知道是怎么回事吗?安装路径没有中文。
keil C51 uv4调试c8051f单片机
keil C51 uv4调试c8051f单片机,提示缺少c8051f.dll文件,无法连接仿真器
keil5打开keil4工程后编译出现问题怎么办?
keil5打开keil4工程出现这样的情况,编译后出现"no source": Error: #5: cannot open source input file "..\source\crc32.c": No such file or directory的问题?
KEIL MDK 怎么设置--no_conditionalize?
我的STM32L476在调用 arm_rfft_fast_f32函数时出现“ Warning: L6989W: Could not apply patch sdcomp-29491-629360 to instruction VPOP {d8-d15} at offset 0x1c2, instruction is within an IT block and is not the last instruction for arm_cfft_radix8_f32.o(.text).”的报错信息。网上查看了下,需要在KEIL里面将编译选项设置成--no_conditionalize,但是这一步不知道怎么操作。
单片机编写EEPROM时,该程序中为什么只能用<reg52.h>作头文件,而换成<regx52.h>就是错误的呢?
只有用<reg52.h>作头文件时调试正确,而换成<regx52.h>就报错很多。我知道两个头文件中位定义的格式不一样,但把^改成_之后依旧报错。 ``` #include <reg52.h> //此文件中定义了单片机的一些特殊功能寄存器 #include "i2c.h" #include "nixie.h" #include "Delay.h" #include "at24c02.h" typedef unsigned int u16; //对数据类型进行声明定义 typedef unsigned char u8; sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; sbit k1=P3^1; sbit k2=P3^0; sbit k3=P3^2; sbit k4=P3^3; //定义按键端口 char num=0; u8 disp[4]; /******************************************************************************* * 函数名 :Keypros() * 函数功能 :按键处理函数 * 输入 : 无 * 输出 : 无 *******************************************************************************/ void Keypros() { if(k1==0) { Delay(10); //消抖处理 if(k1==0) { At24c02Write(1,num); //在地址1内写入数据num } while(!k1); } if(k2==0) { Delay(10); //消抖处理 if(k2==0) { num=At24c02Read(1); //读取EEPROM地址1内的数据保存在num中 } while(!k2); } if(k3==0) { Delay(1); //消抖处理 if(k3==0) { num++; //数据加1 if(num>255)num=0; } while(!k3); } if(k4==0) { Delay(10); //消抖处理 if(k4==0) { num=0; //数据清零 } while(!k4); } } /******************************************************************************* * 函数名 :datapros() * 函数功能 :数据处理函数 * 输入 : 无 * 输出 : 无 *******************************************************************************/ void datapros() { disp[0]=num/1000;//千位 disp[1]=num%1000/100;//百位 disp[2]=num%1000%100/10;//十位 disp[3]=num%1000%100%10; //个位 } /******************************************************************************* * 函数名 :DigDisplay() * 函数功能 :数码管显示函数 * 输入 : 无 * 输出 : 无 *******************************************************************************/ void DigDisplay() { u8 i; for(i=0;i<4;i++) { Nixie(i,disp[3-i]); } } /******************************************************************************* * 函 数 名 : main * 函数功能 : 主函数 * 输 入 : 无 * 输 出 : 无 *******************************************************************************/ void main() { while(1) { Keypros(); //按键处理函数 datapros(); //数据处理函数 DigDisplay();//数码管显示函数 } } ``` 报错如下: F:\单片机\Keil 4\C51\Inc\reg52.h(13): error C231: 'P0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(14): error C231: 'P1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(15): error C231: 'P2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(16): error C231: 'P3': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(17): error C231: 'PSW': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(18): error C231: 'ACC': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(19): error C231: 'B': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(20): error C231: 'SP': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(21): error C231: 'DPL': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(22): error C231: 'DPH': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(23): error C231: 'PCON': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(24): error C231: 'TCON': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(25): error C231: 'TMOD': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(26): error C231: 'TL0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(27): error C231: 'TL1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(28): error C231: 'TH0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(29): error C231: 'TH1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(30): error C231: 'IE': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(31): error C231: 'IP': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(32): error C231: 'SCON': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(33): error C231: 'SBUF': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(36): error C231: 'T2CON': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(37): error C231: 'RCAP2L': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(38): error C231: 'RCAP2H': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(39): error C231: 'TL2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(40): error C231: 'TH2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(45): error C231: 'CY': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(46): error C231: 'AC': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(47): error C231: 'F0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(48): error C231: 'RS1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(49): error C231: 'RS0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(50): error C231: 'OV': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(51): error C231: 'P': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(54): error C231: 'TF1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(55): error C231: 'TR1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(56): error C231: 'TF0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(57): error C231: 'TR0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(58): error C231: 'IE1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(59): error C231: 'IT1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(60): error C231: 'IE0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(61): error C231: 'IT0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(64): error C231: 'EA': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(65): error C231: 'ET2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(66): error C231: 'ES': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(67): error C231: 'ET1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(68): error C231: 'EX1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(69): error C231: 'ET0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(70): error C231: 'EX0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(73): error C231: 'PT2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(74): error C231: 'PS': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(75): error C231: 'PT1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(76): error C231: 'PX1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(77): error C231: 'PT0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(78): error C231: 'PX0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(81): error C231: 'RD': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(82): error C231: 'WR': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(83): error C231: 'T1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(84): error C231: 'T0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(85): error C231: 'INT1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(86): error C231: 'INT0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(87): error C231: 'TXD': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(88): error C231: 'RXD': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(91): error C231: 'SM0': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(92): error C231: 'SM1': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(93): error C231: 'SM2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(94): error C231: 'REN': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(95): error C231: 'TB8': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(96): error C231: 'RB8': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(97): error C231: 'TI': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(98): error C231: 'RI': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(101): error C231: 'T2EX': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(102): error C231: 'T2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(105): error C231: 'TF2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(106): error C231: 'EXF2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(107): error C231: 'RCLK': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(108): error C231: 'TCLK': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(109): error C231: 'EXEN2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(110): error C231: 'TR2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(111): error C231: 'C_T2': redefinition F:\单片机\Keil 4\C51\Inc\reg52.h(112): error C231: 'CP_RL2': redefinition compiling i2c.c... compiling Delay10us.c... compiling Nixie.c... compiling Delay.c... compiling At24c02.c... Target not created
Proteus仿真一直出错,求大神指点!!!!!!
![图片说明](https://img-ask.csdn.net/upload/202002/22/1582301529_326058.png) 一直说我找不到相应的文件,在keil里面重新编译了很多次,就是无法进行最后的仿真,求大神指点
keil5安装出现这样问题?请问怎么解决?
![图片说明](https://img-ask.csdn.net/upload/202001/04/1578115967_648098.png)
小白使用keil编程debug进入了harddefault,搞了半天没解决。求大佬帮下忙。
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "can.h" #include "usart.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ void CAN_SetTxMsg(void) { hcan.pTxMsg->ExtId=0x1314; //使用的扩展ID hcan.pTxMsg->IDE=CAN_ID_EXT; //扩展模式 hcan.pTxMsg->RTR=CAN_RTR_DATA; //发送的是数据 hcan.pTxMsg->DLC=8; //数据长度为2字节 hcan.pTxMsg->data[0]=0x01; hcan.pTxMsg->data[1]=0x02; hcan.pTxMsg->data[2]=0x03; hcan.pTxMsg->data[3]=0x04; hcan.pTxMsg->data[4]=0x05; hcan.pTxMsg->data[5]=0x06; hcan.pTxMsg->data[6]=0x07; hcan.pTxMsg->data[7]=0x08; } /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_CAN_Init(); MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ CAN_SetTxMsg(); HAL_CAN_AddTxMessage(&hcan,hcan.pTxMsg,hcan.pTxMsg->data,(uint32_t*)CAN_TX_MAILBOX0); HAL_CAN_ActivateNotification(&hcan,CAN_IT_RX_FIFO0_MSG_PENDING); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** * @brief System Clock Configuration * @retval None */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } /** Enables the Clock Security System */ HAL_RCC_EnableCSS(); } /* USER CODE BEGIN 4 */ void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) { HAL_CAN_AddTxMessage(hcan,hcan->pTxMsg,hcan->pTxMsg->data,(uint32_t*)CAN_TX_MAILBOX0); HAL_CAN_ActivateNotification(hcan,CAN_IT_RX_FIFO0_MSG_PENDING); } /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ /* USER CODE END Error_Handler_Debug */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 这是我的主程序,debug总是在CAN_SetMsg()那里进入了hardfault.下面是定义的一些初始化结构体。 /** ****************************************************************************** * @file stm32f1xx_hal_can.h * @author MCD Application Team * @brief Header file of CAN HAL module. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef STM32F1xx_HAL_CAN_H #define STM32F1xx_HAL_CAN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_hal_def.h" /** @addtogroup STM32F1xx_HAL_Driver * @{ */ #if defined (CAN1) /** @addtogroup CAN * @{ */ /* Exported types ------------------------------------------------------------*/ /** @defgroup CAN_Exported_Types CAN Exported Types * @{ */ /** * @brief HAL State structures definition */ typedef enum { HAL_CAN_STATE_RESET = 0x00U, /*!< CAN not yet initialized or disabled */ HAL_CAN_STATE_READY = 0x01U, /*!< CAN initialized and ready for use */ HAL_CAN_STATE_LISTENING = 0x02U, /*!< CAN receive process is ongoing */ HAL_CAN_STATE_SLEEP_PENDING = 0x03U, /*!< CAN sleep request is pending */ HAL_CAN_STATE_SLEEP_ACTIVE = 0x04U, /*!< CAN sleep mode is active */ HAL_CAN_STATE_ERROR = 0x05U /*!< CAN error state */ } HAL_CAN_StateTypeDef; /** * @brief CAN init structure definition */ typedef struct { uint32_t Prescaler; /*!< Specifies the length of a time quantum. This parameter must be a number between Min_Data = 1 and Max_Data = 1024. */ uint32_t Mode; /*!< Specifies the CAN operating mode. This parameter can be a value of @ref CAN_operating_mode */ uint32_t SyncJumpWidth; /*!< Specifies the maximum number of time quanta the CAN hardware is allowed to lengthen or shorten a bit to perform resynchronization. This parameter can be a value of @ref CAN_synchronisation_jump_width */ uint32_t TimeSeg1; /*!< Specifies the number of time quanta in Bit Segment 1. This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */ uint32_t TimeSeg2; /*!< Specifies the number of time quanta in Bit Segment 2. This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */ FunctionalState TimeTriggeredMode; /*!< Enable or disable the time triggered communication mode. This parameter can be set to ENABLE or DISABLE. */ FunctionalState AutoBusOff; /*!< Enable or disable the automatic bus-off management. This parameter can be set to ENABLE or DISABLE. */ FunctionalState AutoWakeUp; /*!< Enable or disable the automatic wake-up mode. This parameter can be set to ENABLE or DISABLE. */ FunctionalState AutoRetransmission; /*!< Enable or disable the non-automatic retransmission mode. This parameter can be set to ENABLE or DISABLE. */ FunctionalState ReceiveFifoLocked; /*!< Enable or disable the Receive FIFO Locked mode. This parameter can be set to ENABLE or DISABLE. */ FunctionalState TransmitFifoPriority;/*!< Enable or disable the transmit FIFO priority. This parameter can be set to ENABLE or DISABLE. */ } CAN_InitTypeDef; /** * @brief CAN filter configuration structure definition */ typedef struct { uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit configuration, first one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit configuration, second one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number, according to the mode (MSBs for a 32-bit configuration, first one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number, according to the mode (LSBs for a 32-bit configuration, second one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1U) which will be assigned to the filter. This parameter can be a value of @ref CAN_filter_FIFO */ uint32_t FilterBank; /*!< Specifies the filter bank which will be initialized. For single CAN instance(14 dedicated filter banks), this parameter must be a number between Min_Data = 0 and Max_Data = 13. For dual CAN instances(28 filter banks shared), this parameter must be a number between Min_Data = 0 and Max_Data = 27. */ uint32_t FilterMode; /*!< Specifies the filter mode to be initialized. This parameter can be a value of @ref CAN_filter_mode */ uint32_t FilterScale; /*!< Specifies the filter scale. This parameter can be a value of @ref CAN_filter_scale */ uint32_t FilterActivation; /*!< Enable or disable the filter. This parameter can be a value of @ref CAN_filter_activation */ uint32_t SlaveStartFilterBank; /*!< Select the start filter bank for the slave CAN instance. For single CAN instances, this parameter is meaningless. For dual CAN instances, all filter banks with lower index are assigned to master CAN instance, whereas all filter banks with greater index are assigned to slave CAN instance. This parameter must be a number between Min_Data = 0 and Max_Data = 27. */ } CAN_FilterTypeDef; /** * @brief CAN Tx message header structure definition */ typedef struct { uint32_t StdId; /*!< Specifies the standard identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */ uint32_t ExtId; /*!< Specifies the extended identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */ uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted. This parameter can be a value of @ref CAN_identifier_type */ uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted. This parameter can be a value of @ref CAN_remote_transmission_request */ uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 8. */ uint8_t data[8]; FunctionalState TransmitGlobalTime; /*!< Specifies whether the timestamp counter value captured on start of frame transmission, is sent in DATA6 and DATA7 replacing pData[6] and pData[7]. @note: Time Triggered Communication Mode must be enabled. @note: DLC must be programmed as 8 bytes, in order these 2 bytes are sent. This parameter can be set to ENABLE or DISABLE. */ } CAN_TxHeaderTypeDef; /** * @brief CAN Rx message header structure definition */ typedef struct { uint32_t StdId; /*!< Specifies the standard identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */ uint32_t ExtId; /*!< Specifies the extended identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */ uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted. This parameter can be a value of @ref CAN_identifier_type */ uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted. This parameter can be a value of @ref CAN_remote_transmission_request */ uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 8. */ uint8_t Data[8]; uint32_t Timestamp; /*!< Specifies the timestamp counter value captured on start of frame reception. @note: Time Triggered Communication Mode must be enabled. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF. */ uint32_t FilterMatchIndex; /*!< Specifies the index of matching acceptance filter element. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */ } CAN_RxHeaderTypeDef; /** * @brief CAN handle Structure definition */ typedef struct __CAN_HandleTypeDef { CAN_TypeDef *Instance; /*!< Register base address */ CAN_InitTypeDef Init; /*!< CAN required parameters */ CAN_TxHeaderTypeDef* pTxMsg; CAN_RxHeaderTypeDef* pRxMsg; HAL_LockTypeDef Lock; __IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */ __IO uint32_t ErrorCode; /*!< CAN Error code. This parameter can be a value of @ref CAN_Error_Code */ } CAN_HandleTypeDef; /** * @} */ /* Exported constants --------------------------------------------------------*/ /** @defgroup CAN_Exported_Constants CAN Exported Constants * @{ */ /** @defgroup CAN_Error_Code CAN Error Code * @{ */ #define HAL_CAN_ERROR_NONE (0x00000000U) /*!< No error */ #define HAL_CAN_ERROR_EWG (0x00000001U) /*!< Protocol Error Warning */ #define HAL_CAN_ERROR_EPV (0x00000002U) /*!< Error Passive */ #define HAL_CAN_ERROR_BOF (0x00000004U) /*!< Bus-off error */ #define HAL_CAN_ERROR_STF (0x00000008U) /*!< Stuff error */ #define HAL_CAN_ERROR_FOR (0x00000010U) /*!< Form error */ #define HAL_CAN_ERROR_ACK (0x00000020U) /*!< Acknowledgment error */ #define HAL_CAN_ERROR_BR (0x00000040U) /*!< Bit recessive error */ #define HAL_CAN_ERROR_BD (0x00000080U) /*!< Bit dominant error */ #define HAL_CAN_ERROR_CRC (0x00000100U) /*!< CRC error */ #define HAL_CAN_ERROR_RX_FOV0 (0x00000200U) /*!< Rx FIFO0 overrun error */ #define HAL_CAN_ERROR_RX_FOV1 (0x00000400U) /*!< Rx FIFO1 overrun error */ #define HAL_CAN_ERROR_TX_ALST0 (0x00000800U) /*!< TxMailbox 0 transmit failure due to arbitration lost */ #define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 1 transmit failure due to tranmit error */ #define HAL_CAN_ERROR_TX_ALST1 (0x00002000U) /*!< TxMailbox 0 transmit failure due to arbitration lost */ #define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to tranmit error */ #define HAL_CAN_ERROR_TX_ALST2 (0x00008000U) /*!< TxMailbox 0 transmit failure due to arbitration lost */ #define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 1 transmit failure due to tranmit error */ #define HAL_CAN_ERROR_TIMEOUT (0x00020000U) /*!< Timeout error */ #define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U) /*!< Peripheral not initialized */ #define HAL_CAN_ERROR_NOT_READY (0x00080000U) /*!< Peripheral not ready */ #define HAL_CAN_ERROR_NOT_STARTED (0x00100000U) /*!< Peripheral not started */ #define HAL_CAN_ERROR_PARAM (0x00200000U) /*!< Parameter error */ #define HAL_CAN_ERROR_INTERNAL (0x00800000U) /*!< Internal error */ /** * @} */ /** @defgroup CAN_InitStatus CAN InitStatus * @{ */ #define CAN_INITSTATUS_FAILED (0x00000000U) /*!< CAN initialization failed */ #define CAN_INITSTATUS_SUCCESS (0x00000001U) /*!< CAN initialization OK */ /** * @} */ /** @defgroup CAN_operating_mode CAN Operating Mode * @{ */ #define CAN_MODE_NORMAL (0x00000000U) /*!< Normal mode */ #define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /*!< Loopback mode */ #define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /*!< Silent mode */ #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with silent mode */ /** * @} */ /** @defgroup CAN_synchronisation_jump_width CAN Synchronization Jump Width * @{ */ #define CAN_SJW_1TQ (0x00000000U) /*!< 1 time quantum */ #define CAN_SJW_2TQ ((uint32_t)CAN_BTR_SJW_0) /*!< 2 time quantum */ #define CAN_SJW_3TQ ((uint32_t)CAN_BTR_SJW_1) /*!< 3 time quantum */ #define CAN_SJW_4TQ ((uint32_t)CAN_BTR_SJW) /*!< 4 time quantum */ /** * @} */ /** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in Bit Segment 1 * @{ */ #define CAN_BS1_1TQ (0x00000000U) /*!< 1 time quantum */ #define CAN_BS1_2TQ ((uint32_t)CAN_BTR_TS1_0) /*!< 2 time quantum */ #define CAN_BS1_3TQ ((uint32_t)CAN_BTR_TS1_1) /*!< 3 time quantum */ #define CAN_BS1_4TQ ((uint32_t)(CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 4 time quantum */ #define CAN_BS1_5TQ ((uint32_t)CAN_BTR_TS1_2) /*!< 5 time quantum */ #define CAN_BS1_6TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 6 time quantum */ #define CAN_BS1_7TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 7 time quantum */ #define CAN_BS1_8TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 8 time quantum */ #define CAN_BS1_9TQ ((uint32_t)CAN_BTR_TS1_3) /*!< 9 time quantum */ #define CAN_BS1_10TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_0)) /*!< 10 time quantum */ #define CAN_BS1_11TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1)) /*!< 11 time quantum */ #define CAN_BS1_12TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 12 time quantum */ #define CAN_BS1_13TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2)) /*!< 13 time quantum */ #define CAN_BS1_14TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 14 time quantum */ #define CAN_BS1_15TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 15 time quantum */ #define CAN_BS1_16TQ ((uint32_t)CAN_BTR_TS1) /*!< 16 time quantum */ /** * @} */ /** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in Bit Segment 2 * @{ */ #define CAN_BS2_1TQ (0x00000000U) /*!< 1 time quantum */ #define CAN_BS2_2TQ ((uint32_t)CAN_BTR_TS2_0) /*!< 2 time quantum */ #define CAN_BS2_3TQ ((uint32_t)CAN_BTR_TS2_1) /*!< 3 time quantum */ #define CAN_BS2_4TQ ((uint32_t)(CAN_BTR_TS2_1 | CAN_BTR_TS2_0)) /*!< 4 time quantum */ #define CAN_BS2_5TQ ((uint32_t)CAN_BTR_TS2_2) /*!< 5 time quantum */ #define CAN_BS2_6TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0)) /*!< 6 time quantum */ #define CAN_BS2_7TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1)) /*!< 7 time quantum */ #define CAN_BS2_8TQ ((uint32_t)CAN_BTR_TS2) /*!< 8 time quantum */ /** * @} */ /** @defgroup CAN_filter_mode CAN Filter Mode * @{ */ #define CAN_FILTERMODE_IDMASK (0x00000000U) /*!< Identifier mask mode */ #define CAN_FILTERMODE_IDLIST (0x00000001U) /*!< Identifier list mode */ /** * @} */ /** @defgroup CAN_filter_scale CAN Filter Scale * @{ */ #define CAN_FILTERSCALE_16BIT (0x00000000U) /*!< Two 16-bit filters */ #define CAN_FILTERSCALE_32BIT (0x00000001U) /*!< One 32-bit filter */ /** * @} */ /** @defgroup CAN_filter_activation CAN Filter Activation * @{ */ #define CAN_FILTER_DISABLE (0x00000000U) /*!< Disable filter */ #define CAN_FILTER_ENABLE (0x00000001U) /*!< Enable filter */ /** * @} */ /** @defgroup CAN_filter_FIFO CAN Filter FIFO * @{ */ #define CAN_FILTER_FIFO0 (0x00000000U) /*!< Filter FIFO 0 assignment for filter x */ #define CAN_FILTER_FIFO1 (0x00000001U) /*!< Filter FIFO 1 assignment for filter x */ /** * @} */ /** @defgroup CAN_identifier_type CAN Identifier Type * @{ */ #define CAN_ID_STD ((uint32_t)0x00000000) /*!< Standard Id */ #define CAN_ID_EXT ((uint32_t)0x00000004) /*!< Extended Id */ /** * @} */ /** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request * @{ */ #define CAN_RTR_DATA ((uint32_t)0x00000000) /*!< Data frame */ #define CAN_RTR_REMOTE ((uint32_t)0x00000002) /*!< Remote frame */ /** * @} */ /** @defgroup CAN_receive_FIFO_number CAN Receive FIFO Number * @{ */ #define CAN_RX_FIFO0 (0x00000000U) /*!< CAN receive FIFO 0 */ #define CAN_RX_FIFO1 (0x00000001U) /*!< CAN receive FIFO 1 */ /** * @} */ /** @defgroup CAN_Tx_Mailboxes CAN Tx Mailboxes * @{ */ #define CAN_TX_MAILBOX0 (0x00000001U) /*!< Tx Mailbox 0 */ #define CAN_TX_MAILBOX1 (0x00000002U) /*!< Tx Mailbox 1 */ #define CAN_TX_MAILBOX2 (0x00000004U) /*!< Tx Mailbox 2 */ /** * @} */ /** @defgroup CAN_flags CAN Flags * @{ */ /* Transmit Flags */ #define CAN_FLAG_RQCP0 (0x00000500U) /*!< Request complete MailBox 0 flag */ #define CAN_FLAG_TXOK0 (0x00000501U) /*!< Transmission OK MailBox 0 flag */ #define CAN_FLAG_ALST0 (0x00000502U) /*!< Arbitration Lost MailBox 0 flag */ #define CAN_FLAG_TERR0 (0x00000503U) /*!< Transmission error MailBox 0 flag */ #define CAN_FLAG_RQCP1 (0x00000508U) /*!< Request complete MailBox1 flag */ #define CAN_FLAG_TXOK1 (0x00000509U) /*!< Transmission OK MailBox 1 flag */ #define CAN_FLAG_ALST1 (0x0000050AU) /*!< Arbitration Lost MailBox 1 flag */ #define CAN_FLAG_TERR1 (0x0000050BU) /*!< Transmission error MailBox 1 flag */ #define CAN_FLAG_RQCP2 (0x00000510U) /*!< Request complete MailBox2 flag */ #define CAN_FLAG_TXOK2 (0x00000511U) /*!< Transmission OK MailBox 2 flag */ #define CAN_FLAG_ALST2 (0x00000512U) /*!< Arbitration Lost MailBox 2 flag */ #define CAN_FLAG_TERR2 (0x00000513U) /*!< Transmission error MailBox 2 flag */ #define CAN_FLAG_TME0 (0x0000051AU) /*!< Transmit mailbox 0 empty flag */ #define CAN_FLAG_TME1 (0x0000051BU) /*!< Transmit mailbox 1 empty flag */ #define CAN_FLAG_TME2 (0x0000051CU) /*!< Transmit mailbox 2 empty flag */ #define CAN_FLAG_LOW0 (0x0000051DU) /*!< Lowest priority mailbox 0 flag */ #define CAN_FLAG_LOW1 (0x0000051EU) /*!< Lowest priority mailbox 1 flag */ #define CAN_FLAG_LOW2 (0x0000051FU) /*!< Lowest priority mailbox 2 flag */ /* Receive Flags */ #define CAN_FLAG_FF0 (0x00000203U) /*!< RX FIFO 0 Full flag */ #define CAN_FLAG_FOV0 (0x00000204U) /*!< RX FIFO 0 Overrun flag */ #define CAN_FLAG_FF1 (0x00000403U) /*!< RX FIFO 1 Full flag */ #define CAN_FLAG_FOV1 (0x00000404U) /*!< RX FIFO 1 Overrun flag */ /* Operating Mode Flags */ #define CAN_FLAG_INAK (0x00000100U) /*!< Initialization acknowledge flag */ #define CAN_FLAG_SLAK (0x00000101U) /*!< Sleep acknowledge flag */ #define CAN_FLAG_ERRI (0x00000102U) /*!< Error flag */ #define CAN_FLAG_WKU (0x00000103U) /*!< Wake up interrupt flag */ #define CAN_FLAG_SLAKI (0x00000104U) /*!< Sleep acknowledge interrupt flag */ /* Error Flags */ #define CAN_FLAG_EWG (0x00000300U) /*!< Error warning flag */ #define CAN_FLAG_EPV (0x00000301U) /*!< Error passive flag */ #define CAN_FLAG_BOF (0x00000302U) /*!< Bus-Off flag */ /** * @} */ /** @defgroup CAN_Interrupts CAN Interrupts * @{ */ /* Transmit Interrupt */ #define CAN_IT_TX_MAILBOX_EMPTY ((uint32_t)CAN_IER_TMEIE) /*!< Transmit mailbox empty interrupt */ /* Receive Interrupts */ #define CAN_IT_RX_FIFO0_MSG_PENDING ((uint32_t)CAN_IER_FMPIE0) /*!< FIFO 0 message pending interrupt */ #define CAN_IT_RX_FIFO0_FULL ((uint32_t)CAN_IER_FFIE0) /*!< FIFO 0 full interrupt */ #define CAN_IT_RX_FIFO0_OVERRUN ((uint32_t)CAN_IER_FOVIE0) /*!< FIFO 0 overrun interrupt */ #define CAN_IT_RX_FIFO1_MSG_PENDING ((uint32_t)CAN_IER_FMPIE1) /*!< FIFO 1 message pending interrupt */ #define CAN_IT_RX_FIFO1_FULL ((uint32_t)CAN_IER_FFIE1) /*!< FIFO 1 full interrupt */ #define CAN_IT_RX_FIFO1_OVERRUN ((uint32_t)CAN_IER_FOVIE1) /*!< FIFO 1 overrun interrupt */ /* Operating Mode Interrupts */ #define CAN_IT_WAKEUP ((uint32_t)CAN_IER_WKUIE) /*!< Wake-up interrupt */ #define CAN_IT_SLEEP_ACK ((uint32_t)CAN_IER_SLKIE) /*!< Sleep acknowledge interrupt */ /* Error Interrupts */ #define CAN_IT_ERROR_WARNING ((uint32_t)CAN_IER_EWGIE) /*!< Error warning interrupt */ #define CAN_IT_ERROR_PASSIVE ((uint32_t)CAN_IER_EPVIE) /*!< Error passive interrupt */ #define CAN_IT_BUSOFF ((uint32_t)CAN_IER_BOFIE) /*!< Bus-off interrupt */ #define CAN_IT_LAST_ERROR_CODE ((uint32_t)CAN_IER_LECIE) /*!< Last error code interrupt */ #define CAN_IT_ERROR ((uint32_t)CAN_IER_ERRIE) /*!< Error Interrupt */ /** * @} */ /** * @} */ /* Exported macros -----------------------------------------------------------*/ /** @defgroup CAN_Exported_Macros CAN Exported Macros * @{ */ /** @brief Reset CAN handle state * @param __HANDLE__ CAN handle. * @retval None */ #define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CAN_STATE_RESET) /** * @brief Enable the specified CAN interrupts. * @param __HANDLE__ CAN handle. * @param __INTERRUPT__ CAN Interrupt sources to enable. * This parameter can be any combination of @arg CAN_Interrupts * @retval None */ #define __HAL_CAN_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) |= (__INTERRUPT__)) /** * @brief Disable the specified CAN interrupts. * @param __HANDLE__ CAN handle. * @param __INTERRUPT__ CAN Interrupt sources to disable. * This parameter can be any combination of @arg CAN_Interrupts * @retval None */ #define __HAL_CAN_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) &= ~(__INTERRUPT__)) /** @brief Check if the specified CAN interrupt source is enabled or disabled. * @param __HANDLE__ specifies the CAN Handle. * @param __INTERRUPT__ specifies the CAN interrupt source to check. * This parameter can be a value of @arg CAN_Interrupts * @retval The state of __IT__ (TRUE or FALSE). */ #define __HAL_CAN_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) & (__INTERRUPT__)) /** @brief Check whether the specified CAN flag is set or not. * @param __HANDLE__ specifies the CAN Handle. * @param __FLAG__ specifies the flag to check. * This parameter can be one of @arg CAN_flags * @retval The state of __FLAG__ (TRUE or FALSE). */ #define __HAL_CAN_GET_FLAG(__HANDLE__, __FLAG__) \ ((((__FLAG__) >> 8U) == 5U)? ((((__HANDLE__)->Instance->TSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 2U)? ((((__HANDLE__)->Instance->RF0R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 4U)? ((((__HANDLE__)->Instance->RF1R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 1U)? ((((__HANDLE__)->Instance->MSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 3U)? ((((__HANDLE__)->Instance->ESR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U) /** @brief Clear the specified CAN pending flag. * @param __HANDLE__ specifies the CAN Handle. * @param __FLAG__ specifies the flag to check. * This parameter can be one of the following values: * @arg CAN_FLAG_RQCP0: Request complete MailBox 0 Flag * @arg CAN_FLAG_TXOK0: Transmission OK MailBox 0 Flag * @arg CAN_FLAG_ALST0: Arbitration Lost MailBox 0 Flag * @arg CAN_FLAG_TERR0: Transmission error MailBox 0 Flag * @arg CAN_FLAG_RQCP1: Request complete MailBox 1 Flag * @arg CAN_FLAG_TXOK1: Transmission OK MailBox 1 Flag * @arg CAN_FLAG_ALST1: Arbitration Lost MailBox 1 Flag * @arg CAN_FLAG_TERR1: Transmission error MailBox 1 Flag * @arg CAN_FLAG_RQCP2: Request complete MailBox 2 Flag * @arg CAN_FLAG_TXOK2: Transmission OK MailBox 2 Flag * @arg CAN_FLAG_ALST2: Arbitration Lost MailBox 2 Flag * @arg CAN_FLAG_TERR2: Transmission error MailBox 2 Flag * @arg CAN_FLAG_FF0: RX FIFO 0 Full Flag * @arg CAN_FLAG_FOV0: RX FIFO 0 Overrun Flag * @arg CAN_FLAG_FF1: RX FIFO 1 Full Flag * @arg CAN_FLAG_FOV1: RX FIFO 1 Overrun Flag * @arg CAN_FLAG_WKUI: Wake up Interrupt Flag * @arg CAN_FLAG_SLAKI: Sleep acknowledge Interrupt Flag * @retval None */ #define __HAL_CAN_CLEAR_FLAG(__HANDLE__, __FLAG__) \ ((((__FLAG__) >> 8U) == 5U)? (((__HANDLE__)->Instance->TSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 2U)? (((__HANDLE__)->Instance->RF0R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 4U)? (((__HANDLE__)->Instance->RF1R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 1U)? (((__HANDLE__)->Instance->MSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U) /** * @} */ /* Exported functions --------------------------------------------------------*/ /** @addtogroup CAN_Exported_Functions CAN Exported Functions * @{ */ /** @addtogroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions * @brief Initialization and Configuration functions * @{ */ /* Initialization and de-initialization functions *****************************/ HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan); void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan); void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan); /** * @} */ /** @addtogroup CAN_Exported_Functions_Group2 Configuration functions * @brief Configuration functions * @{ */ /* Configuration functions ****************************************************/ HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef *hcan, CAN_FilterTypeDef *sFilterConfig); /** * @} */ /** @addtogroup CAN_Exported_Functions_Group3 Control functions * @brief Control functions * @{ */ /* Control functions **********************************************************/ HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_Stop(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan); uint32_t HAL_CAN_IsSleepActive(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, CAN_TxHeaderTypeDef *pHeader, uint8_t aData[], uint32_t *pTxMailbox); HAL_StatusTypeDef HAL_CAN_AbortTxRequest(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes); uint32_t HAL_CAN_GetTxMailboxesFreeLevel(CAN_HandleTypeDef *hcan); uint32_t HAL_CAN_IsTxMessagePending(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes); uint32_t HAL_CAN_GetTxTimestamp(CAN_HandleTypeDef *hcan, uint32_t TxMailbox); HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]); uint32_t HAL_CAN_GetRxFifoFillLevel(CAN_HandleTypeDef *hcan, uint32_t RxFifo); /** * @} */ /** @addtogroup CAN_Exported_Functions_Group4 Interrupts management * @brief Interrupts management * @{ */ /* Interrupts management ******************************************************/ HAL_StatusTypeDef HAL_CAN_ActivateNotification(CAN_HandleTypeDef *hcan, uint32_t ActiveITs); HAL_StatusTypeDef HAL_CAN_DeactivateNotification(CAN_HandleTypeDef *hcan, uint32_t InactiveITs); void HAL_CAN_IRQHandler(CAN_HandleTypeDef *hcan); /** * @} */ /** @addtogroup CAN_Exported_Functions_Group5 Callback functions * @brief Callback functions * @{ */ /* Callbacks functions ********************************************************/ void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan); void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan); /** * @} */ /** @addtogroup CAN_Exported_Functions_Group6 Peripheral State and Error functions * @brief CAN Peripheral State functions * @{ */ /* Peripheral State and Error functions ***************************************/ HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef *hcan); uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan); /** * @} */ /** * @} */ /* Private types -------------------------------------------------------------*/ /** @defgroup CAN_Private_Types CAN Private Types * @{ */ /** * @} */ /* Private variables ---------------------------------------------------------*/ /** @defgroup CAN_Private_Variables CAN Private Variables * @{ */ /** * @} */ /* Private constants ---------------------------------------------------------*/ /** @defgroup CAN_Private_Constants CAN Private Constants * @{ */ #define CAN_FLAG_MASK (0x000000FFU) /** * @} */ /* Private Macros -----------------------------------------------------------*/ /** @defgroup CAN_Private_Macros CAN Private Macros * @{ */ #define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \ ((MODE) == CAN_MODE_LOOPBACK)|| \ ((MODE) == CAN_MODE_SILENT) || \ ((MODE) == CAN_MODE_SILENT_LOOPBACK)) #define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ) || \ ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ)) #define IS_CAN_BS1(BS1) (((BS1) == CAN_BS1_1TQ) || ((BS1) == CAN_BS1_2TQ) || \ ((BS1) == CAN_BS1_3TQ) || ((BS1) == CAN_BS1_4TQ) || \ ((BS1) == CAN_BS1_5TQ) || ((BS1) == CAN_BS1_6TQ) || \ ((BS1) == CAN_BS1_7TQ) || ((BS1) == CAN_BS1_8TQ) || \ ((BS1) == CAN_BS1_9TQ) || ((BS1) == CAN_BS1_10TQ)|| \ ((BS1) == CAN_BS1_11TQ)|| ((BS1) == CAN_BS1_12TQ)|| \ ((BS1) == CAN_BS1_13TQ)|| ((BS1) == CAN_BS1_14TQ)|| \ ((BS1) == CAN_BS1_15TQ)|| ((BS1) == CAN_BS1_16TQ)) #define IS_CAN_BS2(BS2) (((BS2) == CAN_BS2_1TQ) || ((BS2) == CAN_BS2_2TQ) || \ ((BS2) == CAN_BS2_3TQ) || ((BS2) == CAN_BS2_4TQ) || \ ((BS2) == CAN_BS2_5TQ) || ((BS2) == CAN_BS2_6TQ) || \ ((BS2) == CAN_BS2_7TQ) || ((BS2) == CAN_BS2_8TQ)) #define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 1024U)) #define IS_CAN_FILTER_ID_HALFWORD(HALFWORD) ((HALFWORD) <= 0xFFFFU) #if defined(CAN2) #define IS_CAN_FILTER_BANK_DUAL(BANK) ((BANK) <= 27U) #endif #define IS_CAN_FILTER_BANK_SINGLE(BANK) ((BANK) <= 13U) #define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \ ((MODE) == CAN_FILTERMODE_IDLIST)) #define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \ ((SCALE) == CAN_FILTERSCALE_32BIT)) #define IS_CAN_FILTER_ACTIVATION(ACTIVATION) (((ACTIVATION) == CAN_FILTER_DISABLE) || \ ((ACTIVATION) == CAN_FILTER_ENABLE)) #define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \ ((FIFO) == CAN_FILTER_FIFO1)) #define IS_CAN_TX_MAILBOX(TRANSMITMAILBOX) (((TRANSMITMAILBOX) == CAN_TX_MAILBOX0 ) || \ ((TRANSMITMAILBOX) == CAN_TX_MAILBOX1 ) || \ ((TRANSMITMAILBOX) == CAN_TX_MAILBOX2 )) #define IS_CAN_TX_MAILBOX_LIST(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | CAN_TX_MAILBOX2)) #define IS_CAN_STDID(STDID) ((STDID) <= 0x7FFU) #define IS_CAN_EXTID(EXTID) ((EXTID) <= 0x1FFFFFFFU) #define IS_CAN_DLC(DLC) ((DLC) <= 8U) #define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \ ((IDTYPE) == CAN_ID_EXT)) #define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE)) #define IS_CAN_RX_FIFO(FIFO) (((FIFO) == CAN_RX_FIFO0) || ((FIFO) == CAN_RX_FIFO1)) #define IS_CAN_IT(IT) ((IT) <= (CAN_IT_TX_MAILBOX_EMPTY | CAN_IT_RX_FIFO0_MSG_PENDING | \ CAN_IT_RX_FIFO0_FULL | CAN_IT_RX_FIFO0_OVERRUN | \ CAN_IT_RX_FIFO1_MSG_PENDING | CAN_IT_RX_FIFO1_FULL | \ CAN_IT_RX_FIFO1_OVERRUN | CAN_IT_WAKEUP | \ CAN_IT_SLEEP_ACK | CAN_IT_ERROR_WARNING | \ CAN_IT_ERROR_PASSIVE | CAN_IT_BUSOFF | \ CAN_IT_LAST_ERROR_CODE | CAN_IT_ERROR)) /** * @} */ /* End of private macros -----------------------------------------------------*/ /** * @} */ #endif /* CAN1 */ /** * @} */ #ifdef __cplusplus } #endif #endif /* STM32F1xx_HAL_CAN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 求大佬指点哪里错了。。
请问error: #137: expression must be a modifiable lvalue的原因是什么?
今天在keil 5上写了一串蜂鸣器的代码,用的板子是stm32f10系列,在运行代码时出现了上述错误 为什么我的BEEP=0在编译器那里会报错? (这是我的BEEP定义:#define BEEP PBout(8)) #include "stm32f10x.h" #include "beep.h" void BEEP_Init(void) { RCC->APB2ENR|=1<<3; GPIOB->CRH&=0xFFFFFFF0; GPIOB->CRH|=0x00000003; //GPIOE->ODR&=~(1<<8); BEEP=0;(出错行) } error: #137: expression must be a modifiable lvalue 这个是我的beep.h //#pragma once #define BEEP PBout(8) void BEEP_Init(void); 但是我的BEEP=0的操作在另一个文件里没有报错,只在这个文件里报错,在网上搜也搜不到答案。求助大神55
关于keil中头文件无法打开
最近在搞keil相关的东西,先遇到一问题,想向各位大神们请教! 我在Keil uVision4中新建了一个工程,添加了一个.c文件,其中包含#include<boebot.h>,但是问题出现了说不能打开。 请问是什么问题?
keil C51 数码管的动态显示 延时问题
我在写数码管动态显示的时候发现意义相同的两个代码写出来显示的结果却不同,代码如下: ``` void display_SEG(unsigned int t) { Y_SEG_show(1, 2); while(t--); Y_SEG_show(2, 0); while(t--); Y_SEG_show(3, 1); while(t--); Y_SEG_show(4, 8); while(t--); Y_SEG_show(5, 16); while(t--); Y_SEG_show(6, 16); while(t--); Y_SEG_show(7, i/10); while(t--); Y_SEG_show(8, i%10); while(t--); } ``` t=500;上面这个运行起来延时时间明显过长,从而达不到余辉效应。 ``` void delay_SEG(unsigned char t) { while(t--); } void display_SEG() { Y_SEG_show(1, 2); delay_SEG(500); Y_SEG_show(2, 0); delay_SEG(500); Y_SEG_show(3, 1); delay_SEG(500); Y_SEG_show(4, 8); delay_SEG(500); Y_SEG_show(5, 16); delay_SEG(500); Y_SEG_show(6, 16); delay_SEG(500); Y_SEG_show(7, i/10); delay_SEG(500); Y_SEG_show(8, i%10); delay_SEG(500); } ``` 当定义一个延时函数放进去时,却可以达到效果,可用的不都是while(500--)的延迟吗,为什么会有这个差别。求解答
关于STC89le52实际应用的相关问题
请问各位大佬,89le52在keil中怎么选用芯片?protues中怎么寻找相关芯片? 因毕设涉及NRF24L01,工作电压大概3v,所有直接用89LE52。学习过C51单片机的相关知识,知道两者电压不同,但是不会应用le52。C51编写的程序代码可以在LE52上面使用吗? 希望大佬们解答详细一点,谢谢!新年快乐!
keil c51 和keil v6.12有什么区别
我需要下载的keil版本为v6.12,但在keil官网上只能买到keil c51,请问这两个有区别吗?可以买c51吗?(用于单片机编程)主要是我买的书上使用的版本为v6.12
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
2020 年,大火的 Python 和 JavaScript 是否会被取而代之?
Python 和 JavaScript 是目前最火的两大编程语言,但是2020 年,什么编程语言将会取而代之呢? 作者 |Richard Kenneth Eng 译者 |明明如月,责编 | 郭芮 出品 | CSDN(ID:CSDNnews) 以下为译文: Python 和 JavaScript 是目前最火的两大编程语言。然而,他们不可能永远屹立不倒。最终,必将像其他编程语言一...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
Idea 中最常用的10款插件(提高开发效率),一定要学会使用!
学习使用一些插件,可以提高开发效率。对于我们开发人员很有帮助。这篇博客介绍了开发中使用的插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
立即提问

相似问题

2
keil5打开keil4工程后编译出现问题怎么办?
1
keil软件兼不兼容Arduino开发板?求大神们帮我解答一下 ~~谢谢
1
在STM32Cube中启动touchGFX编辑界面,编译MDK工程时遇到问题
3
keil无法生成带后缀的hex文件,会生成一个文件,文件类型根据设置的名字决定。
1
STM32串口如何实现一个发数据,另外一个接收数据
1
qpOASES库keil移植的问题
0
keil2中在编译后的program size不见了,怎样调出来?
3
求大佬STM32F103控制格力空调(遥控器的型号为YAP0F3)代码
0
各位大佬,keil uvision4没有load flash设置界面怎么破?打开Settings后的窗口界面只有烧录口选项。
2
keil跨文件调用结构体报错
2
使用keil编程第一部就出了问题
0
单片机与接口技术课程任务设计书
1
小白使用keil编程debug进入了harddefault,搞了半天没解决。求大佬帮下忙。
1
使用结构体名->定义的新的变量编译出错,贴详细代码,请解释疑问
2
Keil编译提示乱码,网上找了好几种方法都解决不了。
1
单片机编写EEPROM时,该程序中为什么只能用<reg52.h>作头文件,而换成<regx52.h>就是错误的呢?
2
stm32 如何在 KEIL 中 建立内部 EEPROM HEX 文件
1
keil软件编译stm32固件库出错,自己改的固件库
1
求助:利用luby控制器,无法接收到传感器模拟值(仿人自主格斗机器人),机械结构检查了,没有问题
0
no debug unit device found 怎么解决