?? msg.c
字號:
#include <stdio.h>
#include <absacc.h>
#include <stdarg.h>
#include <./Atmel/at89x52.h>
#include "source.h"
/****HBS=half bottom screen ****/
#define HBS_MSG_DEEP 10 //設置為screen_hbs函數(shù)定義消息的深度
unsigned char hbs_msg[HBS_MSG_DEEP];
unsigned char hbs_tail=0;
unsigned char hbs_head=0;
void send_hbs_msg(unsigned char msg){//向screen_hbs函數(shù)的消息隊列發(fā)送消息
hbs_msg[hbs_head]=msg;
hbs_head++;
hbs_head %=HBS_MSG_DEEP;
}
unsigned char read_hbs_msg(void){//從screen_hbs函數(shù)的消息隊列中讀取消息
unsigned char ret_msg;
if(hbs_tail!=hbs_head){//消息隊列不為空,返回消息
ret_msg=hbs_msg[hbs_tail];
hbs_tail++;
hbs_tail %=HBS_MSG_DEEP;
return ret_msg;
}
else{
return 0;//消息隊列為空,返回0
}
}
void change_hbs_fsm(unsigned char fsm){//改變screen_hbs函數(shù)里的狀態(tài)機
screen.hbs_fsm=fsm;
}
/******以下消息函數(shù)的功能同以上的說明****/
#define STATUS_MSG_DEEP 10
unsigned char status_msg[STATUS_MSG_DEEP];
unsigned char status_tail=0;
unsigned char status_head=0;
void send_status_msg(unsigned char msg){
status_msg[status_head]=msg;
status_head++;
status_head %=STATUS_MSG_DEEP;
}
unsigned char read_status_msg(void){
unsigned char ret_msg;
if(status_tail!=status_head){//消息隊列不為空,返回消息
ret_msg=status_msg[status_tail];
status_tail++;
status_tail %=STATUS_MSG_DEEP;
return ret_msg;
}
else{
return 0;//消息隊列為空,返回0
}
}
void change_status_fsm(unsigned char fsm){//改變狀態(tài)機
screen.status_fsm=fsm;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -