植树车适配旧版本采集模块

This commit is contained in:
2025-08-05 07:53:48 +08:00
parent ad771ee812
commit b5f2f3bc5f
6 changed files with 106 additions and 54 deletions

View File

@@ -2,6 +2,8 @@
"files.associations": { "files.associations": {
"MAIN.C": "cpp", "MAIN.C": "cpp",
"CAN.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

View File

@@ -320,7 +320,7 @@
<GroupNumber>2</GroupNumber> <GroupNumber>2</GroupNumber>
<FileNumber>9</FileNumber> <FileNumber>9</FileNumber>
<FileType>1</FileType> <FileType>1</FileType>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2> <bDave2>0</bDave2>
<PathWithFileName>.\User.c</PathWithFileName> <PathWithFileName>.\User.c</PathWithFileName>

53
IO.C
View File

@@ -188,29 +188,26 @@ void IO_vInit(void)
/// - is used as general input /// - is used as general input
/// - pull-up device is assigned /// - pull-up device is assigned
/// P1.4: /// P1.4:
/// - is used as general input
/// - pull-up device is assigned
/// P1.5:
/// - is used as general purpose output /// - is used as general purpose output
/// - push/pull output is selected /// - push/pull output is selected
/// - the pin status is low level /// - 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: /// P1.6:
/// - is used as general purpose output /// - is used as general purpose output
/// - push/pull output is selected /// - push/pull output is selected
/// - the pin status is low level /// - the pin status is low level
/// - pull device is disabled (tristate) /// - 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 SFR_PAGE(_pp1, noSST); // switch to page 1
P1_PUDSEL = 0xDF; // load pullup/pulldown select register P1_PUDSEL = 0xFF; // load pullup/pulldown select register
P1_PUDEN = 0xBF; // load pullup/pulldown enable register P1_PUDEN = 0xAF; // load pullup/pulldown enable register
SFR_PAGE(_pp0, noSST); // switch to page 0 SFR_PAGE(_pp0, noSST); // switch to page 0
P1_DIR = 0x60; // load direction register P1_DIR = 0x50; // load direction register
/// ----------------------------------------------------------------------- /// -----------------------------------------------------------------------
/// Configuration of Port P2: /// Configuration of Port P2:
@@ -223,62 +220,50 @@ void IO_vInit(void)
/// P3.2: /// P3.2:
/// - is used as general purpose output /// - is used as general purpose output
/// - open drain output is selected /// - open drain output is selected
/// - the pin status is low level /// - the pin status is high level
/// - pull-up device is assigned /// - pull-up device is assigned
/// P3.3: /// P3.3:
/// - is used as general purpose output /// - is used as general purpose output
/// - open drain output is selected /// - open drain output is selected
/// - the pin status is low level /// - the pin status is high level
/// - pull-up device is assigned /// - pull-up device is assigned
/// P3.4: /// P3.4:
/// - is used as general purpose output /// - is used as general purpose output
/// - open drain output is selected /// - open drain output is selected
/// - the pin status is low level /// - the pin status is high level
/// - pull-up device is assigned /// - pull-up device is assigned
/// P3.5: /// P3.5:
/// - is used as general purpose output /// - is used as general purpose output
/// - open drain output is selected /// - open drain output is selected
/// - the pin status is low level /// - the pin status is high level
/// - pull-up device is assigned /// - pull-up device is assigned
/// P3.6: /// P3.6:
/// - is used as general purpose output /// - is used as general input
/// - push/pull output is selected /// - pull-up device is assigned
/// - 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
SFR_PAGE(_pp3, noSST); // switch to page 3 SFR_PAGE(_pp3, noSST); // switch to page 3
P3_OD = 0x3C; // load open-drain register P3_OD = 0x3C; // load open-drain register
SFR_PAGE(_pp1, noSST); // switch to page 1 SFR_PAGE(_pp1, noSST); // switch to page 1
P3_PUDSEL = 0x3F; // load pullup/pulldown select register P3_PUDSEL = 0xFF; // load pullup/pulldown select register
P3_PUDEN = 0xFC; // load pullup/pulldown enable register P3_PUDEN = 0x7C; // load pullup/pulldown enable register
SFR_PAGE(_pp0, noSST); // switch to page 0 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: /// Configuration of Port P4:
/// ----------------------------------------------------------------------- /// -----------------------------------------------------------------------
/// P4.3: /// P4.3:
/// - is used as general purpose output /// - is used as general input
/// - push/pull output is selected /// - pull-up device is assigned
/// - the pin status is low level
/// - pull-down device is assigned
SFR_PAGE(_pp1, noSST); // switch to page 1 SFR_PAGE(_pp1, noSST); // switch to page 1
P4_PUDSEL = 0x00; // load pullup/pulldown select register
P4_PUDEN = 0x08; // load pullup/pulldown enable register P4_PUDEN = 0x08; // load pullup/pulldown enable register
SFR_PAGE(_pp0, noSST); // switch to page 0 SFR_PAGE(_pp0, noSST); // switch to page 0
P4_DIR = 0x08; // load direction register
// USER CODE BEGIN (IO_Init,3) // USER CODE BEGIN (IO_Init,3)

5
User.c
View File

@@ -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.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.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> 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_SwTxKGF2,(ubyte *)&un_inf_can_kgf_output2.arr[0]);
// canSendTo(DF_SwTxKGF1,(ubyte *)&un_inf_can_kgf_output1.arr[0]); // canSendTo(DF_SwTxKGF1,(ubyte *)&un_inf_can_kgf_output1.arr[0]);
} }
} }
else else
{ {

7
user.H
View File

@@ -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 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 KGF_PIN P0_0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define CAN_PIN P1_6 //<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> #define ON 0 //<2F><><EFBFBD><EFBFBD>