diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-19 06:28:01 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 13:08:32 +0200 |
commit | d7d66d7d4523b904c8ccc6aea3709dc0d5aa5bdc (patch) | |
tree | caa54b4229e86a68c84ab5961af34e087dce5302 /bsps/arm/atsam/console/debug-console.c | |
parent | bsps/powerpc: Move shared btimer support (diff) | |
download | rtems-d7d66d7d4523b904c8ccc6aea3709dc0d5aa5bdc.tar.bz2 |
bsps: Move console drivers to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'bsps/arm/atsam/console/debug-console.c')
-rw-r--r-- | bsps/arm/atsam/console/debug-console.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/bsps/arm/atsam/console/debug-console.c b/bsps/arm/atsam/console/debug-console.c new file mode 100644 index 0000000000..a405fe9665 --- /dev/null +++ b/bsps/arm/atsam/console/debug-console.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2016 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include <rtems/bspIo.h> +#include <rtems/sysinit.h> + +#include <bsp/atsam-clock-config.h> +#include <chip.h> +#include <include/dbg_console.h> + +static void atsam_debug_console_out(char c) +{ + DBG_PutChar((uint8_t) c); +} + +static void atsam_debug_console_init(void) +{ + DBG_Configure(115200, BOARD_MCK); + BSP_output_char = atsam_debug_console_out; +} + +static void atsam_debug_console_early_init(char c) +{ + atsam_debug_console_init(); + atsam_debug_console_out(c); +} + +static int atsam_debug_console_in(void) +{ + return (int) DBG_GetChar(); +} + +BSP_output_char_function_type BSP_output_char = atsam_debug_console_early_init; + +BSP_polling_getchar_function_type BSP_poll_char = atsam_debug_console_in; + +RTEMS_SYSINIT_ITEM( + atsam_debug_console_init, + RTEMS_SYSINIT_BSP_START, + RTEMS_SYSINIT_ORDER_LAST +); |