📄 osdutil.c
字号:
/********************* SGS-THOMSON MICROELECTRONICS ************************
FILENAME : OSDUTIL.C
VERSION : V1.0
DATE : JAN 1999
AUTHOR(s) : ASHISH RUDOLA/ DEEPAK DOSHI
PROCESSOR : ST92195
DESCRIPTION : This module contains functions utilities for handling displays.
MODIFICATIONS:
-
*****************************************************************************/
#include "osdutil.h"
#include "macro.h"
#include "channel.h"
#include "clock.h"
#include "label.h"
#include "osdchar.h"
#include "register.h"
#include "source.h"
#include "utility.h"
#include "video.h"
#include "alarm.h"
#include "autosrch.h"
#include "i2c_bus.h"
#include "menuctrl.h"
#include "display.h"
#include "tv_glob.h"
#include "st92196.h"
#include "osddrv.h"
/*****************************************************************************
INPUTS : value - To be converted
selection - Convert tundreds or tens or units
OUTPUTS : ASCII character
DESCRIPTION: This function converts the argument to an ASCII character.
*****************************************************************************/
unsigned char convert_to_ASCII(unsigned char selection, unsigned int value)
{
unsigned int i; /* Temporary storage */
i = value/1000;
if(selection == HUNDREDS)
i = (value%1000)/100;
if (selection == TENS)
i = (value%100)/10;
if (selection == UNITS)
i = value % 10;
i = i + 0x30;
return (unsigned char)i;
}
/*****************************************************************************
INPUTS : DRAM pointer - Point the location to start with
hour - current time of day
minute - current time of day
OUTPUTS : Return the next DRAM location
see convert_to_ASCII
see display_space
see display_string
see write_character
DESCRIPTION: This function writes the time of day.
*****************************************************************************/
void display_clock( unsigned char row,unsigned char start_x,
unsigned char display_hour,
unsigned char display_minute)
{
/* Prepare clock parameters: 0:00 : 23 :59 */
unsigned char tmphigh,tmplow;
if (display_hour & SET_NIBBLE_TIME)
{
display_hour &= ~SET_NIBBLE_TIME;
tmphigh =0xa4;
}
else
tmphigh = convert_to_ASCII(TENS, display_hour);
tmplow = convert_to_ASCII(UNITS, display_hour);
if (display_hour & DISABLE_TIME)
fill_char_in_line(row,start_x,0xa4,2);
else
{
fill_char_in_line(row,start_x,tmphigh,1);
fill_char_in_line(row,start_x+1,tmplow,1);
}
fill_char_in_line(row,start_x+2,':',1);
if (display_minute & SET_NIBBLE_TIME)
{
display_minute &= ~SET_NIBBLE_TIME;
tmphigh =0xa4;
}
else
tmphigh = convert_to_ASCII(TENS, display_minute);
tmplow = convert_to_ASCII(UNITS, display_minute);
if (display_minute & DISABLE_TIME)
fill_char_in_line(row,start_x+3,0xa4,2);
else
{
fill_char_in_line(row,start_x+3,tmphigh,1);
fill_char_in_line(row,start_x+4,tmplow,1);
}
}
void display_value(unsigned char row,unsigned char start_x,unsigned char value)
{
unsigned char tmp[3];
tmp[0] = convert_to_ASCII(TENS, value);
tmp[1] = convert_to_ASCII(UNITS, value);
tmp[2] = CHNULL;
fill_string_in_line(row,start_x,tmp);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -