📄 disp.lst
字号:
575 1 Byte volume;
576 1
577 1 if (!bargraph) return;
578 1 volume = song_get_level();
579 1 if (func_state == 5)
580 1 {
581 2 LED_ON = 7;
582 2 if (MP3CON & MSK_MPBBST) LED_FAST = 1;
583 2 else LED_FAST = 2;
584 2 return;
585 2 }
586 1 /* volume must be between 0 -> 31 */
587 1 if (volume < 7 ) LED_ON = 0;
588 1 else if (volume < 14) LED_ON = 1;
589 1 else if (volume < 20) LED_ON = 3;
590 1 else if (volume < 26) LED_ON = 7;
591 1 else LED_ON = 15;
592 1 LED_FAST = 3;
593 1 #endif
594 1 }
595
596
597 /*F**************************************************************************
598 * NAME: print_voice_vol
599 *----------------------------------------------------------------------------
600 * PARAMS:
601 *
602 * return:
603 *----------------------------------------------------------------------------
604 * PURPOSE:
605 * Print the voice volume
606 *----------------------------------------------------------------------------
607 * EXAMPLE:
608 *----------------------------------------------------------------------------
609 * NOTE:
610 *----------------------------------------------------------------------------
611 * REQUIREMENTS:
612 *****************************************************************************/
C51 COMPILER V7.20 DISP 03/24/2007 10:02:40 PAGE 11
613 void print_voice_vol (char volume)
614 {
615 1 #if CONF_DISPLAY == LCD
lcd_set_cur(POS_SOUND_LVL);
lcd_putchar(volume + '0');
#else
619 1 if (!bargraph) return;
620 1 // volume must be between 0 -> 4
621 1 LED_ON = (15 >> (4 - volume));
622 1 LED_FAST = 3;
623 1 #endif
624 1 }
625
626
627 /*F**************************************************************************
628 * NAME: print_time
629 *----------------------------------------------------------------------------
630 * PARAMS:
631 * - min: minute to display
632 * - sec: second to display
633 * return:
634 *----------------------------------------------------------------------------
635 * PURPOSE:
636 * Print time on the LCD
637 *----------------------------------------------------------------------------
638 * EXAMPLE:
639 *----------------------------------------------------------------------------
640 * NOTE:
641 *----------------------------------------------------------------------------
642 * REQUIREMENTS:
643 *****************************************************************************/
644 void print_time (Byte min, Byte sec)
645 {
646 1 #if CONF_DISPLAY == LCD
lcd_set_cur(POS_TIME);
#endif
649 1 LCDClearLine( TRACK_CURR_TIME_Y_POS, TRACK_CURR_TIME_X_POS, 12 );
650 1 Draw2Digit( TRACK_CURR_TIME_X_POS, sec);
651 1 print_decim(min, TRUE);
652 1 #if CONF_DISPLAY == LCD
lcd_putchar(':');
#endif
655 1 LCDClearLine( TRACK_CURR_TIME_Y_POS,TRACK_CURR_TIME_X_POS-15, 12 );
656 1 Draw2Digit( TRACK_CURR_TIME_X_POS-15, min);
657 1 print_decim(sec, FALSE);
658 1 }
659
660
661 /*F**************************************************************************
662 * NAME: print_sec
663 *----------------------------------------------------------------------------
664 * PARAMS:
665 * - sec: second to display
666 * return:
667 *----------------------------------------------------------------------------
668 * PURPOSE:
669 * Print second of time on the LCD
670 *----------------------------------------------------------------------------
671 * EXAMPLE:
672 *----------------------------------------------------------------------------
673 * NOTE:
674 *----------------------------------------------------------------------------
C51 COMPILER V7.20 DISP 03/24/2007 10:02:40 PAGE 12
675 * REQUIREMENTS:
676 *****************************************************************************/
677 void print_sec (Byte sec)
678 {
679 1 #if CONF_DISPLAY == LCD
lcd_set_cur(POS_SECOND);
print_decim(sec, FALSE);
#else
683 1 Draw8x6Icons( TRACK_CURR_TIME_Y_POS, TRACK_CURR_TIME_X_POS-2, 10);
684 1 LCDClearLine( TRACK_CURR_TIME_Y_POS, TRACK_CURR_TIME_X_POS, 12 );
685 1 Draw2Digit( TRACK_CURR_TIME_X_POS, sec);
686 1 if (func_timeout>2)
687 1 {
688 2 func_state = 0;
689 2 bargraph = FALSE;
690 2 LED_ON = (8 >> ref_state);
691 2 if (recording) LED_ON = 15 - LED_ON;
692 2 LED_FAST = 1;
693 2 song_sound = SND_VOLUME;
694 2 }
695 1 else func_timeout++;
696 1 if (sec);
697 1 #endif
698 1 }
699
700
701 /*F**************************************************************************
702 * NAME: print_min
703 *----------------------------------------------------------------------------
704 * PARAMS:
705 * - min: minute to display
706 * return:
707 *----------------------------------------------------------------------------
708 * PURPOSE:
709 * Print minute of time on the LCD
710 *----------------------------------------------------------------------------
711 * EXAMPLE:
712 *----------------------------------------------------------------------------
713 * NOTE:
714 *----------------------------------------------------------------------------
715 * REQUIREMENTS:
716 *****************************************************************************/
717 void print_min (Byte min)
718 {
719 1 #if CONF_DISPLAY == LCD
lcd_set_cur(POS_MINUTE);
#endif
722 1 if(min==0)
723 1
724 1 LCDClearLine( TRACK_CURR_TIME_Y_POS,TRACK_CURR_TIME_X_POS-15, 12 );
725 1 Draw2Digit( TRACK_CURR_TIME_X_POS-15, min);
726 1 print_decim(min, TRUE);
727 1 }
728
729
730 /*F**************************************************************************
731 * NAME: print_kbd_lock
732 *----------------------------------------------------------------------------
733 * PARAMS:
734 *
735 * return:
736 *----------------------------------------------------------------------------
C51 COMPILER V7.20 DISP 03/24/2007 10:02:40 PAGE 13
737 * PURPOSE:
738 * Print the lock status
739 *----------------------------------------------------------------------------
740 * EXAMPLE:
741 *----------------------------------------------------------------------------
742 * NOTE:
743 *----------------------------------------------------------------------------
744 * REQUIREMENTS:
745 *****************************************************************************/
746 void print_kbd_lock (void)
747 {
748 1 #if CONF_DISPLAY == LCD
lcd_cgram(CGRAM_LOCK, cgram_lock); /* init lock icon to locked */
#endif
751 1 }
752
753 /*F**************************************************************************
754 * NAME: print_kbd_lock
755 *----------------------------------------------------------------------------
756 * PARAMS:
757 *
758 * return:
759 *----------------------------------------------------------------------------
760 * PURPOSE:
761 * Print the unlock status
762 *----------------------------------------------------------------------------
763 * EXAMPLE:
764 *----------------------------------------------------------------------------
765 * NOTE:
766 *----------------------------------------------------------------------------
767 * REQUIREMENTS:
768 *****************************************************************************/
769 void print_kbd_unlock (void)
770 {
771 1 #if CONF_DISPLAY == LCD
lcd_cgram(CGRAM_LOCK, cgram_blank); /* init lock icon to unlocked */
#endif
774 1 }
775
776 /*F**************************************************************************
777 * NAME: print_mem
778 *----------------------------------------------------------------------------
779 * PARAMS:
780 * - mem_type SYMB_CHIP
781 * SYMB_CARD
782 * SYMB_CARD2
783 * SYMB_NO_MEM
784 * return:
785 *----------------------------------------------------------------------------
786 * PURPOSE:
787 * Print the memory type on the LCD
788 *----------------------------------------------------------------------------
789 * EXAMPLE:
790 *----------------------------------------------------------------------------
791 * NOTE:
792 *----------------------------------------------------------------------------
793 * REQUIREMENTS:
794 *****************************************************************************/
795 void print_mem (Byte mem_type)
796 {
797 1 #if CONF_DISPLAY == LCD
switch (mem_type)
C51 COMPILER V7.20 DISP 03/24/2007 10:02:40 PAGE 14
{
case SYMB_CHIP:
lcd_cgram(CGRAM_MEM, cgram_chip);
break;
case SYMB_CARD:
lcd_cgram(CGRAM_MEM, cgram_card);
break;
case SYMB_CARD1:
lcd_cgram(CGRAM_MEM, cgram_card1);
break;
case SYMB_CARD2:
lcd_cgram(CGRAM_MEM, cgram_card2);
break;
default:
lcd_cgram(CGRAM_MEM, cgram_blank);
break;
}
#else
821 1 if (mem_type);
822 1 #endif
823 1 }
824
825
826 /*F**************************************************************************
827 * NAME: print_repeat
828 *----------------------------------------------------------------------------
829 * PARAMS:
830 * status: - TRUE: play is repeated after last song
831 * - FALSE: play is stopped after last song
832 * return:
833 *----------------------------------------------------------------------------
834 * PURPOSE:
835 * Print repeat status on the LCD
836 *----------------------------------------------------------------------------
837 * EXAMPLE:
838 *----------------------------------------------------------------------------
839 * NOTE:
840 *----------------------------------------------------------------------------
841 * REQUIREMENTS:
842 *****************************************************************************/
843 void print_repeat (Byte rep_type)
844 {
845 1 #if CONF_DISPLAY == LCD
switch (rep_type)
{
case SYMB_REP_DIR:
lcd_cgram(CGRAM_REPEAT, cgram_repeat);
break;
case SYMB_REP_FILE:
lcd_cgram(CGRAM_REPEAT, cgram_repeat);
break;
case SYMB_REP_A:
lcd_cgram(CGRAM_REPEAT, cgram_rep_A);
break;
case SYMB_REP_B:
C51 COMPILER V7.20 DISP 03/24/2007 10:02:40 PAGE 15
lcd_cgram(CGRAM_REPEAT, cgram_rep_B);
break;
default:
lcd_cgram(CGRAM_REPEAT, cgram_blank);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -