display.c

来自「ARM s3c44box的一些程序代码」· C语言 代码 · 共 57 行

C
57
字号
/**********************************************************
  *
  *				Display demo
  *
  **********************************************************/
#include "global_function.h"
#include "display.h"

void Display_demo(void)
{
  B8	Input;
  
  printf("\n\n\r------------------ Display demo ------------------\n\r");
  printf(": enter a digit number, others will be display as E\n\r");
  printf(": Esc to return\n\r");
  printf("\n\ryour input: ");

  Input = Uart0_GetInput();
  
  while(Input != 0x1b)
  	{
          Uart0_SendByte(Input);
          Uart0_SendByte(0x08);		//backspace
  	
          switch(Input)
          {
          	case '0':       Input = getBCD(0);
          	                     break;
          	case '1':       Input = getBCD(1);
          	                     break;
          	case '2':       Input = getBCD(2);
          	                     break;
          	case '3':       Input = getBCD(3);
          	                     break;
          	case '4':       Input = getBCD(4);
          	                     break;
          	case '5':       Input = getBCD(5);
          	                     break;
          	case '6':       Input = getBCD(6);
          	                     break;
          	case '7':       Input = getBCD(7);
          	                     break;
          	case '8':       Input = getBCD(8);
          	                     break;
          	case '9':       Input = getBCD(9);
          	                     break;
          	default:        Input = getBCD('E');
          }
          
          mLEDSET = Input | Input << 8;
          
          Input = Uart0_GetInput();
  	}

  mLEDSET = 0;				//clear display
}

⌨️ 快捷键说明

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