This commit is contained in:
Stone 2016-06-14 08:43:59 +00:00
parent 0885aa7e36
commit d6ea4d7b9f
3 changed files with 11 additions and 10 deletions

View File

@ -26,7 +26,7 @@ public:
void Send(byte* buf, uint len);
private:
byte _index;
CAN _index;
int Remap;
void* _Tx;

View File

@ -17,20 +17,20 @@ void Can::OnOpen()
RCC_APB1PeriphClockCmd(RCC_APB1Periph_CAN1, ENABLE);
/*IO设置*/
#ifdef STM32F1
if(index == Can1)
if(_index == Can1)
{
if(remap == 1)
if(Remap == 1)
GPIO_PinRemapConfig(GPIO_Remap1_CAN1, ENABLE);
else if(remap == 2)
else if(Remap == 2)
GPIO_PinRemapConfig(GPIO_Remap2_CAN1, ENABLE);
}
else if(index == Can2)
else if(_index == Can2)
GPIO_PinRemapConfig(GPIO_Remap_CAN2, ENABLE);
const Pin* p = g_CAN_Pins_Map;
if(remap == 2)
if(Remap == 2)
p = g_CAN_Pins_Map2;
else if(remap == 3)
else if(Remap == 3)
p = g_CAN_Pins_Map3;
AlternatePort tx(p[0]);

View File

@ -1,4 +1,5 @@
#include "DAC.h"
#include "Port.h"
#include "DAC.h"
#include "Platform\stm32.h"
@ -50,9 +51,9 @@ bool DAConverter::OnWrite(ushort value) // 处理对齐问题
{
//if (Opened)return false;
if (Channel == DAC_Channel_1)
DAC_SetChannel1Data(Align, dat);
DAC_SetChannel1Data(Align, value);
else
DAC_SetChannel2Data(Align, dat);
DAC_SetChannel2Data(Align, value);
DAC_SoftwareTriggerCmd(Channel, ENABLE);
return true;