Changed board variants to use calculate value from F_CPU for CYCLES_PER_MICROSECOND

This commit is contained in:
Roger Clark 2017-05-26 16:22:16 +10:00
parent 66579ef8ef
commit f2c2323afd
12 changed files with 14 additions and 13 deletions

View File

@ -38,7 +38,8 @@
#define CYCLES_PER_MICROSECOND 24
//#define CYCLES_PER_MICROSECOND 24
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
//#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define SYSTICK_RELOAD_VAL 23999 /* takes a cycle to reload */

View File

@ -36,7 +36,7 @@
#ifndef _BOARD_GENERIC_STM32F103C_H_
#define _BOARD_GENERIC_STM32F103C_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_NR_USARTS 3

View File

@ -36,7 +36,7 @@
#ifndef _BOARD_GENERIC_STM32F103C_H_
#define _BOARD_GENERIC_STM32F103C_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_NR_USARTS 3

View File

@ -36,7 +36,7 @@
#ifndef _BOARD_GENERIC_STM32F103R8_H_
#define _BOARD_GENERIC_STM32F103R8_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_NR_USARTS 3

View File

@ -36,7 +36,7 @@
#ifndef _BOARD_GENERIC_STM32F103T_H_
#define _BOARD_GENERIC_STM32F103T_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_NR_USARTS 2

View File

@ -38,7 +38,7 @@
/* A few of these values will seem strange given that it's a
* high-density board. */
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_BUTTON_PIN PC0

View File

@ -36,7 +36,7 @@
#ifndef _BOARD_GENERIC_STM32F103C_H_
#define _BOARD_GENERIC_STM32F103C_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_NR_USARTS 2

View File

@ -34,7 +34,7 @@
#define _BOARD_MAPLE_H_
/* 72 MHz -> 72 cycles per microsecond. */
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
/* Roger clark

View File

@ -36,7 +36,7 @@
#ifndef _BOARD_MAPLE_MINI_H_
#define _BOARD_MAPLE_MINI_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
#define BOARD_NR_USARTS 3

View File

@ -37,7 +37,7 @@
#ifndef _BOARD_MICRODUINO_STM32_H_
#define _BOARD_MICRODUINO_STM32_H_
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
/* Roger Clark.

View File

@ -33,7 +33,7 @@
#ifndef _BOARD_MAPLE_H_
#define _BOARD_MAPLE_H_
#define _BOARD_NUCLEOF103RB_ 1 // hack for HardwareSerial.cpp for a new order of serials
#define CYCLES_PER_MICROSECOND 72
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
/* Roger clark. Removed defines for LED pin and Button pin as they are not Arduino API defines */

View File

@ -38,8 +38,8 @@
#include <libmaple/stm32.h>
#define CYCLES_PER_MICROSECOND 72
#define SYSTICK_RELOAD_VAL 71999 /* takes a cycle to reload */
#define CYCLES_PER_MICROSECOND (F_CPU / 1000000U)
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
enum {
PC13, PC14, PC15,