Beispiel #1
0
void Disp_PutStr(char *p) {
	while (*p) {
		Disp_PutChar(*p++);
	}
}
Beispiel #2
0
void Show_Main(char n)
{
  long min, max; char s;
  Disp_Clear();                       //clear display

  //blink name:
  if(!Hide)
  {
    if(n == MODE_FIF)
      Disp_PutChar('f');                //display "f"
        else Disp_PutString(Str_V[n]);  //show value name
  }

  long v = Count_GetValue();          //read counter
  if(Count_Ready()) Count_Start();    //start counter

  char p = (Scale & ~AUTO_SCALE) + 1; //DP position
  switch(n)
  {
#ifdef HI_RES
  case MODE_F:
  case MODE_FIF:
  case MODE_P:
  case MODE_D:
    s = 3;
    min = 100000000L;
    max = 999999999L;
    break;
  case MODE_R:
    s = 5;
    min = 1000000L;
    max = 9999999L;
    break;
  default:
    s = 4;                            //first position
    min = 10000000L;                  //min value for auto scale
    max = 99999999L;                  //max value for auto scale
#else
  case MODE_F:
  case MODE_FIF:
  case MODE_P:
  case MODE_D:
    s = 3;
    min = 10000000L;
    max = 99999999L;
    break;
  case MODE_R:
    s = 5;
    min = 100000L;
    max = 999999L;
    break;
  default:
    s = 4;                            //first position
    min = 1000000L;                   //min value for auto scale
    max = 9999999L;                   //max value for auto scale
#endif
  }

  //blink value:
  //if(!Hide)
    Disp_Val(s, p, v);                //show value
  Disp_Update();                      //update display

  if(Scale & AUTO_SCALE)              //if auto scale
  {
    if(v >= 0)
    {
      if(v < min) MoveDP(KEY_DN);     //move DP left
      if(v > max) MoveDP(KEY_UP);     //move DP right
    }
    else
    {
      if(v > -min) MoveDP(KEY_DN);    //move DP left
      if(v < -max) MoveDP(KEY_UP);    //move DP right
    }
    Scale |= AUTO_SCALE;              //restore auto scale flag
    Count_SetScale(Scale);            //update scale
  }
}