📄 disp.lst
字号:
798 /*F*****************************************************************************
C51 COMPILER V7.50 DISP 09/20/2005 21:47:47 PAGE 14
799 * NAME: print_file_name
800 *-------------------------------------------------------------------------------
801 * PARAMS:
802 *
803 * return:
804 *----------------------------------------------------------------------------
805 * PURPOSE:
806 * Print to lcd the current file name
807 *----------------------------------------------------------------------------
808 * EXAMPLE:
809 *----------------------------------------------------------------------------
810 * NOTE:
811 *----------------------------------------------------------------------------
812 * REQUIREMENTS:
813 *****************************************************************************/
814 void print_file_name()
815 {
816 1 #if CONF_DISPLAY == LCD
switch(File_type()) /* print file type icon */
{
case FILE_DIR:
lcd_cgram(CGRAM_TYPE, cgram_dir); /* select directory icon */
break;
case FILE_MP3:
lcd_cgram(CGRAM_TYPE, cgram_mp3); /* select song icon */
break;
case FILE_WAV:
lcd_cgram(CGRAM_TYPE, cgram_wav); /* select voice icon */
break;
default:
lcd_cgram(CGRAM_TYPE, cgram_blank); /* select voice icon */
break;
}
#endif
836 1 disp_name_start(); /* start name display */
837 1 }
838
839
840 /*F*****************************************************************************
841 * NAME: print_file_type
842 *-------------------------------------------------------------------------------
843 * PARAMS:
844 *
845 * return:
846 *----------------------------------------------------------------------------
847 * PURPOSE:
848 * Print to lcd the current file type
849 *----------------------------------------------------------------------------
850 * EXAMPLE:
851 *----------------------------------------------------------------------------
852 * NOTE:
853 *----------------------------------------------------------------------------
854 * REQUIREMENTS:
855 *****************************************************************************/
856 void print_file_type()
857 {
858 1 #if CONF_DISPLAY == LCD
switch(File_type()) /* print file type icon */
{
C51 COMPILER V7.50 DISP 09/20/2005 21:47:47 PAGE 15
case FILE_DIR:
lcd_cgram(CGRAM_TYPE, cgram_dir); /* select directory icon */
break;
case FILE_MP3:
lcd_cgram(CGRAM_TYPE, cgram_mp3); /* select song icon */
break;
case FILE_WAV:
lcd_cgram(CGRAM_TYPE, cgram_wav); /* select voice icon */
break;
default:
lcd_cgram(CGRAM_TYPE, cgram_blank); /* select voice icon */
break;
}
#endif
878 1 }
879
880
881 /*F*****************************************************************************
882 * NAME: print_name
883 *-------------------------------------------------------------------------------
884 * PARAMS:
885 * string: pointer on char string
886 * return:
887 * TRUE: at the end of the string
888 * FALSE: in the middle of the string
889 *----------------------------------------------------------------------------
890 * PURPOSE:
891 * Print 14 characters of the file name
892 *----------------------------------------------------------------------------
893 * EXAMPLE:
894 *----------------------------------------------------------------------------
895 * NOTE:
896 *----------------------------------------------------------------------------
897 * REQUIREMENTS:
898 *****************************************************************************/
899 bit print_name (char pdata *string)
900 {
901 1 #if CONF_DISPLAY == LCD
lcd_set_cur(POS_FILE);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
lcd_putchar(*string++);
return (*string == '\0');
#else
919 1 if (string);
920 1 return 1;
921 1 #endif
922 1
C51 COMPILER V7.50 DISP 09/20/2005 21:47:47 PAGE 16
923 1 }
924
925
926 /*F**************************************************************************
927 * NAME: print_screen
928 *----------------------------------------------------------------------------
929 * PARAMS:
930 * screen: string in code space to print on LCD
931 * return:
932 *----------------------------------------------------------------------------
933 * PURPOSE:
934 * Print a screen string on LCD
935 *----------------------------------------------------------------------------
936 * EXAMPLE:
937 *----------------------------------------------------------------------------
938 * NOTE:
939 *----------------------------------------------------------------------------
940 * REQUIREMENTS:
941 *****************************************************************************/
942 void print_screen (char code *screen)
943 {
944 1 #if CONF_DISPLAY == LCD
lcd_set_cur(POS_HOME);
while (*screen != '\0')
{
lcd_putchar(*screen++);
}
#else
951 1 if (screen);
952 1 #endif
953 1 }
954
955
956 /*F**************************************************************************
957 * NAME: print_string
958 *----------------------------------------------------------------------------
959 * PARAMS:
960 * string: string in code space to print on LCD
961 * return:
962 *----------------------------------------------------------------------------
963 * PURPOSE:
964 * Print a string on LCD
965 *----------------------------------------------------------------------------
966 * EXAMPLE:
967 *----------------------------------------------------------------------------
968 * NOTE:
969 *----------------------------------------------------------------------------
970 * REQUIREMENTS:
971 *****************************************************************************/
972 void print_string (char code *string)
973 {
974 1 #if CONF_DISPLAY == LCD
while (*string != '\0')
{
lcd_putchar(*string++);
}
#else
980 1 if (string);
981 1 #endif
982 1 }
983
984
C51 COMPILER V7.50 DISP 09/20/2005 21:47:47 PAGE 17
985 #if CONF_DISPLAY == LED
986 /*F**************************************************************************
987 * NAME: print_fatal_screen
988 *----------------------------------------------------------------------------
989 * PARAMS:
990 * screen: string in code space to print on LCD
991 * return:
992 *----------------------------------------------------------------------------
993 * PURPOSE:
994 * Print a screen string on LCD
995 *----------------------------------------------------------------------------
996 * EXAMPLE:
997 *----------------------------------------------------------------------------
998 * NOTE:
999 *----------------------------------------------------------------------------
1000 * REQUIREMENTS:
1001 *****************************************************************************/
1002 void print_fatal_screen (void)
1003 {
1004 1 LED_TREEB = LED_BASS=LED_MED = 0;
1005 1 LED_VOL = 1;
1006 1 }
1007 #endif
1008
1009 /*F****************************************************************************
1010 * NAME: print_decim
1011 *------------------------------------------------------------------------------
1012 * PARAMS:
1013 * b: number to print
1014 * space: TRUE: print ' 0', FALSE: print '00'
1015 * return:
1016 *------------------------------------------------------------------------------
1017 * PURPOSE:
1018 * Print a 2 digits number on LCD '00-99' or ' 0-99'
1019 *----------------------------------------------------------------------------
1020 * EXAMPLE:
1021 *----------------------------------------------------------------------------
1022 * NOTE:
1023 *----------------------------------------------------------------------------
1024 * REQUIREMENTS:
1025 *****************************************************************************/
1026 void print_decim (Byte b, bit space)
1027 {
1028 1 #if CONF_DISPLAY == LCD
if (b < 10)
{
if (space)
lcd_putchar(' ');
else
lcd_putchar('0');
lcd_putchar(b +'0');
}
else
{
lcd_putchar(b / 10 +'0');
lcd_putchar(b % 10 +'0');
}
#else
1043 1 if (b && space);
1044 1 #endif
1045 1 }
1046
C51 COMPILER V7.50 DISP 09/20/2005 21:47:47 PAGE 18
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 530 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 10
IDATA SIZE = ---- ----
BIT SIZE = ---- 1
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -