From 38bbd38d14ca800f02c163c5be0ad274eb41f3a5 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 18 Feb 2013 16:32:21 +0900 Subject: [PATCH] Update boards/STM32_PRIMER2 for newer ChibiOS/RT --- ChangeLog | 1 + boards/STM32_PRIMER2/board.c | 10 ++++------ boards/STM32_PRIMER2/board.h | 14 ++++++++++++++ boards/STM32_PRIMER2/mcuconf.h | 6 +++--- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01dd072..cf99f94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ * boards/OLIMEX_STM32_H103/*: Likewise. * boards/STBEE/*: Likewise. * boards/STBEE_MINI/*: Likewise. + * boards/STM32_PRIMER2/*: Likewise. Merge ec_p256 branch. * src/Makefile.in: Add ECC files. diff --git a/boards/STM32_PRIMER2/board.c b/boards/STM32_PRIMER2/board.c index 83a288b..8e63b4c 100644 --- a/boards/STM32_PRIMER2/board.c +++ b/boards/STM32_PRIMER2/board.c @@ -2,13 +2,11 @@ #include "ch.h" #include "hal.h" -#include "../common/hwinit.c" - -void -hwinit1(void) +/* + * Board-specific initialization code. + */ +void boardInit(void) { - hwinit1_common (); - /* * Clear LED and SHUTDOWN output. */ diff --git a/boards/STM32_PRIMER2/board.h b/boards/STM32_PRIMER2/board.h index 0991242..22e6bf9 100644 --- a/boards/STM32_PRIMER2/board.h +++ b/boards/STM32_PRIMER2/board.h @@ -37,6 +37,8 @@ #define GPIO_LED GPIOE_LEDR #define IOPORT_LED GPIOE +/* NeuG settings for ADC2. */ + /* * Board identifier. */ @@ -91,6 +93,8 @@ /* * Port A setup. * Everything input with pull-up except: + * PA0 - Digital input with PullUp. AN0 + * PA1 - Digital input with PullUp. AN1 * PA2 - Alternate output (USART2 TX). * PA3 - Normal input (USART2 RX). * PA8 - Input with pull-down (PBUTTON). @@ -158,4 +162,14 @@ #define VAL_GPIOGODR 0xFFFFFFFF #endif +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + #endif /* _BOARD_H_ */ diff --git a/boards/STM32_PRIMER2/mcuconf.h b/boards/STM32_PRIMER2/mcuconf.h index 449e5c8..dde70a6 100644 --- a/boards/STM32_PRIMER2/mcuconf.h +++ b/boards/STM32_PRIMER2/mcuconf.h @@ -7,8 +7,8 @@ #define STM32_PLLMUL_VALUE 12 #define STM32_HPRE STM32_HPRE_DIV1 #define STM32_PPRE1 STM32_PPRE1_DIV2 -#define STM32_PPRE2 STM32_PPRE2_DIV2 -#define STM32_ADCPRE STM32_ADCPRE_DIV4 -#define STM32_MCO STM32_MCO_NOCLOCK +#define STM32_PPRE2 STM32_PPRE2_DIV1 +#define STM32_ADCPRE STM32_ADCPRE_DIV6 +#define STM32_RTCSEL STM32_RTCSEL_NOCLOCK #include "mcuconf-common.h"