?? config.bak
字號:
/****************************************************************************************
//莫先明
//2007-11-09
****************************************************************************************/
/****************************************************************************************
頭文件
****************************************************************************************/
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
#define ulint unsigned long
/****************************************************************************************
/****************************************************************************************
上位機軟件的定義,有"TW"和"測試"
/***************************************************************************************/
#define USEDTW 1 //當屏蔽這行使用測試程序
//#define USEDOLDTW 1 //使用老版的TWP軟件
/****************************************************************************************
控制板的定義
/***************************************************************************************/
#define TPMCU 1
//#define STATIC 1 //當為靜態掃描時定義只支持1/8掃描方式
//#define AUTOSTOP 1 //TPMCU還沒有添加關機功能
/****************************************************************************************
系統防掉電存儲器的定義
/***************************************************************************************/
//#define W29C040 1 //系統存儲器為W29C040
//#define W29C020 1 //系統存儲器為W29C020
/****************************************************************************************
串口通訊中地址的定義
/***************************************************************************************/
#define OSC_FREQ 22118400L//40000000L//
#define BPS 19200 //定義串口通訊波特率有效值為(4800、9600、19200、57600)這些使用的是22.1184M頻率
//當定義為40M頻率時不管BPS定義為何值都將自動使用19200速度
#define ADDR 0 //設備地址=0-255
#define MAXCOMBUF 120 //傳口接收的最大顯示幕數,這個大小應根據RAM容量而定,理論上是越大越好
//注意當有防掉電存儲器時該行定義是無效的
/****************************************************************************************
顯示屏定義
/***************************************************************************************/
#define MAXPLAN 20 //工作幕數緩沖最小為1
#define LIEDIP 160 //顯示屏有多少列,可顯示的漢字數為該值除以16
/****************************************************************************************
請注意到此有效的設置完畢
下面的內容請不要更改!!!!!!!!!!!!!!
****************************************************************************************/
//系統自動熱啟動超時復位
/****************************************************************************************/
#define REBOOT system_run=600 //系統運行監視
//運行異常將自動熱起動
/****************************************************************************************
顯示屏定義
****************************************************************************************/
#ifndef TPMCU
#undef STATIC
#endif
//#define ALONE 1 //當屏蔽該行時為32行掃描否則為16行掃描,屏蔽方式為在該行前加"//"
#ifdef STATIC
#undef ALONE
#endif
#ifdef ALONE
#define HANGDIP 16 //行
#else
#ifdef STATIC
#define HANGDIP 16 //行
#else
#define HANGDIP 32 //行
#endif
#endif
/****************************************************************************************
顯示方式定義
****************************************************************************************/
#define PRINT_L 1 //左移動輸出方式
#define PRINT_R_LIE 1 //左移動輸出方式
#define PRINT_L_LIE 1 //左移動輸出方式
#define PRINT_UP 1 //上移動輸出方式
#define PRINT_UP_HANG 1 //上移動輸出方式
#define PRINT_DOWN 1 //上移動輸出方式
#define PRINT_DOWN_HANG 1 //上移動輸出方式
#define PRINT_R 1 //左移動輸出方式
/****************************************************************************************/
#define RED 0
#define GREEN 1
#define YELLOW 2
#define DEFINECOLOR RED
typedef struct windows
{
uchar plan_flash; //FLASH中的總計幕數
uchar plan_point; //指向FLASH中幕數的數值
uchar plan_size; //當前緩沖的幕數
uchar plan; //當前工作幕計數器
uchar hang; //行位置指示
uchar lie; //列
uchar bit_cont; //位
uchar movintype[MAXPLAN];
uchar movouttype[MAXPLAN];
uchar movsize[MAXPLAN];
uchar showtime[MAXPLAN];
/*下面是2個交換工作的緩沖區*/
uchar PRINT1_R[HANGDIP][LIEDIP/8];
uchar PRINT2_R[HANGDIP][LIEDIP/8];
/*下面是字緩沖區*/
uchar printbuf[MAXPLAN][HANGDIP*(LIEDIP/8)];
};
#define SWAP_PRINT1 0
#define SWAP_PRINT2 1
typedef struct PRINTLED
{
uchar SWAP; //交換標志
uchar CHANG; //允許外部交換的標志
uchar COLOR;
uchar xdata *PRINTBUF1_R1;
#ifndef ALONE
uchar xdata *PRINTBUF1_R2;
#endif
uchar xdata *PRINTBUF2_R1;
#ifndef ALONE
uchar xdata *PRINTBUF2_R2;
#endif
};
//串口通訊的數據結構
typedef struct usart
{
/*
#ifndef USEDTW
//這里是測試程序的頭字共5個字節
uchar address;
uchar head1; //字頭AA
uchar head2; //字頭55
uchar config; //控制字
uchar plan; //幕數
#else
//這里是TW程序的頭字共2個字節
uchar address;
uchar plan; //幕數
#endif
*/
uchar dip[(LIEDIP/8)*HANGDIP]; //點陣數據
uchar movintype;
uchar movouttype;
uchar movsize;
uchar showtime;
#ifndef USEDTW
uchar over; //結束是一個0x00
#else
uchar addtype; //追加方式
#endif
};
typedef struct print_asm
{
uchar xdata *ptr1_s;
#ifndef ALONE
uchar xdata *ptr2_s; //上半屏
#endif
};
#ifndef TPMCU
sbit CLK = P1^4;
sbit DATA4094 = P1^5;
sbit SING_RED = P1^6;
sbit SING_GREEN = P1^7;
sbit LAT = P1^3;
sbit OE = P3^3;
#ifdef AUTOSTOP
sbit EXT0 = P3^2;
#endif
#else
#undef ATUOSTOP
sbit LAT = P3^2;
sbit CS_RAM = P3^4;
sbit HIB = P1^4;
sbit CLK = P1^7;
#endif
#if(OSC_FREQ == 40000000L)
#undef BPS
#define BPS 19200
#endif
#define BAUD_4800 256-(OSC_FREQ/192L)/4800L
#define BAUD_9600 256-(OSC_FREQ/192L)/9600L
#define BAUD_19200 256-(OSC_FREQ/192L)/19200L
#define BAUD_57600 256-(OSC_FREQ/192L)/57600L
#ifdef W29C040
#define DATAINFLASH 1 //定義系統使用FLASH存儲器
#else
#ifdef W29C020
#define DATAINFLASH 1 //定義系統使用FLASH存儲器
#else
#undef DATAINFLASH //無FLASH存儲器
#endif
#endif
#ifdef DATAINFLASH
sbit FLASH_A16 = P1^0;
sbit FLASH_A17 = P1^1;
sbit FLASH_A18 = P1^2;
sbit FLASH_A15 = P2^7;
sbit CS_ROM = P3^5;
#ifdef W29C040
#define PAGESIZE 256 //flash頁面大小
#define WRITEEND 0 //寫結束
#endif
#ifdef W29C020
#define PAGESIZE 128 //flash頁面大小
#define WRITEEND 128 //寫結束
#endif
typedef struct flash
{
uchar xdata *pts1;
uchar xdata *pts2;
uchar xdata *ptd;
uchar loop;
uint size;
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -