增加STM32F1项目,修正平台级编译错误
This commit is contained in:
parent
1d6498c866
commit
38e00677e4
|
@ -12,12 +12,12 @@ extern void SerialPort_GetPins(byte index, byte remap, Pin* txPin, Pin* rxPin);
|
|||
|
||||
void SerialPort::OnInit()
|
||||
{
|
||||
/*_parity = USART_Parity_No;
|
||||
_dataBits = USART_WordLength_8b;
|
||||
_stopBits = USART_StopBits_1;*/
|
||||
_dataBits = 8;
|
||||
_parity = 0;
|
||||
_stopBits = 1;
|
||||
/*_parity = USART_Parity_No;
|
||||
_dataBits = USART_WordLength_8b;
|
||||
_stopBits = USART_StopBits_1;*/
|
||||
_dataBits = 8;
|
||||
_parity = 0;
|
||||
_stopBits = 1;
|
||||
}
|
||||
|
||||
bool SerialPort::OnSet()
|
||||
|
@ -27,51 +27,51 @@ bool SerialPort::OnSet()
|
|||
|
||||
SerialPort_GetPins(Index, Remap, &Pins[0], &Pins[1]);
|
||||
|
||||
auto sp = g_Uart_Ports[Index];
|
||||
State = sp;
|
||||
auto sp = g_Uart_Ports[Index];
|
||||
State = sp;
|
||||
|
||||
// 根据端口实际情况决定打开状态
|
||||
return sp->CR1 & USART_CR1_UE;
|
||||
}
|
||||
|
||||
WEAK void SerialPort_Opening(SerialPort& sp) { }
|
||||
WEAK void SerialPort_Closeing(SerialPort& sp) { }
|
||||
WEAK void SerialPort_Opening(SerialPort& sp) { }
|
||||
WEAK void SerialPort_Closeing(SerialPort& sp) { }
|
||||
|
||||
// 打开串口
|
||||
void SerialPort::OnOpen2()
|
||||
{
|
||||
auto st = (USART_TypeDef*)State;
|
||||
auto st = (USART_TypeDef*)State;
|
||||
|
||||
// 不要关调试口,否则杯具
|
||||
if(Index != Sys.MessagePort) USART_DeInit(st);
|
||||
if (Index != Sys.MessagePort) USART_DeInit(st);
|
||||
// USART_DeInit其实就是关闭时钟,这里有点多此一举。但为了安全起见,还是使用
|
||||
|
||||
SerialPort_Opening(*this);
|
||||
|
||||
const ushort paritys[] = { USART_Parity_No, USART_Parity_Even, USART_Parity_Odd };
|
||||
if(_parity >= ArrayLength(paritys)) _parity = 0;
|
||||
const ushort paritys[] = { USART_Parity_No, USART_Parity_Even, USART_Parity_Odd };
|
||||
if (_parity >= ArrayLength(paritys)) _parity = 0;
|
||||
|
||||
#ifdef STM32F0
|
||||
const ushort StopBits[] = { 1, USART_StopBits_1, 2, USART_StopBits_2, 15, USART_StopBits_1_5 };
|
||||
const ushort StopBits[] = { 1, USART_StopBits_1, 2, USART_StopBits_2, 15, USART_StopBits_1_5 };
|
||||
#else
|
||||
const ushort StopBits[] = { 1, USART_StopBits_1, 5, USART_StopBits_0_5, 2, USART_StopBits_2, 15, USART_StopBits_1_5 };
|
||||
const ushort StopBits[] = { 1, USART_StopBits_1, 5, USART_StopBits_0_5, 2, USART_StopBits_2, 15, USART_StopBits_1_5 };
|
||||
#endif
|
||||
ushort stop = StopBits[1];
|
||||
for(int i=0; i<ArrayLength(StopBits); i+=2)
|
||||
ushort stop = StopBits[1];
|
||||
for (int i = 0; i < ArrayLength(StopBits); i += 2)
|
||||
{
|
||||
if(StopBits[i] == _stopBits)
|
||||
if (StopBits[i] == _stopBits)
|
||||
{
|
||||
stop = StopBits[i+1];
|
||||
stop = StopBits[i + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
USART_InitTypeDef p;
|
||||
USART_StructInit(&p);
|
||||
p.USART_BaudRate = _baudRate;
|
||||
p.USART_WordLength = _dataBits == 8 ? USART_WordLength_8b : USART_WordLength_9b;
|
||||
p.USART_StopBits = stop;
|
||||
p.USART_Parity = paritys[_parity];
|
||||
USART_StructInit(&p);
|
||||
p.USART_BaudRate = _baudRate;
|
||||
p.USART_WordLength = _dataBits == 8 ? USART_WordLength_8b : USART_WordLength_9b;
|
||||
p.USART_StopBits = stop;
|
||||
p.USART_Parity = paritys[_parity];
|
||||
USART_Init(st, &p);
|
||||
|
||||
// 串口接收中断配置,同时会打开过载错误中断
|
||||
|
@ -89,7 +89,7 @@ void SerialPort::OnOpen2()
|
|||
byte irq = uart_irqs[Index];
|
||||
Interrupt.SetPriority(irq, 0);
|
||||
Interrupt.Activate(irq, OnHandler, this);
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
USART_Cmd(st, ENABLE);//使能串口
|
||||
}
|
||||
|
@ -97,11 +97,11 @@ void SerialPort::OnOpen2()
|
|||
// 关闭端口
|
||||
void SerialPort::OnClose2()
|
||||
{
|
||||
auto st = (USART_TypeDef*)State;
|
||||
auto st = (USART_TypeDef*)State;
|
||||
USART_Cmd(st, DISABLE);
|
||||
USART_DeInit(st);
|
||||
USART_DeInit(st);
|
||||
|
||||
Ports[0]->Close();
|
||||
Ports[0]->Close();
|
||||
Ports[1]->Close();
|
||||
|
||||
byte irq = uart_irqs[Index];
|
||||
|
@ -111,7 +111,7 @@ void SerialPort::OnClose2()
|
|||
}
|
||||
|
||||
// 发送单一字节数据
|
||||
uint SerialPort::SendData(byte data, uint times)
|
||||
int SerialPort::SendData(byte data, int times)
|
||||
{
|
||||
/*
|
||||
在USART_DR寄存器中写入了最后一个数据字后,在关闭USART模块之前或设置微控制器进入低功耗模式之前,
|
||||
|
@ -119,11 +119,11 @@ uint SerialPort::SendData(byte data, uint times)
|
|||
1.读一次USART_SR寄存器;
|
||||
2.写一次USART_DR寄存器。
|
||||
*/
|
||||
auto st = (USART_TypeDef*)State;
|
||||
auto st = (USART_TypeDef*)State;
|
||||
USART_SendData(st, (ushort)data);
|
||||
// 等待发送完毕
|
||||
while(USART_GetFlagStatus(st, USART_FLAG_TXE) == RESET && --times > 0);
|
||||
if(!times) Error++;
|
||||
while (USART_GetFlagStatus(st, USART_FLAG_TXE) == RESET && --times > 0);
|
||||
if (!times) Error++;
|
||||
|
||||
return times;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ void SerialPort::OnWrite2()
|
|||
// 关键性代码,放到开头
|
||||
INROOT void SerialPort::OnTxHandler()
|
||||
{
|
||||
if(!Tx.Empty())
|
||||
if (!Tx.Empty())
|
||||
USART_SendData((USART_TypeDef*)State, (ushort)Tx.Dequeue());
|
||||
else
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ INROOT void SerialPort::OnRxHandler()
|
|||
|
||||
// 收到数据,开启任务调度。延迟_byteTime,可能还有字节到来
|
||||
//!!! 暂时注释任务唤醒,避免丢数据问题
|
||||
if(_taskidRx && Rx.Length() >= MinSize)
|
||||
if (_taskidRx && Rx.Length() >= MinSize)
|
||||
{
|
||||
//Sys.SetTask(_taskidRx, true, (ByteTime >> 10) + 1);
|
||||
((Task*)_task)->Set(true, 20);
|
||||
|
@ -168,16 +168,16 @@ INROOT void SerialPort::OnRxHandler()
|
|||
// 真正的串口中断函数
|
||||
INROOT void SerialPort::OnHandler(ushort num, void* param)
|
||||
{
|
||||
auto sp = (SerialPort*)param;
|
||||
auto st = (USART_TypeDef*)sp->State;
|
||||
auto sp = (SerialPort*)param;
|
||||
auto st = (USART_TypeDef*)sp->State;
|
||||
|
||||
//#if !(defined(STM32F0) || defined(GD32F150))
|
||||
if(USART_GetITStatus(st, USART_IT_TXE) != RESET) sp->OnTxHandler();
|
||||
//#endif
|
||||
// 接收中断
|
||||
if(USART_GetITStatus(st, USART_IT_RXNE) != RESET) sp->OnRxHandler();
|
||||
//#if !(defined(STM32F0) || defined(GD32F150))
|
||||
if (USART_GetITStatus(st, USART_IT_TXE) != RESET) sp->OnTxHandler();
|
||||
//#endif
|
||||
// 接收中断
|
||||
if (USART_GetITStatus(st, USART_IT_RXNE) != RESET) sp->OnRxHandler();
|
||||
// 溢出
|
||||
if(USART_GetFlagStatus(st, USART_FLAG_ORE) != RESET)
|
||||
if (USART_GetFlagStatus(st, USART_FLAG_ORE) != RESET)
|
||||
{
|
||||
//USART_ClearFlag(st, USART_FLAG_ORE); // ST 库文件 ClearFlag 不许动 USART_FLAG_ORE 寄存器
|
||||
// 读取并扔到错误数据
|
||||
|
|
|
@ -8,120 +8,120 @@
|
|||
//static const uint STM32_FLASH_KEY2 = 0xcdef89ab;
|
||||
|
||||
#if defined (STM32F10X_HD) || defined (STM32F10X_HD_VL) || defined (STM32F10X_CL) || defined (STM32F10X_XL)
|
||||
#define FLASH_PAGE_SIZE ((uint16_t)0x800)
|
||||
#define FLASH_PAGE_SIZE ((uint16_t)0x800)
|
||||
#else
|
||||
#define FLASH_PAGE_SIZE ((uint16_t)0x400)
|
||||
#define FLASH_PAGE_SIZE ((uint16_t)0x400)
|
||||
#endif
|
||||
|
||||
void Flash::OnInit()
|
||||
{
|
||||
Block = FLASH_PAGE_SIZE;
|
||||
Block = FLASH_PAGE_SIZE;
|
||||
}
|
||||
|
||||
/* 写入段数据 (起始段,段数量,目标缓冲区,读改写) */
|
||||
bool Flash::WriteBlock(uint address, const byte* buf, uint len, bool inc) const
|
||||
bool Flash::WriteBlock(uint address, const byte* buf, int len, bool inc) const
|
||||
{
|
||||
if(address < Start || address + len > Start + Size) return false;
|
||||
if (address < Start || address + len > Start + Size) return false;
|
||||
|
||||
// 进行闪存编程操作时(写或擦除),必须打开内部的RC振荡器(HSI)
|
||||
// 打开 HSI 时钟
|
||||
RCC->CR |= RCC_CR_HSION;
|
||||
while(!(RCC->CR & RCC_CR_HSIRDY));
|
||||
// 进行闪存编程操作时(写或擦除),必须打开内部的RC振荡器(HSI)
|
||||
// 打开 HSI 时钟
|
||||
RCC->CR |= RCC_CR_HSION;
|
||||
while (!(RCC->CR & RCC_CR_HSIRDY));
|
||||
|
||||
/*if (FLASH->CR & FLASH_CR_LOCK) { // unlock
|
||||
FLASH->KEYR = STM32_FLASH_KEY1;
|
||||
FLASH->KEYR = STM32_FLASH_KEY2;
|
||||
}*/
|
||||
FLASH_Unlock();
|
||||
/*if (FLASH->CR & FLASH_CR_LOCK) { // unlock
|
||||
FLASH->KEYR = STM32_FLASH_KEY1;
|
||||
FLASH->KEYR = STM32_FLASH_KEY2;
|
||||
}*/
|
||||
FLASH_Unlock();
|
||||
|
||||
ushort* s = (ushort*)address;
|
||||
ushort* e = (ushort*)(address + len);
|
||||
const ushort* p = (const ushort*)buf;
|
||||
ushort* s = (ushort*)address;
|
||||
ushort* e = (ushort*)(address + len);
|
||||
const ushort* p = (const ushort*)buf;
|
||||
|
||||
// 开始编程
|
||||
FLASH->CR = FLASH_CR_PG;
|
||||
//FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
|
||||
// 开始编程
|
||||
FLASH->CR = FLASH_CR_PG;
|
||||
//FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
|
||||
|
||||
while(s < e) {
|
||||
if (*s != *p) {
|
||||
*s = *p;
|
||||
while (FLASH->SR & FLASH_SR_BSY);
|
||||
if (*s != *p) {
|
||||
debug_printf("Flash::WriteBlock 失败 0x%08x, 写 0x%04x, 读 0x%04x\r\n", s, *p, *s);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
s++;
|
||||
if(inc) p++;
|
||||
}
|
||||
while (s < e) {
|
||||
if (*s != *p) {
|
||||
*s = *p;
|
||||
while (FLASH->SR & FLASH_SR_BSY);
|
||||
if (*s != *p) {
|
||||
debug_printf("Flash::WriteBlock 失败 0x%08x, 写 0x%04x, 读 0x%04x\r\n", s, *p, *s);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
s++;
|
||||
if (inc) p++;
|
||||
}
|
||||
|
||||
// 重置并锁定控制器。直接赋值一了百了,后面两个都是位运算,更麻烦
|
||||
//FLASH->CR = FLASH_CR_LOCK;
|
||||
//FLASH->CR &= ~FLASH_CR_PG;
|
||||
FLASH_Lock();
|
||||
// 重置并锁定控制器。直接赋值一了百了,后面两个都是位运算,更麻烦
|
||||
//FLASH->CR = FLASH_CR_LOCK;
|
||||
//FLASH->CR &= ~FLASH_CR_PG;
|
||||
FLASH_Lock();
|
||||
|
||||
// 关闭 HSI 时钟
|
||||
RCC->CR &= ~RCC_CR_HSION;
|
||||
// 关闭 HSI 时钟
|
||||
RCC->CR &= ~RCC_CR_HSION;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 擦除块 (段地址) */
|
||||
bool Flash::EraseBlock(uint address) const
|
||||
{
|
||||
if(address < Start || address + Block > Start + Size) return false;
|
||||
if (address < Start || address + Block > Start + Size) return false;
|
||||
|
||||
#if FLASH_DEBUG
|
||||
debug_printf("\tFlash::EraseBlock(0x%08x)\r\n", address);
|
||||
debug_printf("\tFlash::EraseBlock(0x%08x)\r\n", address);
|
||||
#endif
|
||||
|
||||
// 进行闪存编程操作时(写或擦除),必须打开内部的RC振荡器(HSI)
|
||||
// 打开 HSI 时钟
|
||||
RCC->CR |= RCC_CR_HSION;
|
||||
while(!(RCC->CR & RCC_CR_HSIRDY));
|
||||
// 进行闪存编程操作时(写或擦除),必须打开内部的RC振荡器(HSI)
|
||||
// 打开 HSI 时钟
|
||||
RCC->CR |= RCC_CR_HSION;
|
||||
while (!(RCC->CR & RCC_CR_HSIRDY));
|
||||
|
||||
/*if (FLASH->CR & FLASH_CR_LOCK) { // unlock
|
||||
FLASH->KEYR = STM32_FLASH_KEY1;
|
||||
FLASH->KEYR = STM32_FLASH_KEY2;
|
||||
}*/
|
||||
FLASH_Unlock();
|
||||
/*if (FLASH->CR & FLASH_CR_LOCK) { // unlock
|
||||
FLASH->KEYR = STM32_FLASH_KEY1;
|
||||
FLASH->KEYR = STM32_FLASH_KEY2;
|
||||
}*/
|
||||
FLASH_Unlock();
|
||||
|
||||
// 打开擦除
|
||||
/*FLASH->CR = FLASH_CR_PER;
|
||||
// 设置页地址
|
||||
FLASH->AR = (uint)address;
|
||||
// 开始擦除
|
||||
FLASH->CR = FLASH_CR_PER | FLASH_CR_STRT;
|
||||
// 确保繁忙标记位被设置 (参考 STM32 勘误表)
|
||||
FLASH->CR = FLASH_CR_PER | FLASH_CR_STRT;
|
||||
// 等待完成
|
||||
while (FLASH->SR & FLASH_SR_BSY);*/
|
||||
// 打开擦除
|
||||
/*FLASH->CR = FLASH_CR_PER;
|
||||
// 设置页地址
|
||||
FLASH->AR = (uint)address;
|
||||
// 开始擦除
|
||||
FLASH->CR = FLASH_CR_PER | FLASH_CR_STRT;
|
||||
// 确保繁忙标记位被设置 (参考 STM32 勘误表)
|
||||
FLASH->CR = FLASH_CR_PER | FLASH_CR_STRT;
|
||||
// 等待完成
|
||||
while (FLASH->SR & FLASH_SR_BSY);*/
|
||||
|
||||
//FLASH_Status status = FLASH_COMPLETE;
|
||||
//boolret = true;
|
||||
//FLASH_Status status = FLASH_COMPLETE;
|
||||
//boolret = true;
|
||||
|
||||
#ifndef STM32F4
|
||||
FLASH_Status status = FLASH_ErasePage(address);
|
||||
FLASH_Status status = FLASH_ErasePage(address);
|
||||
#else
|
||||
FLASH_Status status = FLASH_EraseSector(address, VoltageRange_3);
|
||||
FLASH_Status status = FLASH_EraseSector(address, VoltageRange_3);
|
||||
#endif
|
||||
bool ret = status == FLASH_COMPLETE;
|
||||
bool ret = status == FLASH_COMPLETE;
|
||||
|
||||
// 重置并锁定控制器。直接赋值一了百了,后面两个都是位运算,更麻烦
|
||||
//FLASH->CR = FLASH_CR_LOCK;
|
||||
//FLASH->CR &= ~FLASH_CR_PER;
|
||||
FLASH_Lock();
|
||||
// 重置并锁定控制器。直接赋值一了百了,后面两个都是位运算,更麻烦
|
||||
//FLASH->CR = FLASH_CR_LOCK;
|
||||
//FLASH->CR &= ~FLASH_CR_PER;
|
||||
FLASH_Lock();
|
||||
|
||||
// 关闭 HSI 时钟
|
||||
RCC->CR &= ~RCC_CR_HSION;
|
||||
// 关闭 HSI 时钟
|
||||
RCC->CR &= ~RCC_CR_HSION;
|
||||
|
||||
#if FLASH_DEBUG
|
||||
/*byte* p = (byte*)address;
|
||||
for(int i=0; i<0x10; i++) debug_printf(" %02X", *p++);
|
||||
debug_printf("\r\n");*/
|
||||
/*byte* p = (byte*)address;
|
||||
for(int i=0; i<0x10; i++) debug_printf(" %02X", *p++);
|
||||
debug_printf("\r\n");*/
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -190,7 +190,8 @@ bool Flash::ReadOutProtection(bool set)
|
|||
* OB_RDP_Level_1 : Read protection of the memory
|
||||
* OB_RDP_Level_2 : Chip protection */
|
||||
FLASH_OB_Lock();
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
// 取消读保护会清空 Flash 内容,注意:要上电复位才可以使用IC
|
||||
FLASH_Unlock();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __STM32_H
|
||||
#ifndef __STM32_H
|
||||
#define __STM32_H
|
||||
|
||||
#if !defined(STM32F0) && !defined(STM32F1) && !defined(STM32F4) && !defined(GD32F150)
|
||||
|
@ -45,6 +45,15 @@
|
|||
#define USE_STDPERIPH_DRIVER
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define __ASM __asm
|
||||
#define __INLINE inline
|
||||
#define __WFI
|
||||
|
||||
static __INLINE void __DSB() { }
|
||||
static __INLINE void __DMB() { }
|
||||
#endif
|
||||
|
||||
#if defined(STM32F4)
|
||||
#include "stm32f4xx.h"
|
||||
#include "Pin_STM32F4.h"
|
||||
|
|
|
@ -0,0 +1,152 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E3FBB0A1-21E2-4720-A447-BB9B4631955E}</ProjectGuid>
|
||||
<RootNamespace>STM32F1</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>..\;..\..\Lib\inc\;..\..\Lib\CMSIS\;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>..\;..\..\Lib\inc\;..\..\Lib\CMSIS\;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>STM32F1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>STM32F1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Platform\CortexM\Interrupt.cpp" />
|
||||
<ClCompile Include="..\Platform\CortexM\Port.cpp" />
|
||||
<ClCompile Include="..\Platform\CortexM\Runtime.cpp" />
|
||||
<ClCompile Include="..\Platform\CortexM\SerialPort.cpp" />
|
||||
<ClCompile Include="..\Platform\CortexM\Sys.cpp" />
|
||||
<ClCompile Include="..\Platform\CortexM\Thread.cpp" />
|
||||
<ClCompile Include="..\Platform\CortexM\Time.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\ADC.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Boot_F1.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\CAN.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\DAC.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\DMA.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Flash.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\I2C.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Interrupt.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Port.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Power.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Pwm.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\RTC.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\SerialPort.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Spi.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\Timer.cpp" />
|
||||
<ClCompile Include="..\Platform\STM32F1\WatchDog.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="SmartOS.vcxproj">
|
||||
<Project>{6c0d43a8-8411-48f3-989e-51c5379a5563}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="STM32F1">
|
||||
<UniqueIdentifier>{39d63b8a-0872-411c-ad23-689a43861d49}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="CortexM">
|
||||
<UniqueIdentifier>{7bce6691-e556-4a39-9dc3-426ec04026c9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Platform\STM32F1\WatchDog.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\ADC.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Boot_F1.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\CAN.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\DAC.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\DMA.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Flash.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\I2C.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Interrupt.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Port.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Power.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Pwm.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\RTC.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\SerialPort.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Spi.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\STM32F1\Timer.cpp">
|
||||
<Filter>STM32F1</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\Time.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\Interrupt.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\Port.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\Runtime.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\SerialPort.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\Sys.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Platform\CortexM\Thread.cpp">
|
||||
<Filter>CortexM</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,22 +1,36 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmartOS", "SmartOS.vcxproj", "{6C0D43A8-8411-48F3-989E-51C5379A5563}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmartOS", "SmartOS.vcxproj", "{6C0D43A8-8411-48F3-989E-51C5379A5563}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "STM32F1", "STM32F1.vcxproj", "{E3FBB0A1-21E2-4720-A447-BB9B4631955E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Release|x64.ActiveCfg = Release|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6C0D43A8-8411-48F3-989E-51C5379A5563}.Release|x86.Build.0 = Release|Win32
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Debug|x86.Build.0 = Debug|Win32
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Release|x64.Build.0 = Release|x64
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Release|x86.ActiveCfg = Release|Win32
|
||||
{E3FBB0A1-21E2-4720-A447-BB9B4631955E}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -237,6 +237,7 @@
|
|||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
|
Loading…
Reference in New Issue