source: rtems/c/src/lib/libbsp/arm/atsam/console/debug-console.c @ ad76eb32

5
Last change on this file since ad76eb32 was f2e0f8e, checked in by Sebastian Huber <sebastian.huber@…>, on Jan 14, 2016 at 3:03:51 PM

bsp/atsam: New

Close #2529.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <rtems/bspIo.h>
16#include <rtems/sysinit.h>
17
18#include <chip.h>
19#include <include/dbg_console.h>
20
21static void atsam_debug_console_out(char c)
22{
23  if (c == '\n') {
24    DBG_PutChar('\r');
25  }
26
27  DBG_PutChar((uint8_t) c);
28}
29
30static void atsam_debug_console_init(void)
31{
32  DBG_Configure(115200, BOARD_MCK);
33  BSP_output_char = atsam_debug_console_out;
34}
35
36static void atsam_debug_console_early_init(char c)
37{
38  atsam_debug_console_init();
39  atsam_debug_console_out(c);
40}
41
42static int atsam_debug_console_in(void)
43{
44  return (int) DBG_GetChar();
45}
46
47BSP_output_char_function_type BSP_output_char = atsam_debug_console_early_init;
48
49BSP_polling_getchar_function_type BSP_poll_char = atsam_debug_console_in;
50
51RTEMS_SYSINIT_ITEM(
52  atsam_debug_console_init,
53  RTEMS_SYSINIT_BSP_START,
54  RTEMS_SYSINIT_ORDER_LAST
55);
Note: See TracBrowser for help on using the repository browser.