⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get_next_font.c

📁 日本FAMILY按摩椅W-1用的配套操作器程序。带VFD显示
💻 C
字号:


#include "stdio.h"
#include "ctype.h"
#define  TM15S (15000/10-1)
#define  TM5S  (5000/10-1) 
typedef struct{
               unsigned char repeat_F;          //need repeat disp is set 1
               unsigned char *font_p;           //point disp font arry
               }WORD_P;                         

extern unsigned int *font_dot_p;
extern unsigned char fetch_dot_no;
extern bit disp_empty_F ;
extern unsigned char *code_p ;
extern  WORD_P first_disp_p;                         //txtprc() changed first_disp_p
extern  WORD_P second_disp_p;


extern  int		*DFontadr( int code );
bit clrscr_F ;
void    Get_next_font_adr(unsigned char *s);
int		isascii2( int c );
void	Txt_dsp_com(void);


const  char  ICON[][2]={
                        {0Xf0,0x10},                     //strength: qiang
                        {0xf0,0x11},                     //strength: middle
                        {0xf0,0x12},                     //strength: soft
                        
                        {0xf0,0x20},                     //MM1
                        {0xf0,0x21},                     //hand MM
                        {0xf0,0x22},                     //W MM
                        {0xf0,0x23},                     //MM and TT
                        {0xf0,0x24},                     //ST1
                        {0xf0,0x25},                     //ST2
                        {0xf0,0x26},                     //TT1
                        {0xf0,0x27},                     //TT2
                        {0xf0,0x28},                     //BACK VIBRATOR strong
                        {0xf0,0x29},                     //BACK VIBRATOR  soft
                        {0xf0,0x2a},                     //BACK VIBRATOR  stop
                        
                        {0xf0,0x30},                     //ZHEN ZUAN ICON
                        {0xf0,0x31},                     //NIE  ZUAN ICON
                        {0xf0,0x32},                     //SPEED 1
                        {0xf0,0x33},                     //SPEED 2
                        {0xf0,0x34},                     //SPEED 3
                        {0xf0,0x35},                     //SPEED 4
                        {0xf0,0x36},                     //SPEED 5
                        {0xf0,0x37},                     //SPEED 6
                        
                        {0xf0,0x40},                     //narrow icon
                        {0xf0,0x41},                     //mid    icon
                        {0xf0,0x42},                     //width  icon
                        
                        {0xf0,0x50},                     //back roller
                        {0xf0,0x51},                     //point roller
                        
                        {0xf0,0x60},                    //hand vib :strong
                        {0xf0,0x61},                    //hand vib: soft
                        {0xf0,0x62},                    //hand vib: stop
                        
                        {0xf0,0x70},                   //foot air massage
                        {0xf0,0x71},                   //hand air massage
                        
                        {0xf0,0x80},                   //hip air massage
                        
                        {0xf0,0x90}                   //leg air massage
                        
               };         
                                            
                        
                         
const	unsigned char	*Dlcd_com1_j[] = {
								"偙偺僐乕僗偼丄尦婥偑偱側偄丄旀傟傗偡偄丄恎懱偑偩傞偄側偳偺曽偵偍姪傔偟傑偡丅",
									// floating display 1 time
								"嬝擏偑嬞挘偟偰偄傞忬懺偵摥偒偐偗偰丄嬝擏偺嬞挘傪傎偖偟恎懱偵塭嬁傪梌偊傞\
巜埑揰傪巋寖偡傞帠偱擏懱偵惗偠偰偄傞旀楯傪夞暅偟傑偡丅",
									// floating display 1 time
								""
								};

const unsigned char *Dlcd_com_j[] = {
						//	"仠慡恎旀楯夞暅仠仠仠仠仠仠仠仠丂丂僐乕僗丂",
				            /*{0xf0,0x10,0xf0,0x11,0xf0,0x12,0xf0,0x20,0xf0,0x21,0xf0,0x22,0xf0,0x23,0xf0,0x24,
				             0xf0,0x25,0xf0,0x26,0xf0,0x27,0xf0,0x28,0xf0,0x29,0xf0,0x2a,0xf0,0x30,0xf0,0x31,
				             0xf0,0x32,0xf0,0x33,0xf0,0x34,0xf0,0x35,0xf0,0x36,0xf0,0x37,0xf0,0x40,0xf0,0x41,
				             0xf0,0x42,0xf0,0x50,0xf0,0x51,0xf0,0x60,0xf0,0x61,0xf0,0x62,0xf0,0x70,0xf0,0x71,
				             0xf0,0x80,0xf0,0x90,0x00,0x00},*/
				             ICON[0],
				         //    ICON[4],
				             
							""
							};
unsigned char com_disp_step ;	
unsigned int timer;						
/**************************************************/
/**************************************************/
void	Txt_dsp_com(void)
{
//	char	comment[33];
    if(first_disp_p.repeat_F == 1)
    {
          first_disp_p.font_p = Dlcd_com_j[com_disp_step];
    //      clrscr_F=0;
    }
    else if(second_disp_p.repeat_F == 0)
    
	{	
		
		if(*Dlcd_com1_j[com_disp_step] != '\0')
		{			
		 second_disp_p.font_p = Dlcd_com1_j[com_disp_step];
		 com_disp_step++;	
		 second_disp_p.repeat_F = 1;
		
	    }
	    else
	    {
	       com_disp_step = 0;
	       second_disp_p.repeat_F = 0;
	    }
	}
	timer++;
	if(clrscr_F)
	  { if(timer >= TM5S)
	     {
	       clrscr_F = 0;
	       timer = 0;
	      }
	  }
	else if(timer >= TM15S)
	   { 
	      clrscr_F = 1;
	      timer = 0;
	   }
}

unsigned char fetch_dot_no ;
unsigned int *old_font_dot_p ;
/***********************************************/
/***********************************************/

void	Get_next_font_adr(unsigned char *s)
{
	if(*s!='\0')
	{
		if(*(s + 1) != '\0')
		{
			if(isascii2((int)*s & 0xff))
			{
				if(*s != '\r')    //not return
				{
		//			DTput((int)*s & 0xff) ;			//2003-11-1
				font_dot_p=(unsigned int*)DFontadr((int)*s&0xff);	//2003-11-1	add
				old_font_dot_p=font_dot_p+fetch_dot_no;		//2003-11-1	add
				++s ;
				}
				
			}
			else
			{
		//		DTput(*(int*)s) ;
				font_dot_p=(unsigned int *)DFontadr(*(int *)s);	//2003-11-1	add
				old_font_dot_p=font_dot_p+fetch_dot_no;		//2003-11-1	add
				++((int *)s);
				
			}
		}
		else
		{
	//		DTput((int)*s & 0xff) ;
			font_dot_p=(unsigned int *)DFontadr((int)*s&0xff);	//2003-11-1	add
			old_font_dot_p=font_dot_p+fetch_dot_no;		//2003-11-1	add			
			++s;
		}
		code_p = s;
	}
	else
	{
	   
	    disp_empty_F = 1;
	 }
}


/*******************************************************/
/*******************************************************/

int		isascii2( int c )
{

	if(((c >= 0) && (c <= 0x7f)) || ((c >= 0xa0) && (c <= 0xd6)))
	
	
	{

		return(1);
	}
	return(0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -