Beispiel #1
0
void print_top_block()
{
//	printf("%c%c%c", 0xe2, 0x96, 0x80);
	uart0SendChar(0xe2);
	uart0SendChar(0x96);
	uart0SendChar(0x80);
}
Beispiel #2
0
void print_bottom_block()
{
//	printf("%c%c%c", 0xe2, 0x96, 0x84);
	uart0SendChar(0xe2);
	uart0SendChar(0x96);
	uart0SendChar(0x84);
}
Beispiel #3
0
/* Get a frame from the camera.
   Serial protocol char: I */
void get_frame () {
	unsigned char ch;
	move_image((unsigned char *)DMA_BUF1, (unsigned char *)DMA_BUF2, (unsigned char *)FRAME_BUF, imgWidth, imgHeight); 
	if (overlay_flag) {
		frame[9] = (framecount % 10) + 0x30;
		frame[8] = ((framecount/10)% 10) + 0x30;
		frame[7] = ((framecount/100)% 10) + 0x30;
		set_caption(frame, imgWidth);
	}
	output_start = (unsigned char *)JPEG_BUF;
	output_end = encode_image((unsigned char *)FRAME_BUF, 
	output_start, quality, FOUR_TWO_TWO, imgWidth, imgHeight); 
	image_size = (unsigned int)(output_end - output_start);

	led1_on();

	framecount++;
	uart0SendString(imgHead);
	uart0SendChar((unsigned char)(image_size & 0x000000FF));
	uart0SendChar((unsigned char)((image_size & 0x0000FF00) >> 8));
	uart0SendChar((unsigned char)((image_size & 0x00FF0000) >> 16));
	uart0SendChar(0x00);
	cp = (unsigned char *)JPEG_BUF;
	for (i=0; i<image_size; i++) {
		while (*pPORTHIO & 0x0001) {
			continue;
		}
		uart0SendChar(*cp++);
	}

	while (uart0GetChar(&ch)) {
		// flush input 
		continue;
	}
}
Beispiel #4
0
void uart0SendString(unsigned char *s)
{
    char a;
    while ((a = *s++)) {
        uart0SendChar(a);
    }
}
Beispiel #5
0
void uart0Send(const char *buffer, uint32_t length) {
  while (length != 0) {
    uart0SendChar(*buffer);
    buffer++;
    length--;
  }
}
Beispiel #6
0
/* Dump flash buffer to serial
   Serial protocol char: z-d */
void serial_out_flashbuffer () {
  uart0SendString((unsigned char *)"##zdump: \n");
  cp = (unsigned char *)FLASH_BUFFER;
  for (i=0; i < FLASH_BUFFER_EXTENT ; i++) {
      while (*pPORTHIO & 0x0001)
          continue;
      if (*cp == 0)
          return;
      uart0SendChar(*cp++);
  }
}
Beispiel #7
0
void sntx_err(int error)
{
    char *p, *temp;
    int linecount = 1;
    int i;
    static char *e[]= {     
        "syntax error", 
        "unbalanced parentheses", 
        "no expression present",
        "equals sign expected",
        "not a variable",
        "parameter error",
        "semicolon expected",
        "unbalanced braces",
        "function undefined",
        "type specifier expected",
        "too many nested function calls",
        "return without call",
        "parentheses expected",
        "while expected",
        "closing quote expected",
        "not a string",
        "too many local variables",
    }; 
    uart0SendString(e[error]); 
    p = p_buf;
    while(p != prog) {  
        p++;
        if(*p == '\n') 
            linecount++;
    }
    uart0SendString(" in line ");
    printNumber(10, 8, FALSE, ' ', linecount);
    uart0SendChar('\n');
    temp = p;
    for(i=0; i<20 && p>p_buf && *p!='\n'; i++, p--);
    for(i=0; i<30 && p<=temp; i++, p++) uart0SendChar(*p);
}
Beispiel #8
0
/*********************************************************************************************************
** Function name:           UART0_IRQHandler
** Descriptions:            UART0ÖжϷþÎñº¯Êý
** input parameters:        none
** output parameters:       none
** Returned value:          none
** Created by:             
** Created date:            
**--------------------------------------------------------------------------------------------------------
** Modified by:             
** Modified date:           
*********************************************************************************************************/
void  UART0_IRQHandler (void)
{     
   UART0_MemMapPtr uartPtr = UART0_BASE_PTR;                            /* ·¢ËÍÖжϴ¦Àí³ÌÐò             */
   #if UART0_SEND_IRQ                                                   /* Óû§¶¨Òå                     */ 
   #endif
    
   #if UART0_RECEIVE_IRQ
    
   while (UART0_S1_REG(uartPtr) & UART0_S1_RDRF_MASK) {                 /* Çå³ýÖжϱêÖ¾                 */
       uart0SendChar(UART0_D_REG(uartPtr));                             /* ·µ»Ø½ÓÊÕÊý¾Ý                 */
//     while(!UART0_D_REG(uartPtr));                                    /* Çå½ÓÊÕ»º³åÇø                 */
   }   
   #endif
}
Beispiel #9
0
//GSM Code **********************************************
void GSM_get_data(uint16_t timeout) {
    uint8_t i;
    uint16_t x = 0;

    while (x < timeout) {
        if(UART1_available() > 0) {
            for(i=0; i<serial1Buffer_write; i++) {
                //gsm_buf[i] = serial1Buffer[i];
                uart0SendChar(serial1Buffer[i]);

                //if (gsm_buf[i] == '\r'){
                //    printf("%s", gsm_buf);
                //    return;
                //}
            }
            serial1Buffer_write = 0;
        }
        mrtDelay(1);
        x++;
    }
}
Beispiel #10
0
void print()
{
    int i;

    start_check();
    get_token();
    while(*token !=')') { 
        if(token_type==STRING) {  
            uart0SendString(token);
        } else { 
            putback();
            eval_exp(&i);
            printNumber(10, 10, FALSE, ' ', i);
        }
        get_token(); 
    } 
    uart0SendChar('\n');
    get_token();
    if(*token!=';') 
        sntx_err(SEMI_EXPECTED);
    putback();
}
Beispiel #11
0
/*********************************************************************************************************
** Function name:           uart0SendString
** Descriptions:            UART·¢ËÍÒ»¸ö×Ö·û´®
** input parameters:        pucBuf:´ý·¢ËÍ×Ö·û´®Ö¸Õë
** output parameters:       none
** Returned value:          none
** Created by:              
** Created date:            
**--------------------------------------------------------------------------------------------------------
** Modified by:             
** Modified date:           
*********************************************************************************************************/
void  uart0SendString (INT8U  *pucBuf)
{
    while (*pucBuf != '\0') { 
        uart0SendChar(*pucBuf++);
    }    
}
Beispiel #12
0
size_t HardwareSerial::write (unsigned char ch) {
    uart0SendChar(ch);
    return 1;
}
Beispiel #13
0
void print_full_block()
{
	uart0SendChar(0xE2);
	uart0SendChar(0x96);
	uart0SendChar(0x88);
}
Beispiel #14
0
void print_tennis_net()
{
	uart0SendChar(0xE2);
	uart0SendChar(0x94);
	uart0SendChar(0x8A);
}
Beispiel #15
0
/* SRV-1 Firmware Version Request
   Serial protocol char: V */
void serial_out_version () {
  uart0SendString((unsigned char *)"Version - ");
  uart0SendString((unsigned char *)version_string);
  uart0SendChar('\n');
}
Beispiel #16
0
/* Get frame count.
   Serial protocol char: f */
void serial_out_framecount () {
  uart0SendString((unsigned char *)"framecount:  ");
  printNumber(10, 8, 0, ' ', framecount);
  uart0SendChar('\n');
}
Beispiel #17
0
void uart0Send (const char *buffer, uint32_t length) {
  while (length--)
    uart0SendChar(*buffer++);
}
Beispiel #18
0
/* Get current time
   Serial protocol char: t */
void serial_out_time () {
  uart0SendString((unsigned char *)"time[ms]:  ");
  printNumber(10, 10, 0, ' ', readRTC());
  uart0SendChar('\n');
}
Beispiel #19
0
void uart0SendChars(unsigned char *buf, unsigned int size)
{
    while (size--) {
        uart0SendChar(*buf++);
    }
}