vfd.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:19k
- /*
- ** FILE
- ** vfd.c
- **
- ** DESCRIPTION
- ** handle VFD functions.
- */
- #include "user_init.h"
- #include "config.h"
- #include "global.h"
- #include "memmap.h"
- #include "sio.h"
- #include "vfdfunc.h"
- #include "ircode.h"
- #include "ircmd.h"
- #include "func.h"
- #include "osd.h"
- #include "avd.h"
- #include "gpio.h"
- #include "iop.h"
- #include "cd.h"
- #ifdef USE_VFDPORT_TRANDATA //add by linrc 2004-3-24 21:56 for minidvd receive
- #include "8200_51MCU.c" //program introduce in the /IR_VFD/8200_51MCU.c file
- #endif
- UINT32 get_rtc_val();
- //#ifdef P9c9_Panel //jacky 2003/10/23 07:35PM
- #ifdef USE_VFD_CONTROL_P9C9_LED_ON_OFF //gerry,2004-1-30 18:11
- int led_flash_interval=0;
- int led_flash_time=0;
- #endif
- #ifdef BBK_DVD //fengjl add 4-2-3 20:22
- extern tv_output_vfd_time;
- #endif
- static UINT16 counter, index;
- BYTE vfd_state = 0;
- extern UINT32 save_srn_start_t;
- #include "vfd_mod.c"
- #ifdef HT1621_PANNEL//nono 4-5-9 23:56
- const BYTE vfd_keycode[]={};
- #endif
- #ifdef NEW_JPEG
- extern BYTE bJpgVFDPause;
- #else
- #ifndef SHARE_NAV_VAR
- extern BYTE bJpgVFDPause; //Jeff 20020523
- #else
- #define bJpgVFDPause (pFsJpeg->bJpgVFDPause)
- #endif
- #endif
- extern UINT16 Is_JPEG_SlideMode(void);
- #if defined(SLEEP_WHEN_POWER_ON)&&defined(TONIC_DVD)//20040206
- extern int power_on_flag; //zhg 2004-1-4 15:46
- #endif
- #ifdef EASTWIN
- UINT8 bINVERTER_POWER = 0, bEARPHONE_IN = 0,bAMP_IS_ON = 0,bLOWBAT_DISP = 0,bPOWER_LED_FLASH = 0;
- UINT8 bIS_LOWBAT = 0, bPOWER_ON_MUTE_EXE = 0; // Kevin Sep 10,04
- #endif
- #ifdef NEXT_FORWARD_IN_A_KEY //gerry move it here,3-10-29 17:50
- BYTE key_data_flag=0;
- #endif
- //#define VFD_DBG 1
- //#define VFD_KEY_TEST
- #ifdef TEST_VFD //shawn add at 910131
- UINT8 SC_1 = 15;
- UINT8 COMMAND_MODE = 2;
- void update_vfd_dot_inc(void) //shawn add at 910131
- {
- if(SC_1 < 40)
- SC_1++;
- printf("n SC_1(BYTE_INC)=%dnn", SC_1);
-
- #ifdef VFD2OSD_DBG_TXD
- psprintf(RegionValStr[REGION1], "SC_1 BYTE_INC: %d", SC_1);
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- #endif
- }
- void update_vfd_dot_dec(void) //shawn add at 910131
- {
- UINT8 a;
-
- for(a = SC_1; a <= 25; a++)
- vfd_mem[a] = 0x00;
- if(SC_1 > 0)
- SC_1--;
- printf("n SC_1(BYTE_DEC)=%dnn", SC_1);
-
- #ifdef VFD2OSD_DBG_TXD //nono 2-8-9 14:39
- psprintf(RegionValStr[REGION1], "SC_1 BYTE_DEC: %d", SC_1);
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- #endif
- }
- void update_vfd_mod_inc(void) //shawn add at 910131
- {
- //counter++;
-
- if(COMMAND_MODE < 16)
- COMMAND_MODE++;
-
- printf("n COMMAND_MODE(INC)=%dnn", COMMAND_MODE);
-
- #ifdef VFD2OSD_DBG_TXD //nono 2-8-9 14:40
- psprintf(RegionValStr[REGION3], "COMMAND_MODE INC: %d", COMMAND_MODE);
- PrintOsdMsg(STR_OS_SPACE, REGION3, 1, 1);
-
- #endif
-
- reset_vfd();
- }
- void update_vfd_mod_dec(void) //shawn add at 910131
- {
- //counter--;
-
- if(COMMAND_MODE > 0)
- COMMAND_MODE--;
- printf("n COMMAND_MODE(DEC)=%dnn", COMMAND_MODE);
-
- #ifdef VFD2OSD_DBG_TXD //nono 2-8-9 14:40
- psprintf(RegionValStr[REGION1], "COMMAND_MODE DEC: %d", COMMAND_MODE);
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- #endif
-
- reset_vfd();
- }
- void update_vfd_inc(void) //shawn modify at 910131
- {
- counter++;
- }
- void update_vfd_dec(void) //shawn modify at 910131
- {
- counter--;
- }
- #endif //TEST_VFD
- #ifdef SHOW_VOL_ON_VFD //huziqin 2004-4-29.if setting channel volume.
- extern BYTE subvol_time_out;
- #endif
- void update_vfd_data(void)
- {
- #if defined(SUPPORT_VFD)&&defined(SUPPORT_VFD_PANEL)//nono 20031124//lijd 2004-12-4 11:14
- #ifdef VFD_SHOW_LOAD_TOGGLE//nono 2003-10-17 18:23
- static BYTE load_toggle_flag;
- #endif
- #ifdef SHOW_VOL_ON_VFD
- if(subvol_time_out)
- {
- show_amp_vol_on_vfd();
- return;
- }
- #endif
- #ifdef TEST_VFD
- UINT8 by, bit, i; //,j; //shawn modify at 910131
-
-
- index++;
- if(index % 10)
- return;
-
-
-
- by = counter / 8;
- bit = counter % 8;
-
- #ifdef YADAI_PT6554_PANNEL
- for(i = 0; i < SC_1; i++)
- {
- if((i==5)||(i==11)||(i==17)||(i==23))
- {
- vfd_mem[i] = 0x00;
- }
- else
- {
- vfd_mem[i] = 0xff;
- }
- }
- #else
-
- for(i = 0; i < SC_1; i++)
- vfd_mem[i] = 0xff;
-
- #endif
-
-
- vfd_mem[by] = ~(0x01 << bit);
-
-
- //vfd_set_str(STR_OS_CLOSE,"");
-
- printf("BYTE:%d BIT:%dn", by, bit);
- //psprintf(linebuf,"BYTE:%d BIT:%d",by,bit);
-
- #ifdef VFD2OSD_DBG_TXD //nono 2-8-9 14:40
- psprintf(RegionValStr[REGION1], "BYTE:%d BIT:%d", by, bit);
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- #endif
- //ShowOsdMsg(linebuf,0);
- return;
- #endif
-
- #ifdef BBK_DV961_DVD//zhaoyanhua add to show VFD Message for VGA/INTERLACE/P_SCAN 3-11-27 9:50
- if(tv_output_vfd_time != 0)
- {
- tv_output_vfd_time--;
- switch(tv_out_id)
- {
- case INTERLACE:
- vfd_set_str(0,"1- ");
- break;
- case PC_VGA:
- vfd_set_str(0,"2- ");
- break;
- case P_SCAN:
- vfd_set_str(0,"3- ");
- break;
-
- }
-
- //turn off ":"(min)":"(sec)
- vfd_reset_dot(VFD_DOT_MINSEC);
- vfd_reset_dot(VFD_DOT_MIN);
- return;
- }
- #endif //#ifdef BBK_DV961_DVD
-
-
- if(play_state != VCD_STATE_TUNER)
- {
- //===========================================
- #ifdef HUAJIA_DVD
- #define INTV_TM 20
- #else
- #define INTV_TM 10
- #endif
- counter++;
-
-
- if(adv_search_time > 0)
- {
- if(counter % (INTV_TM / adv_search_time))
- return;
- }
- else if(adv_search_time < 0)
- {
- if(counter % (INTV_TM / (-adv_search_time)))
- return;
- }
- else if(video_slow)
- {
- {
- UINT8 rate = (UINT8) video_slow;
-
- if(counter % (INTV_TM * rate))
- return;
- }
- }
- else if(play_state != VCD_STATE_CLOSE)
- {
- if(counter % INTV_TM)
- return;
- }
- else if(counter % (INTV_TM / 2))
- return;
- counter = 0;
- }
-
- /********************************************************/
- // try the function by chichang 2001 6/5
- /********************************************************/
- /*
- vfd_mem[36]=0xff;
- vfd_mem[37]=0xff;
-
- vfd_set_dot(VFD_DOT_PLAY);
- vfd_set_dot(vfd_disc[index]);
- //vfd_set_str(0,"WELCOME");
-
-
- if(index>=11)
- {
- index=0;
- }else
- index++;
- vfd_reset_dot(vfd_disc[index]);
- */
- //===========================================================//
- // process the vfd display of volume and tone 2002-07-03 freyman
- /************************************************************/
- #ifdef VFD_VOLUME_DISPLAY
- // if(vfd_mode_state != DVD_NORMAL_MODE)
- if(timeout_vfd != 0)
- return;
- #endif
- /************************************************************/
- // start the vfd program
- /************************************************************/
- #ifdef USE_VFD_LED_AS_IO //xyy add for Oritron
- write_vfd_led(0x00);
- #endif
- #ifdef VOL_LED
- write_vfd_led(0xff);
- #endif
- #ifdef GBM_USE_VFD_CONTROL_LED //GERRY,2004/2/12 04:14