Browse Source

blub

rtos
Olaf Rempel 12 years ago
parent
commit
518820b1e1
2 changed files with 7 additions and 7 deletions
  1. +2
    -2
      main.c
  2. +5
    -5
      src/static_alloc.c

+ 2
- 2
main.c View File

@@ -45,9 +45,9 @@ static uint32_t pitc_test(struct pitc_timer *timer)
printf("%ld channels: ", count);
uint32_t 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;
}


+ 5
- 5
src/static_alloc.c View File

@@ -19,7 +19,7 @@
#include <stdint.h>
#include "AT91SAM7S256.h"
#include "board.h"
//#include "static_alloc.h"
#include "static_alloc.h"

#define ALIGN(x) (((x) +3) & ~3)

@@ -29,16 +29,16 @@ extern void * __stack_top__;

static uint32_t static_alloc_pos;

void * static_alloc(uint32_t size)
void * static_alloc(uint32_t size)
{
if (static_alloc_pos == 0)
static_alloc_pos = ALIGN((uint32_t)&__bss_end__);
uint32_t retval = static_alloc_pos;

size = ALIGN(size);
static_alloc_pos += size;
return (void *)retval;
}

@@ -55,6 +55,6 @@ uint32_t next_powerof2(uint32_t value)
value--;
for (i = 1; i < 32; i = i * 2)
value |= value >> i;
return value +1;
}

Loading…
Cancel
Save