Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 585f3e7e8d | |||
| f140674f11 |
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -2,8 +2,6 @@
|
||||
"files.associations": {
|
||||
"MAIN.C": "cpp",
|
||||
"CAN.C": "cpp",
|
||||
"temperature.C": "cpp",
|
||||
"IO.C": "cpp",
|
||||
"PS.C": "cpp"
|
||||
"temperature.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>0</tvExp>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\User.c</PathWithFileName>
|
||||
|
||||
53
IO.C
53
IO.C
@@ -188,26 +188,29 @@ 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 device is disabled (tristate)
|
||||
/// P1.5:
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
/// - pull-down 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 = 0xFF; // load pullup/pulldown select register
|
||||
P1_PUDEN = 0xAF; // load pullup/pulldown enable register
|
||||
P1_PUDSEL = 0xDF; // load pullup/pulldown select register
|
||||
P1_PUDEN = 0xBF; // load pullup/pulldown enable register
|
||||
|
||||
SFR_PAGE(_pp0, noSST); // switch to page 0
|
||||
P1_DIR = 0x50; // load direction register
|
||||
P1_DIR = 0x60; // load direction register
|
||||
|
||||
|
||||
/// -----------------------------------------------------------------------
|
||||
/// Configuration of Port P2:
|
||||
@@ -220,50 +223,62 @@ void IO_vInit(void)
|
||||
/// P3.2:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is high level
|
||||
/// - the pin status is low level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.3:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is high level
|
||||
/// - the pin status is low level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.4:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is high level
|
||||
/// - the pin status is low level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.5:
|
||||
/// - is used as general purpose output
|
||||
/// - open drain output is selected
|
||||
/// - the pin status is high level
|
||||
/// - the pin status is low level
|
||||
/// - pull-up device is assigned
|
||||
/// P3.6:
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
/// - 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
|
||||
|
||||
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 = 0xFF; // load pullup/pulldown select register
|
||||
P3_PUDEN = 0x7C; // load pullup/pulldown enable register
|
||||
P3_PUDSEL = 0x3F; // load pullup/pulldown select register
|
||||
P3_PUDEN = 0xFC; // load pullup/pulldown enable register
|
||||
|
||||
SFR_PAGE(_pp0, noSST); // switch to page 0
|
||||
P3_DIR = 0x3C; // load direction register
|
||||
P3_DATA = 0x3C; // load data output register
|
||||
P3_DIR = 0xFC; // load direction register
|
||||
|
||||
|
||||
/// -----------------------------------------------------------------------
|
||||
/// Configuration of Port P4:
|
||||
/// -----------------------------------------------------------------------
|
||||
/// P4.3:
|
||||
/// - is used as general input
|
||||
/// - pull-up device is assigned
|
||||
/// - is used as general purpose output
|
||||
/// - push/pull output is selected
|
||||
/// - the pin status is low level
|
||||
/// - pull-down 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)
|
||||
|
||||
10
User.c
10
User.c
@@ -345,21 +345,23 @@ void CanRXTX(void)
|
||||
|
||||
un_inf_can_kgf_output2.bit_data.KGF01 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
un_inf_can_kgf_output2.bit_data.KGF02 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
un_inf_can_kgf_output2.bit_data.KGF15 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
un_inf_can_kgf_output2.bit_data.KGF16 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// un_inf_can_kgf_output2.bit_data.KGF15 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// un_inf_can_kgf_output2.bit_data.KGF16 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
un_inf_can_kgf_output2.bit_data.KGF03 = 0x01;// ң<><D2A3><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_output1.bit_data.KGF09 = 0x01;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2
|
||||
|
||||
un_inf_can_kgf_output2.bit_data.KGF04 = 0x01;//KGF20<32>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
un_inf_can_kgf_output1.bit_data.KGF13 = 0x01;// <20><>ѹ<EFBFBD><D1B9><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]);
|
||||
canSendTo(DF_SwTxKGF1,(ubyte *)&un_inf_can_kgf_output1.arr[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -503,7 +503,7 @@ BOOL GetTemp(void)
|
||||
|
||||
for (i = 0; i < RomNum; i++) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>оƬ
|
||||
{
|
||||
iTemp[i] = 0;
|
||||
// iTemp[i] = 0; 20250814ע<34><D7A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CRCʧ<43><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>
|
||||
/*<2A><><EFBFBD><EFBFBD>*/
|
||||
ReadTempWaiting(&iTemp[i], i);
|
||||
|
||||
|
||||
7
user.H
7
user.H
@@ -15,13 +15,12 @@
|
||||
#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_5 //<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // <20><EFBFBD>Ϊ<EFBFBD>ɰ汾Ӳ<E6B1BE><D3B2>
|
||||
#define WAKE_UP_PIN P1_4 //<2F><>ѹ<EFBFBD><D1B9><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 STOP_PIN P3_6 //<2F><>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#define BATTERY_PIN P1_4 //<2F><><EFBFBD>ؿ<EFBFBD><D8BF>ƽ<EFBFBD>
|
||||
#define STOP_PIN P1_2 //<2F><>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
#define BATTERY_PIN P3_6 //<2F><><EFBFBD>ؿ<EFBFBD><D8BF>ƽ<EFBFBD>
|
||||
|
||||
|
||||
#define ON 0 //<2F><><EFBFBD><EFBFBD>
|
||||
|
||||
Reference in New Issue
Block a user