Пример #1
0
Файл: ADC.c Проект: skitt/sysd7
void realhex (unsigned char c)
{
  if (c > 9)
    mon_putc (c + 'A' - 10);
  else
    mon_putc (c + '0');
}
Пример #2
0
void realhex (unsigned char value)
{
  if (value < 10)
    mon_putc (value + '0');
  else
    mon_putc (value + 'A' - 10);
}
Пример #3
0
void puts (char * string)
{
  while (*string)
    {
      mon_putc (*string);
      string++;
    }
}
Пример #4
0
void main()
{
  serialinit();
  serialtransmit('a');
  serialreceive();
  mon_putc('A');
  while(1)
    serialtransmit(serialreceive());
}
Пример #5
0
void number (int value, int max)
{
  int i;
  for (i = max; i > 0; i /= 10)
    {
      mon_putc (value / i + '0');
      value %= i;
    }
}
Пример #6
0
/* Display the given character on the IDP's LED */
void leddisplay (unsigned char c)
{
  int i;
  unsigned char * ledreg = (unsigned char *) 0x00D00003;

#ifdef DEBUG
  puts ("LED: ");
  mon_putc (c);
  puts ("\n\r");
#endif
  /* Search for the correct code to display */
  for (i = 0; i < LEDCODES; i++)
    if (ledcodes [2 * i] == c)
      *ledreg = ledcodes [2 * i + 1];
}
Пример #7
0
write(int handle, void * buffer, unsigned int len)
{
    portBASE_TYPE semStatus = xSemaphoreTake(consolePrintfSem, 2000/portTICK_RATE_MS);
    if(semStatus != pdPASS){return 0;}

    int i = 0;
    switch (handle)
    {
        case STDOUT:
        case STDERR:
            while (i < len)
                mon_putc(((char*)buffer)[i++]);
            break;
    }
    xSemaphoreGive(consolePrintfSem);
    return (len);  // number of characters written
}
Пример #8
0
Файл: frog.c Проект: skitt/sysd7
main ()
{
  char c;
  while ((c = mon_getc ()) != 4)
    mon_putc (c);
}