This commit is contained in:
Olaf Rempel 2008-02-04 19:00:32 +01:00
parent 26b594582f
commit 518820b1e1
2 changed files with 7 additions and 7 deletions

4
main.c
View File

@ -45,9 +45,9 @@ static uint32_t pitc_test(struct pitc_timer *timer)
printf("%ld channels: ", count); printf("%ld channels: ", count);
uint32_t j; uint32_t j;
for (j = 0; j < count; j++) for (j = 0; j < count; j++)
printf("%+4d ", rc.chan[j]); printf("%+5d ", rc.chan[j]);
printf("\n\r"); printf("\r");
return PITC_RESTART_TIMER; return PITC_RESTART_TIMER;
} }

View File

@ -19,7 +19,7 @@
#include <stdint.h> #include <stdint.h>
#include "AT91SAM7S256.h" #include "AT91SAM7S256.h"
#include "board.h" #include "board.h"
//#include "static_alloc.h" #include "static_alloc.h"
#define ALIGN(x) (((x) +3) & ~3) #define ALIGN(x) (((x) +3) & ~3)
@ -29,16 +29,16 @@ extern void * __stack_top__;
static uint32_t static_alloc_pos; static uint32_t static_alloc_pos;
void * static_alloc(uint32_t size) void * static_alloc(uint32_t size)
{ {
if (static_alloc_pos == 0) if (static_alloc_pos == 0)
static_alloc_pos = ALIGN((uint32_t)&__bss_end__); static_alloc_pos = ALIGN((uint32_t)&__bss_end__);
uint32_t retval = static_alloc_pos; uint32_t retval = static_alloc_pos;
size = ALIGN(size); size = ALIGN(size);
static_alloc_pos += size; static_alloc_pos += size;
return (void *)retval; return (void *)retval;
} }
@ -55,6 +55,6 @@ uint32_t next_powerof2(uint32_t value)
value--; value--;
for (i = 1; i < 32; i = i * 2) for (i = 1; i < 32; i = i * 2)
value |= value >> i; value |= value >> i;
return value +1; return value +1;
} }