植树车适配旧版本采集模块
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -2,6 +2,8 @@
|
||||
"files.associations": {
|
||||
"MAIN.C": "cpp",
|
||||
"CAN.C": "cpp",
|
||||
"temperature.C": "cpp"
|
||||
"temperature.C": "cpp",
|
||||
"IO.C": "cpp",
|
||||
"PS.C": "cpp"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -320,7 +320,7 @@
|
||||
<GroupNumber>2</GroupNumber>
|
||||
<FileNumber>9</FileNumber>
|
||||
<FileType>1</FileType>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\User.c</PathWithFileName>
|
||||
|
||||
53
IO.C
53
IO.C
@@ -188,29 +188,26 @@ void IO_vInit(void)
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
/// P1.4:
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
/// P1.5:
|
||||
/// - is used as general purpose output
|
||||
/// - push/pull output is selected
|
||||
/// - the pin status is low level
|
||||
/// - pull-down device is assigned
|
||||
/// - pull device is disabled (tristate)
|
||||
/// P1.5:
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
/// P1.6:
|
||||
/// - is used as general purpose output
|
||||
/// - push/pull output is selected
|
||||
/// - the pin status is low level
|
||||
/// - pull device is disabled (tristate)
|
||||
|
||||
SFR_PAGE(_pp3, noSST); // switch to page 3
|
||||
P1_OD = 0x00; // load open-drain register
|
||||
|
||||
SFR_PAGE(_pp1, noSST); // switch to page 1
|
||||
P1_PUDSEL = 0xDF; // load pullup/pulldown select register
|
||||
P1_PUDEN = 0xBF; // load pullup/pulldown enable register
|
||||
P1_PUDSEL = 0xFF; // load pullup/pulldown select register
|
||||
P1_PUDEN = 0xAF; // load pullup/pulldown enable register
|
||||
|
||||
SFR_PAGE(_pp0, noSST); // switch to page 0
|
||||
P1_DIR = 0x60; // load direction register
|
||||
|
||||
P1_DIR = 0x50; // load direction register
|
||||
|
||||
/// -----------------------------------------------------------------------
|
||||
/// Configuration of Port P2:
|
||||
@@ -223,62 +220,50 @@ void IO_vInit(void)
|
||||
/// P3.2:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is low level
|
||||
/// - the pin status is high level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.3:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is low level
|
||||
/// - the pin status is high level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.4:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is low level
|
||||
/// - the pin status is high level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.5:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is low level
|
||||
/// - the pin status is high level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.6:
|
||||
/// - is used as general purpose output
|
||||
/// - push/pull output is selected
|
||||
/// - the pin status is low level
|
||||
/// - pull-down device is assigned
|
||||
/// P3.7:
|
||||
/// - is used as general purpose output
|
||||
/// - push/pull output is selected
|
||||
/// - the pin status is low level
|
||||
/// - pull-down device is assigned
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
|
||||
SFR_PAGE(_pp3, noSST); // switch to page 3
|
||||
P3_OD = 0x3C; // load open-drain register
|
||||
|
||||
SFR_PAGE(_pp1, noSST); // switch to page 1
|
||||
P3_PUDSEL = 0x3F; // load pullup/pulldown select register
|
||||
P3_PUDEN = 0xFC; // load pullup/pulldown enable register
|
||||
P3_PUDSEL = 0xFF; // load pullup/pulldown select register
|
||||
P3_PUDEN = 0x7C; // load pullup/pulldown enable register
|
||||
|
||||
SFR_PAGE(_pp0, noSST); // switch to page 0
|
||||
P3_DIR = 0xFC; // load direction register
|
||||
P3_DIR = 0x3C; // load direction register
|
||||
P3_DATA = 0x3C; // load data output register
|
||||
|
||||
|
||||
/// -----------------------------------------------------------------------
|
||||
/// Configuration of Port P4:
|
||||
/// -----------------------------------------------------------------------
|
||||
/// P4.3:
|
||||
/// - is used as general purpose output
|
||||
/// - push/pull output is selected
|
||||
/// - the pin status is low level
|
||||
/// - pull-down device is assigned
|
||||
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
|
||||
SFR_PAGE(_pp1, noSST); // switch to page 1
|
||||
P4_PUDSEL = 0x00; // load pullup/pulldown select register
|
||||
P4_PUDEN = 0x08; // load pullup/pulldown enable register
|
||||
|
||||
SFR_PAGE(_pp0, noSST); // switch to page 0
|
||||
P4_DIR = 0x08; // load direction register
|
||||
|
||||
|
||||
|
||||
// USER CODE BEGIN (IO_Init,3)
|
||||
|
||||
5
User.c
5
User.c
@@ -352,14 +352,15 @@ void CanRXTX(void)
|
||||
un_inf_can_kgf_output2.bit_data.KGF05 = 0x01;// <20><><EFBFBD>罻<EFBFBD><E7BDBB><EFBFBD><EFBFBD>
|
||||
un_inf_can_kgf_output2.bit_data.KGF06 = 0x01;// <20><><EFBFBD>罻<EFBFBD><E7BDBB><EFBFBD><EFBFBD>
|
||||
|
||||
un_inf_can_kgf_output2.bit_data.KGF04 = 0x01;//KGF20<32>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
un_inf_can_kgf_output2.bit_data.KGF04 = 0x01;//KGF20<32>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
if(1 == flg_KGF)//<2F>ȴ<EFBFBD>KGF<47><46><EFBFBD>Ѻ<EFBFBD><D1BA>ٷ<EFBFBD><D9B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
canSendTo(DF_SwTxKGF2,(ubyte *)&un_inf_can_kgf_output2.arr[0]);
|
||||
// canSendTo(DF_SwTxKGF1,(ubyte *)&un_inf_can_kgf_output1.arr[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
7
user.H
7
user.H
@@ -15,12 +15,13 @@
|
||||
#define dfPwmH 10 //PWM<57>ĸߵ<C4B8>ƽʱ<C6BD>䣬10<31><30>10ms<6D><73><EFBFBD>ң<EFBFBD><D2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>20181227
|
||||
|
||||
|
||||
#define WAKE_UP_PIN P1_4 //<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define WAKE_UP_PIN P1_5 //<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // <20><EFBFBD>Ϊ<EFBFBD>ɰ汾Ӳ<E6B1BE><D3B2>
|
||||
#define KGF_PIN P0_0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define CAN_PIN P1_6 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define STOP_PIN P1_2 //<2F><>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define STOP_PIN P3_6 //<2F><>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#define BATTERY_PIN P1_4 //<2F><><EFBFBD>ؿ<EFBFBD><D8BF>ƽ<EFBFBD>
|
||||
|
||||
#define BATTERY_PIN P3_6 //<2F><><EFBFBD>ؿ<EFBFBD><D8BF>ƽ<EFBFBD>
|
||||
|
||||
|
||||
#define ON 0 //<2F><><EFBFBD><EFBFBD>
|
||||
|
||||
Reference in New Issue
Block a user