[PATCH 1/2] Initial bsp for Tiny6410

Joel Sherrill joel.sherrill at OARcorp.com
Wed Apr 17 14:55:29 UTC 2013


On 4/17/2013 9:42 AM, Sebastian Huber wrote:
> 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.
Unless a mailer broke this, the third line needs spacing before http.

Check all.
>> + *
>> + */
>> +
>> +#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?
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985




More information about the devel mailing list