[PATCH 1/2] Initial bsp for Tiny6410
Peng Fan
van.freenix at gmail.com
Wed Apr 17 15:10:39 UTC 2013
Thanks.
I will recheck the code carefully.
Regards,
Peng.
2013/4/17 Joel Sherrill <joel.sherrill at oarcorp.com>
> 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<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
>
>
> ______________________________**_________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/**listinfo/rtems-devel<http://www.rtems.org/mailman/listinfo/rtems-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130417/8ea0f096/attachment-0001.html>
More information about the devel
mailing list