1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

added platform_pd_cpu_name(), platform_pio_get_prefix() plus a few optimizations

This commit is contained in:
Bogdan Marinescu 2008-08-02 17:48:10 +00:00
parent a3a9862687
commit bc1f5c36b8

View File

@ -8,6 +8,7 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
// Platform specific includes
#include "hw_ints.h"
@ -37,7 +38,7 @@ static int uart_recv()
// ****************************************************************************
// Platform initialization
static u32 timer_base[] = { TIMER0_BASE, TIMER1_BASE, TIMER2_BASE, TIMER3_BASE };
static const u32 timer_base[] = { TIMER0_BASE, TIMER1_BASE, TIMER2_BASE, TIMER3_BASE };
int platform_init()
{
@ -92,6 +93,14 @@ int platform_pio_has_port( unsigned port )
return port <= 6;
}
const char* platform_pio_get_prefix( unsigned port )
{
static char c[ 3 ];
sprintf( c, "P%c", ( char )( port + 'A' ) );
return c;
}
int platform_pio_has_pin( unsigned port, unsigned pin )
{
if( port <= 3 )
@ -343,6 +352,11 @@ const char* platform_pd_get_name()
return "LM3S";
}
const char* platform_pd_cpu_name()
{
return "LM3S8962";
}
u32 platform_pd_get_cpu_frequency()
{
return SysCtlClockGet();