[PATCH 1/2] Initial bsp for Tiny6410

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Apr 17 14:42:28 UTC 2013


On 04/17/2013 02:54 PM, Peng Fan wrote:
> diff --git a/c/src/lib/libbsp/arm/tiny6410/debug/debug.c b/c/src/lib/libbsp/arm/tiny6410/debug/debug.c
> new file mode 100644
> index 0000000..a57e4c9
> --- /dev/null
> +++ b/c/src/lib/libbsp/arm/tiny6410/debug/debug.c
> @@ -0,0 +1,57 @@
> +/*
> + *  Low level debug function
> + *
> + *  Copyright (c) 2013 by PengFan<van.freenix at gmail.com>
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *http://www.rtems.com/license/LICENSE.
> + *
> + */
> +
> +#include <bsp.h>
> +#include <s3c64xx.h>
> +void debug_led(uint32_t val)
> +{
> +	uint32_t *addr = (uint32_t *)0x7f008800;
> +	*addr = val;
> +}
> +
> +
> +static void Delay(void)
> +{
> +    volatile int i;
> +
> +    for(i=0 ; i < 1000 ; i++)
> +    {
> +    }
> +}
> +
> +void Uart_SendByte(int data)
> +{
> +    while(!(rUTRSTAT0 & 0x2));   //Wait until THR is empty.
> +    Delay();
> +    rUTXH0 = (unsigned char)data;
> +}
> +
> +void Uart_SendString(char *pt)
> +{
> +    while(*pt)
> +        Uart_SendByte(*pt++);
> +    Uart_SendByte('\r');
> +    Uart_SendByte('\n');
> +}
> +
> +void printhex(unsigned int data)
> +{
> +	int i = 0,a = 0;
> +	for (i = 0; i < 8; i++) {
> +		a = (data>>(32-(i+1)*4))&0xf;
> +		if (((a<=9)&&(a>=0)))
> +			Uart_SendByte(a + 0x30);
> +		else if ((a <= 0xf) && (a >= 0xa))
> +			Uart_SendByte(a-0xa+0x61);
> +	}
> +	Uart_SendByte('\r');
> +	Uart_SendByte('\n');
> +}

Can't you use printk() for this?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list