增加自动
This commit is contained in:
parent
3b306b9101
commit
7c19ef8330
File diff suppressed because one or more lines are too long
@ -1,26 +1,17 @@
|
|||||||
QualityReport
|
QualityReport
|
||||||
2023年12月13日 16:30:17
|
2024年1月9日 16:52:09
|
||||||
|
|
||||||
------ Start build(M12, DefaultBuild) ------
|
------ Start build(M12, DefaultBuild) ------
|
||||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe user\MotorCtrl.c -cpu=S2 -o DefaultBuild\MotorCtrl.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
|
||||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe r_cg_timer_user.c -cpu=S2 -o DefaultBuild\r_cg_timer_user.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
|
||||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe r_cg_serial_user.c -cpu=S2 -o DefaultBuild\r_cg_serial_user.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
|
||||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe user\appTask.c -cpu=S2 -o DefaultBuild\appTask.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe user\appTask.c -cpu=S2 -o DefaultBuild\appTask.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
||||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe r_main.c -cpu=S2 -o DefaultBuild\r_main.obj "-dev=E:\Program Files (x86)\renesas\CS+\CC\Device\RL78\Devicefile\DR5F10268.DVF" -g -g_line -I . -I user -far_rom -c -msg_lang=english
|
|
||||||
user\MotorCtrl.c(181):W0520177:Variable "wait2" was declared but never referenced
|
|
||||||
user\MotorCtrl.c(181):W0520177:Variable "wait3" was declared but never referenced
|
|
||||||
user\MotorCtrl.c(328):W0520177:Variable "i" was declared but never referenced
|
|
||||||
user\MotorCtrl.c(399):W0520177:Variable "OC_Count2" was declared but never referenced
|
|
||||||
user\MotorCtrl.c(399):W0520177:Variable "OC_Count3" was declared but never referenced
|
|
||||||
user\appTask.c(80):W0520177:Variable "keep_count" was declared but never referenced
|
user\appTask.c(80):W0520177:Variable "keep_count" was declared but never referenced
|
||||||
user\appTask.c(81):W0520177:Variable "i" was declared but never referenced
|
user\appTask.c(81):W0520177:Variable "i" was declared but never referenced
|
||||||
user\appTask.c(133):W0520177:Variable "ledno" was declared but never referenced
|
user\appTask.c(149):W0520177:Variable "ledno" was declared but never referenced
|
||||||
user\appTask.c(133):W0520177:Variable "last" was declared but never referenced
|
user\appTask.c(149):W0520177:Variable "last" was declared but never referenced
|
||||||
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\M12.clnk
|
E:\Program Files (x86)\renesas\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\M12.clnk
|
||||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||||
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||||
Renesas Optimizing Linker Completed
|
Renesas Optimizing Linker Completed
|
||||||
------ Build ended(Error:0, Warning:11)(M12, DefaultBuild) ------
|
------ Build ended(Error:0, Warning:6)(M12, DefaultBuild) ------
|
||||||
|
|
||||||
--- CommandFile 1 ---
|
--- CommandFile 1 ---
|
||||||
DefaultBuild\M12.clnk :
|
DefaultBuild\M12.clnk :
|
||||||
@ -72,8 +63,8 @@ DefaultBuild\M12.clnk :
|
|||||||
|
|
||||||
|
|
||||||
--- SHA1 hash value of output files ---
|
--- SHA1 hash value of output files ---
|
||||||
F:\FCB_project\temp\M12\k67\DefaultBuild\M12.abs: 0b3b2c8ca3a390d51c0b9a289b56d7ce91acdf0e
|
F:\FCB_project\temp\M12\k67\DefaultBuild\M12.abs: bb5ed562599dd7d737b526f6bfe8f5bf91273db8
|
||||||
F:\FCB_project\temp\M12\k67\DefaultBuild\M12.mot: 0a2bd8b1ea60b4d3e43658e5b94ad7066f83624c
|
F:\FCB_project\temp\M12\k67\DefaultBuild\M12.mot: a9662f7f1b8e4c50f3dde3a91e5ed12b45438b9d
|
||||||
|
|
||||||
|
|
||||||
--- System Information ---
|
--- System Information ---
|
||||||
@ -101,13 +92,13 @@ F:\FCB_project\temp\M12\k67\DefaultBuild\M12.mot: 0a2bd8b1ea60b4d3e43658e5b94ad7
|
|||||||
E:\Program Files (x86)\renesas\CS+\CC
|
E:\Program Files (x86)\renesas\CS+\CC
|
||||||
*Memory Usage
|
*Memory Usage
|
||||||
*Private Working Set
|
*Private Working Set
|
||||||
317 MB
|
269 MB
|
||||||
*Number of GDI Objects
|
*Number of GDI Objects
|
||||||
2105
|
1973
|
||||||
*Number of USER Objects
|
*Number of USER Objects
|
||||||
1055
|
1092
|
||||||
*Opened Files
|
*Opened Files
|
||||||
3 editors, 3 files, 20 KB
|
3 editors, 3 files, 21 KB
|
||||||
|
|
||||||
--- Build Tool Plug-in Information ---
|
--- Build Tool Plug-in Information ---
|
||||||
RH850 Build tool CC-RH Plug-in
|
RH850 Build tool CC-RH Plug-in
|
||||||
|
@ -125,6 +125,10 @@ void MotorValueInit(void)
|
|||||||
{
|
{
|
||||||
MotorHallLoc[i] = 0x8000;
|
MotorHallLoc[i] = 0x8000;
|
||||||
MotorErr[i] = 0;
|
MotorErr[i] = 0;
|
||||||
|
|
||||||
|
MotorHardStop1[i] = 0;
|
||||||
|
MotorHardStop2[i] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
//ReadMotorMemory();
|
//ReadMotorMemory();
|
||||||
}
|
}
|
||||||
@ -138,6 +142,16 @@ void setMotorState(uint8_t motorid,uint8_t act)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint16_t MotorTarget[6] = {0};
|
uint16_t MotorTarget[6] = {0};
|
||||||
|
|
||||||
|
void setMotorAutoXQ(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
MotorTarget[0] = MotorHardStop1[0] - 2500;
|
||||||
|
}
|
||||||
|
void setMotorAutoXH(void)
|
||||||
|
{
|
||||||
|
MotorTarget[0] = MotorHardStop1[0] - 10;
|
||||||
|
}
|
||||||
void setMotorTarget(uint8_t motorid,uint16_t target)
|
void setMotorTarget(uint8_t motorid,uint16_t target)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -334,11 +348,11 @@ void MotorCtrl(void)//10ms
|
|||||||
OC1flag = 0;
|
OC1flag = 0;
|
||||||
if (MotorState[0] == ACT_XQ)
|
if (MotorState[0] == ACT_XQ)
|
||||||
{
|
{
|
||||||
MotorHardStop1[0] = MotorHallLoc[0];
|
MotorHardStop1[0] = MotorHallLoc[0];//后停止点
|
||||||
}
|
}
|
||||||
else if (MotorState[0] == ACT_XH)
|
else if (MotorState[0] == ACT_XH)
|
||||||
{
|
{
|
||||||
MotorHardStop2[0] = MotorHallLoc[0];
|
MotorHardStop2[0] = MotorHallLoc[0];//前停止点
|
||||||
}
|
}
|
||||||
MotorState[MOTOR1] = ACT_NOACT;
|
MotorState[MOTOR1] = ACT_NOACT;
|
||||||
}
|
}
|
||||||
@ -346,9 +360,9 @@ void MotorCtrl(void)//10ms
|
|||||||
|
|
||||||
|
|
||||||
MotorStateReal[0] = MotorState[0];
|
MotorStateReal[0] = MotorState[0];
|
||||||
if (MotorState[0] == ACT_NOACT && MotorHardStop1[0] != 0 && MotorHardStop2[0] != 0 )
|
if (MotorState[0] == ACT_NOACT && MotorHardStop1[0] != 0 )//&& MotorHardStop2[0] != 0
|
||||||
{
|
{
|
||||||
if (MotorTarget[0]!=0 && MotorHardStop1[0] > MotorTarget[0] && MotorTarget[0] > MotorHardStop2[0])
|
if (MotorTarget[0]!=0 && MotorHardStop1[0] > MotorTarget[0] )//&& MotorTarget[0] > MotorHardStop2[0]
|
||||||
{
|
{
|
||||||
if (MotorTarget[0] > MotorHallLoc[0]+10)
|
if (MotorTarget[0] > MotorHallLoc[0]+10)
|
||||||
{
|
{
|
||||||
@ -375,9 +389,7 @@ void MotorCtrl(void)//10ms
|
|||||||
{
|
{
|
||||||
MotorStateReal[0] = ACT_NOACT;
|
MotorStateReal[0] = ACT_NOACT;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MotorTarget[0] = 0;
|
MotorTarget[0] = 0;
|
||||||
|
@ -23,7 +23,7 @@ void StopAutoCal(void);
|
|||||||
|
|
||||||
|
|
||||||
void setMotorState(uint8_t motorid,uint8_t act);
|
void setMotorState(uint8_t motorid,uint8_t act);
|
||||||
|
void setMotorAutoXQ(void);
|
||||||
|
void setMotorAutoXH(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -71,56 +71,72 @@ void keyLogicRelease(uint8_t keyno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#define KEY_DELAY_TIME 10
|
#define KEY_DELAY_TIME_30ms 10
|
||||||
|
#define KEY_DELAY_TIME_200ms 60
|
||||||
void keyScan(void)//5ms
|
void keyScan(void)//5ms
|
||||||
{
|
{
|
||||||
static uint16_t keydelay[9]={0,0,0,0,0,0,0,0,0};
|
static uint16_t keydelay[9]={0,0,0,0,0,0,0,0,0};
|
||||||
static uint8_t keyflag[9]={0,0,0,0,0,0,0,0,0};
|
static uint8_t keyflag[9]={0,0,0,0,0,0,0,0,0};
|
||||||
static uint8_t keep_count[9]={0,0,0,0,0,0,0,0,0};
|
static uint8_t keep_count[9]={0,0,0,0,0,0,0,0,0};
|
||||||
uint8_t keyval,i;
|
uint8_t keyval,i;
|
||||||
|
//向后
|
||||||
keyval = GetIOState(SIGID_KEY1);
|
keyval = GetIOState(SIGID_KEY1);
|
||||||
if (keyval == 1 && keyflag[KEY1] == 0)
|
if (keyval == 1 )//&& keyflag[KEY1] == 0
|
||||||
{
|
{
|
||||||
keydelay[KEY1]++;
|
keydelay[KEY1]++;
|
||||||
if (keydelay[KEY1] > KEY_DELAY_TIME)//30ms
|
if (keydelay[KEY1] > KEY_DELAY_TIME_30ms)//30ms
|
||||||
{
|
{
|
||||||
keyflag[KEY1] = 1;
|
keyflag[KEY1] = 1;
|
||||||
keydelay[KEY1] = KEY_DELAY_TIME;
|
|
||||||
keyLogic(KEY1);
|
|
||||||
}
|
}
|
||||||
|
if (keydelay[KEY1] > KEY_DELAY_TIME_200ms)//200ms
|
||||||
|
{
|
||||||
|
keyflag[KEY1] = 1;
|
||||||
|
keydelay[KEY1] = KEY_DELAY_TIME_200ms;
|
||||||
|
setMotorState(0,ACT_XQ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (keyval == 0)
|
else if (keyval == 0)
|
||||||
{
|
{
|
||||||
if (keyflag[KEY1] == 1)
|
if (keyflag[KEY1] == 1 && keydelay[KEY1] < KEY_DELAY_TIME_200ms)
|
||||||
{
|
{
|
||||||
keyLogicRelease(KEY1);
|
//自动
|
||||||
|
setMotorAutoXH();
|
||||||
|
}
|
||||||
|
if (keyflag[KEY1] == 1 && keydelay[KEY1] >= KEY_DELAY_TIME_200ms)
|
||||||
|
{
|
||||||
|
setMotorState(0,ACT_NOACT);
|
||||||
}
|
}
|
||||||
|
|
||||||
keyflag[KEY1] = 0;
|
keyflag[KEY1] = 0;
|
||||||
keydelay[KEY1] = 0;
|
keydelay[KEY1] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//向前
|
||||||
keyval = GetIOState(SIGID_KEY2);
|
keyval = GetIOState(SIGID_KEY2);
|
||||||
if (keyval == 1 && keyflag[KEY2] == 0)
|
if (keyval == 1 )//&& keyflag[KEY2] == 0
|
||||||
{
|
{
|
||||||
keydelay[KEY2]++;
|
keydelay[KEY2]++;
|
||||||
if (keydelay[KEY2] > KEY_DELAY_TIME)//30ms
|
if (keydelay[KEY2] > KEY_DELAY_TIME_30ms)//30ms
|
||||||
{
|
{
|
||||||
keyflag[KEY2] = 1;
|
keyflag[KEY2] = 1;
|
||||||
keydelay[KEY2] = KEY_DELAY_TIME;
|
}
|
||||||
keyLogic(KEY2);
|
if (keydelay[KEY2] > KEY_DELAY_TIME_200ms)//200ms
|
||||||
|
{
|
||||||
|
keyflag[KEY2] = 1;
|
||||||
|
keydelay[KEY2] = KEY_DELAY_TIME_200ms;
|
||||||
|
setMotorState(0,ACT_XH);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (keyval == 0)
|
else if (keyval == 0)
|
||||||
{
|
{
|
||||||
if (keyflag[KEY2] == 1)
|
if (keyflag[KEY2] == 1 && keydelay[KEY2] < KEY_DELAY_TIME_200ms)
|
||||||
{
|
{
|
||||||
keyLogicRelease(KEY2);
|
//自动
|
||||||
|
setMotorAutoXQ();
|
||||||
|
}
|
||||||
|
if (keyflag[KEY2] == 1 && keydelay[KEY2] >= KEY_DELAY_TIME_200ms)
|
||||||
|
{
|
||||||
|
setMotorState(0,ACT_NOACT);
|
||||||
}
|
}
|
||||||
keyflag[KEY2] = 0;
|
keyflag[KEY2] = 0;
|
||||||
keydelay[KEY2] = 0;
|
keydelay[KEY2] = 0;
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#define ACT_XH 2
|
#define ACT_XH 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t GetIOState(uint8_t sigid);
|
uint8_t GetIOState(uint8_t sigid);
|
||||||
void MOTOR1Ctrl(uint8_t act);
|
void MOTOR1Ctrl(uint8_t act);
|
||||||
uint16_t getAdval(uint8_t ch);
|
uint16_t getAdval(uint8_t ch);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user