Compare commits

...

2 Commits

  1. 3
      .vscode/settings.json
  2. 54
      keilp/cc_as_stc02_ps5ws.uvprojx
  3. 28
      source/app/task_appstatus.c
  4. 2
      source/bsp/bsp_WT2605B.c
  5. 14
      source/msp/UART0.C
  6. 3
      source/msp/msp/msp_uart_x.h

3
.vscode/settings.json

@ -86,6 +86,7 @@
"setjmp.h": "c",
"algorithm": "c",
"task_w600_ptc.h": "c",
"task_adc.h": "c"
"task_adc.h": "c",
"msp_uart_x.h": "c"
}
}

54
keilp/cc_as_stc02_ps5ws.uvprojx

@ -10,6 +10,7 @@
<TargetName>STC8F2K16S2</TargetName>
<ToolsetNumber>0x0</ToolsetNumber>
<ToolsetName>MCS-51</ToolsetName>
<uAC6>8</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STC8H8K64U Series</Device>
@ -123,47 +124,6 @@
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
<Simulator>
<UseSimulator>1</UseSimulator>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>1</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
<RestoreSysVw>1</RestoreSysVw>
</Simulator>
<Target>
<UseTarget>0</UseTarget>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>0</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>0</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreSysVw>1</RestoreSysVw>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>-1</TargetSelection>
<SimDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
</SimDlls>
<TargetDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
<Driver></Driver>
</TargetDlls>
</DebugOption>
<Utilities>
<Flash1>
@ -217,12 +177,14 @@
<Mx51P>0</Mx51P>
<hadXRAM2>0</hadXRAM2>
<uocXram2>0</uocXram2>
<hadXRAM3>0</hadXRAM3>
<ModC2>0</ModC2>
<ModH2>0</ModH2>
<Mdu_R515>0</Mdu_R515>
<Mdu_F120>0</Mdu_F120>
<Psoc>0</Psoc>
<hadIROM2>0</hadIROM2>
<hadIROM3>0</hadIROM3>
<ModSmx2>0</ModSmx2>
<cBanks>0</cBanks>
<xBanks>0</xBanks>
@ -292,6 +254,16 @@
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</IROM512>
<XRA513>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</XRA513>
<IROM513>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</IROM513>
</OnChipMemories>
</Target51Misc>
<C51>

28
source/app/task_appstatus.c

@ -39,19 +39,21 @@ void Enter_PowerDown(void)
_nop_();
// MCU被唤醒后,绿灯亮起
L2_GREEN_LED_ON();
if(L2_ReadKey3() == Key_Down)
{
Lc_delay_ms(1000);
if(L2_ReadKey3() == Key_Down)
{
Lc_delay_ms(1000);
if(L2_ReadKey3() == Key_Down)
{
R.app_status = POW_ON_WAIT;
}
}
}
// L2_GREEN_LED_ON();
// 状态切换,直接开机
R.app_status = POW_ON_WAIT;
// if(L2_ReadKey3() == Key_Down)
// {
// Lc_delay_ms(1000);
// if(L2_ReadKey3() == Key_Down)
// {
// Lc_delay_ms(1000);
// if(L2_ReadKey3() == Key_Down)
// {
// R.app_status = POW_ON_WAIT;
// }
// }
// }
}
S_TASK_APPSTATUS _s_task_appstatus;

2
source/bsp/bsp_WT2605B.c

@ -198,7 +198,7 @@ void L2_WT2605B_OFF()
void L2_WT2605B_Broadcast(TS_SPEECH_AUDIO *music)
{
L0_uart3_sendArray((U8 *)music,9);
// L0_uart3_sendArrayHex((U8 *)music,9);
// L0_uart0_sendArrayHex((U8 *)music,9);
}
void L2_WT2605B_Broadcast_TPC(U8* GameID)

14
source/msp/UART0.C

@ -2,6 +2,8 @@
#include "uart0.h"
#include "uartx.h"
#define Self_Define_ISP_Download_Command 0x3D //用户自定义下载(实现不停电下载)
void L0_uart0_init(void)
{
@ -51,14 +53,24 @@ UART 中断
*************************************************/
void INTERRUPT_UART(void) D_SERVE_UART
{
u16 a,b;
// NOP(); NOP(); NOP();
if (L0_uart0_IntRI()) //如果是U0接收中断
{
L0_uart0_IntRIClear(); //清除接收中断标志
ts_uart[uNum0].r.reg = SBUF; //获取当前数据
//用户自定义下载,实现不停电下载(第一次烧录程序仍需断电,后续不再需要,下载使用STC-ISP软件)
// if (SBUF == Self_Define_ISP_Download_Command)
// {
// for(a = 1000;a > 0;a--)
// for(b = 100;b > 0;b--);
// IAP_CONTR = 0x60;
// }
L0_uartN_s2b(uNum0); //接收数据至缓冲区
}
if (L0_uart0_IntTI()) //如果是U0发送中断
if (L0_uart0_IntTI()) //如果是U0发送中断
{
L0_uart0_IntTIClear(); //清除发送中断标志
if (ts_uart[uNum0].s.max > ts_uart[uNum0].s.now)

3
source/msp/msp/msp_uart_x.h

@ -46,7 +46,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面
L0_UART0_Init
UART0_IRQHandler
L0_Usend_uc------UserDef
-----------------------------------------------------------------------------------------
---------------------------------------------------------------------------------
********************************************************************************/
@ -62,6 +62,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面
#define D_BRT_COUNT(t,clk,uartBRT) (U16)(65536- (clk / (4 * uartBRT * t)))
typedef struct _ts_uart0_send_buf_
{
vU8 num; //接收到的数目注意数据长度的范围

Loading…
Cancel
Save