学前班
最后登录1970-1-1
在线时间 小时
注册时间2014-10-30
|
我想问一下我在bsp_usart1.h里定义了
#include "stm32f10x.h"
#include <stdio.h>
#define USART1_DR_Base 0x40013804
#define SENDBUFF_SIZE 5000
//void NVIC_Config(void);
void USART1_Config(void);
void USART1_DMA_Config(void);
然后在bsp_usart1.c里写了
uint8_t SendBuff[SENDBUFF_SIZE];
void USART1_DMA_Config(void)
{
DMA_InitTypeDef DMA_InitStructure;
RCC_APB2PeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
DMA_InitStructure.DMA_PeripheralBaseAddr=USART1_DR_Base;
DMA_InitStructure.DMA_MemoryBaseAddr=(u32)SendBuff;
DMA_InitStructure.DMA_DIR=DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize=SENDBUFF_SIZE;
DMA_InitStructure.DMA_PeripheralInc=DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc=DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize=DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize=DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode=DMA_Mode_Normal;
DMA_InitStructure.DMA_Priority=DMA_Priority_Medium;
DMA_InitStructure.DMA_M2M=DMA_M2M_Disable;
DMA_Init(DMA1_Channel4,&DMA_InitStructure );
DMA_Cmd(DMA1_Channel4, ENABLE);
DMA_ITConfig(DMA1_Channel4,DMA_IT_TC,ENABLE);
}
为什么编译的时候会报错:
..\..\User\usart\bsp_usart1.c(21): error: #20: identifier "SENDBUFF_SIZE" is undefined
..\..\User\usart\bsp_usart1.c(70): error: #20: identifier "USART1_DR_Base" is undefined
file:///C:\Users\Sun shiqi\AppData\Roaming\Tencent\Users\1138424121\QQ\WinTemp\RichOle\DPYCXPRB(BUT20ULZ)DOX93.jpg
|
-
|