Skip to content

Commit

Permalink
libgrisp: Reduce stack size of libbsd tasks
Browse files Browse the repository at this point in the history
Enable a custom stack allocator which uses the internal SRAM for the
task stacks if available.
  • Loading branch information
sebhub committed Oct 4, 2018
1 parent 9677d3b commit 8b2967b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 4 additions & 3 deletions grisp-sd-sample/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@
#include <machine/rtems-bsd-commands.h>

#include <bsp.h>
#include <bsp/stackalloc.h>

#include <grisp/pin-config.h>
#include <grisp/led.h>
#include <grisp/init.h>

#define STACK_SIZE_INIT_TASK (64 * 1024)
#define STACK_SIZE_SHELL (64 * 1024)
#define STACK_SIZE_INIT_TASK (16 * 1024)
#define STACK_SIZE_SHELL (16 * 1024)

#define PRIO_SHELL 150
#define PRIO_LED_TASK (RTEMS_MAXIMUM_PRIORITY - 1)
Expand Down Expand Up @@ -186,9 +187,9 @@ Init(rtems_task_argument arg)
grisp_led_set1(false, false, false);
grisp_led_set2(true, false, false);
puts("\nGRISP RTEMS SD Demo\n");
grisp_init_sd_card();
grisp_init_lower_self_prio();
grisp_init_libbsd();
grisp_init_sd_card();

/* Wait for the SD card */
grisp_led_set2(true, false, true);
Expand Down
8 changes: 8 additions & 0 deletions libgrisp/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,11 @@ rtems_bsd_get_task_priority(const char *name)
(void)name;
return (100);
}

size_t
rtems_bsd_get_task_stack_size(const char *name)
{

(void)name;
return 8 * 1024;
}

0 comments on commit 8b2967b

Please sign in to comment.