Skip to content

Commit

Permalink
Moved board and MCU -specific configurations from hardcoded scripts
Browse files Browse the repository at this point in the history
to the board-specific section of configurator
Also was made refactoring of GUI, build-scripts and garbage collection
of sources
  • Loading branch information
svhelper committed Sep 9, 2018
1 parent 72b779a commit dee80e2
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 914 deletions.
25 changes: 1 addition & 24 deletions aprinter/hal/stm32/Stm32Adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,7 @@ class Stm32Adc {
template <int...Numbers>
using AdcNumbers = MakeTypeList<WrapInt<Numbers>...>;

#if defined(STM32F205xx)
STM32ADC_DEFINE_SUBADC(AdcDef1, 1, 2, 0, 0)
STM32ADC_DEFINE_SUBADC(AdcDef2, 2, 2, 2, 1)
STM32ADC_DEFINE_SUBADC(AdcDef3, 3, 2, 1, 2)
using AdcDefList = MakeTypeList<AdcDef1, AdcDef2, AdcDef3>;
using PinDefList = MakeTypeList<
TypeDictEntry<Stm32Pin<Stm32PortA, 0>, AdcMapping<AdcNumbers<1,2,3>, 0>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 1>, AdcMapping<AdcNumbers<1,2,3>, 1>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 2>, AdcMapping<AdcNumbers<1,2,3>, 2>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 3>, AdcMapping<AdcNumbers<1,2,3>, 3>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 4>, AdcMapping<AdcNumbers<1,2>, 4>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 5>, AdcMapping<AdcNumbers<1,2>, 5>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 6>, AdcMapping<AdcNumbers<1,2>, 6>>,
TypeDictEntry<Stm32Pin<Stm32PortA, 7>, AdcMapping<AdcNumbers<1,2>, 7>>,
TypeDictEntry<Stm32Pin<Stm32PortB, 0>, AdcMapping<AdcNumbers<1,2>, 8>>,
TypeDictEntry<Stm32Pin<Stm32PortB, 1>, AdcMapping<AdcNumbers<1,2>, 9>>,
TypeDictEntry<Stm32Pin<Stm32PortC, 0>, AdcMapping<AdcNumbers<1,2,3>, 10>>,
TypeDictEntry<Stm32Pin<Stm32PortC, 1>, AdcMapping<AdcNumbers<1,2,3>, 11>>,
TypeDictEntry<Stm32Pin<Stm32PortC, 2>, AdcMapping<AdcNumbers<1,2,3>, 12>>,
TypeDictEntry<Stm32Pin<Stm32PortC, 3>, AdcMapping<AdcNumbers<1,2,3>, 13>>,
TypeDictEntry<Stm32Pin<Stm32PortC, 4>, AdcMapping<AdcNumbers<1,2>, 14>>,
TypeDictEntry<Stm32Pin<Stm32PortC, 5>, AdcMapping<AdcNumbers<1,2>, 15>>
>;
#elif defined(STM32F429xx) || defined(STM32F407xx)
#if defined(STM32F405xx) || defined(STM32F429xx) || defined(STM32F407xx)
STM32ADC_DEFINE_SUBADC(AdcDef1, 1, 2, 0, 0)
STM32ADC_DEFINE_SUBADC(AdcDef2, 2, 2, 2, 1)
STM32ADC_DEFINE_SUBADC(AdcDef3, 3, 2, 1, 2)
Expand Down
3 changes: 3 additions & 0 deletions aprinter/hal/stm32/Stm32UsbSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class Stm32UsbSerial {
private:
using TheDebugObject = DebugObject<Context, Object>;

static size_t const UsbCoreClock = (size_t)(((double)HSE_VALUE * PLL_N_VALUE) / ((double)PLL_Q_DIV_VALUE * PLL_M_VALUE));
static_assert(UsbCoreClock == 48000000, "Unable to configure USB clock using defined 'CPU core clock'");

static size_t const UsbRxBufferSize = 1024;
static_assert(UsbRxBufferSize >= CDC_DATA_HS_OUT_PACKET_SIZE, "");
static_assert(UsbRxBufferSize >= CDC_DATA_FS_OUT_PACKET_SIZE, "");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
******************************************************************************
* @file startup_stm32f429xx.s
* @file startup_stm32.s
* @author MCD Application Team
* @version V2.5.1
* @date 28-June-2016
Expand Down Expand Up @@ -44,8 +44,9 @@
*/

.syntax unified
.cpu cortex-m4
.fpu softvfp
/* Use command line args for genetartion of code */
/* .cpu cortex-m4 */
/* .fpu softvfp */
.thumb

.global g_pfnVectors
Expand Down
Loading

0 comments on commit dee80e2

Please sign in to comment.