Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • avn/swd/skyward-boardcore
  • emilio.corigliano/skyward-boardcore
  • nicolo.caruso/skyward-boardcore
  • ettore.pane/skyward-boardcore
  • giulia.facchi/skyward-boardcore
  • valerio.flamminii/skyward-boardcore
6 results
Show changes
Commits on Source (23)
Showing
with 161 additions and 111 deletions
{ BasedOnStyle: Google
BasedOnStyle: Google,
AccessModifierOffset: -4, ColumnLimit: 80
AlignConsecutiveAssignments: true, IndentWidth: 4
AllowShortIfStatementsOnASingleLine: false, AccessModifierOffset: -4
AllowShortLoopsOnASingleLine: false,
BreakBeforeBraces: Allman, BreakBeforeBraces: Allman
ColumnLimit: 80, # Allow braceless single line if/else/for/while statements
ConstructorInitializerAllOnOneLineOrOnePerLine: false, RemoveBracesLLVM: true
IndentCaseLabels: true,
IndentWidth: 4, AlignConsecutiveAssignments: Consecutive
KeepEmptyLinesAtTheStartOfBlocks: true, AllowShortIfStatementsOnASingleLine: false
} AllowShortLoopsOnASingleLine: false
PackConstructorInitializers: BinPack
IndentCaseLabels: true
# Empty lines behavior
InsertNewlineAtEOF: true
KeepEmptyLinesAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
# Align pointers/references to the type, not the variable
DerivePointerAlignment: false
PointerAlignment: Left
...@@ -23,7 +23,7 @@ variables: ...@@ -23,7 +23,7 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
default: default:
image: registry.skywarder.eu/avn/swd/docker/miosix:latest image: registry.skywarder.eu/avn/swd/docker/miosix:v2
stages: stages:
- lint - lint
......
...@@ -571,6 +571,29 @@ ...@@ -571,6 +571,29 @@
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/stm32f769ni_discovery", "${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM7_stm32f7/stm32f769ni_discovery",
"${workspaceFolder}/libs/miosix-kernel/miosix/config/arch/cortexM7_stm32f7/stm32f769ni_discovery" "${workspaceFolder}/libs/miosix-kernel/miosix/config/arch/cortexM7_stm32f7/stm32f769ni_discovery"
] ]
},
{
"name": "stm32f429zi_lyra_cubesat",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerPath": "/opt/arm-miosix-eabi/bin/arm-miosix-eabi-g++",
"defines": [
"${defaultDefines}",
"_MIOSIX_BOARDNAME=stm32f429zi_lyra_cubesat",
"_BOARD_STM32F429ZI_LYRA_CUBESAT",
"_ARCH_CORTEXM4_STM32F4",
"STM32F429xx",
"HSE_VALUE=8000000",
"SYSCLK_FREQ_168MHz=168000000",
"__ENABLE_XRAM",
"V_DDA_VOLTAGE=3.3f"
],
"includePath": [
"${defaultIncludePaths}",
"${workspaceFolder}/libs/miosix-kernel/miosix/arch/cortexM4_stm32f4/common",
"${workspaceFolder}/src/bsps/stm32f429zi_lyra_cubesat/config",
"${workspaceFolder}/src/bsps/stm32f429zi_lyra_cubesat"
]
} }
], ],
"version": 4 "version": 4
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
enable_testing() enable_testing()
include(cmake/sbs.cmake)
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# Project # # Project #
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
project(Boardcore) project(Boardcore)
include(cmake/sbs.cmake)
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# Entrypoints # # Entrypoints #
......
...@@ -29,11 +29,17 @@ The project is built with the CMake build system. We also have our own script th ...@@ -29,11 +29,17 @@ The project is built with the CMake build system. We also have our own script th
### Dependencies ### Dependencies
The following are required to build the project:
* `CMake` 3.25 * `CMake` 3.25
* `Git` * `Git`
* `Miosix` Toolchain * `Miosix` Toolchain
We also recommend to install `Ccache`, `Ninja`, `OpenOCD`, `Cppcheck`,`ClangFormat` and `pre-commit` for a smoother development experience. You will also need the following tools for linting and formatting:
* `Python3`
* `Cppcheck 2.7`
* `ClangFormat 18`
We also recommend to install `Ccache`, `Ninja`, `OpenOCD`, and `pre-commit` for a smoother development experience.
### Cloning the repo ### Cloning the repo
......
...@@ -41,4 +41,5 @@ set(BOARDCORE_BOARDS_OPTIONS_FILES ...@@ -41,4 +41,5 @@ set(BOARDCORE_BOARDS_OPTIONS_FILES
${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_biscotto/config/board_options.cmake ${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_biscotto/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_motor/config/board_options.cmake ${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_motor/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_gs/config/board_options.cmake ${BOARDCORE_PATH}/src/bsps/stm32f767zi_lyra_gs/config/board_options.cmake
${BOARDCORE_PATH}/src/bsps/stm32f429zi_lyra_cubesat/config/board_options.cmake
) )
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
enable_language(C CXX ASM) enable_language(C CXX ASM)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Load in SBS_BASE the project path # Load in SBS_BASE the project path
cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH SBS_BASE) cmake_path(GET CMAKE_CURRENT_LIST_DIR PARENT_PATH SBS_BASE)
......
...@@ -58,6 +58,13 @@ VERBOSE_FILENAME=".sbs_verbose" ...@@ -58,6 +58,13 @@ VERBOSE_FILENAME=".sbs_verbose"
BUILD_DEFAULT_DIRNAME="build" BUILD_DEFAULT_DIRNAME="build"
BUILD_HOST_DIRNAME="build-host" BUILD_HOST_DIRNAME="build-host"
# Logical cores count, cross platform
N_PROC=$(
nproc 2>/dev/null || # Linux
sysctl -n hw.logicalcpu 2>/dev/null || # macOS
getconf _NPROCESSORS_ONLN 2>/dev/null # POSIX
)
################################################################################ ################################################################################
############################## Global States ############################## ############################## Global States ##############################
################################################################################ ################################################################################
...@@ -378,7 +385,7 @@ build_impl() { ...@@ -378,7 +385,7 @@ build_impl() {
declare opts declare opts
get_build_opts opts $jobs get_build_opts opts $jobs
cmake --build "$build_dir" "${opts[@]}" --target "$target" cmake --build "$build_dir" --target "$target" "${opts[@]}"
} }
flash_impl() { flash_impl() {
...@@ -465,7 +472,7 @@ lint_clangformat() { ...@@ -465,7 +472,7 @@ lint_clangformat() {
# count files and spread them evenly across cores: files / nproc + 1 # count files and spread them evenly across cores: files / nproc + 1
declare files_per_proc=$( declare files_per_proc=$(
echo "$files" | wc -l | \ echo "$files" | wc -l | \
xargs -I {} bash -c "expr \( {} / $(nproc) \) + 1" xargs -I {} bash -c "expr \( {} / $N_PROC \) + 1"
) )
echo "$files" | xargs -n $files_per_proc -P 0 clang-format "${opts[@]}" echo "$files" | xargs -n $files_per_proc -P 0 clang-format "${opts[@]}"
...@@ -750,7 +757,7 @@ format() { ...@@ -750,7 +757,7 @@ format() {
# count files and spread them evenly across cores: files / nproc + 1 # count files and spread them evenly across cores: files / nproc + 1
declare files_per_proc=$( declare files_per_proc=$(
echo "$files" | wc -l | \ echo "$files" | wc -l | \
xargs -I {} bash -c "expr \( {} / $(nproc) \) + 1" xargs -I {} bash -c "expr \( {} / $N_PROC \) + 1"
) )
echo "$files" | xargs -n $files_per_proc -P 0 clang-format "${opts[@]}" echo "$files" | xargs -n $files_per_proc -P 0 clang-format "${opts[@]}"
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
// The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never // The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never
// defined when compiling the code. // defined when compiling the code.
#ifndef PARSING_FROM_IDE #ifndef PARSING_FROM_IDE
//#error This error is a reminder that you have not edited miosix_settings.h // #error This error is a reminder that you have not edited miosix_settings.h
// yet. // yet.
#endif // PARSING_FROM_IDE #endif // PARSING_FROM_IDE
/** /**
......
...@@ -54,11 +54,11 @@ void program_startup() ...@@ -54,11 +54,11 @@ void program_startup()
extern unsigned char _bss_end asm("_bss_end"); extern unsigned char _bss_end asm("_bss_end");
// Initialize .data section, clear .bss section // Initialize .data section, clear .bss section
unsigned char *etext = &_etext; unsigned char* etext = &_etext;
unsigned char *data = &_data; unsigned char* data = &_data;
unsigned char *edata = &_edata; unsigned char* edata = &_edata;
unsigned char *bss_start = &_bss_start; unsigned char* bss_start = &_bss_start;
unsigned char *bss_end = &_bss_end; unsigned char* bss_end = &_bss_end;
// The memcpy is usually enclosed in an #ifndef __ENABLE_XRAM, in other // The memcpy is usually enclosed in an #ifndef __ENABLE_XRAM, in other
// boards but in this case it is not, since the *_code_in_xram.ld linker // boards but in this case it is not, since the *_code_in_xram.ld linker
// script puts code in XRAM, but data in the internal one, so there's still // script puts code in XRAM, but data in the internal one, so there's still
......
...@@ -67,42 +67,41 @@ void IRQbspInit() ...@@ -67,42 +67,41 @@ void IRQbspInit()
GPIOD->OSPEEDR = 0xaaaaaaaa; GPIOD->OSPEEDR = 0xaaaaaaaa;
using namespace interfaces; using namespace interfaces;
spi1::cs::mode(Mode::OUTPUT); spi1::cs::mode(Mode::OUTPUT);
spi1::cs::high(); spi1::cs::high();
spi1::sck::mode(Mode::ALTERNATE);
spi1::sck::alternateFunction(5); spi1::sck::alternateFunction(5);
spi1::miso::mode(Mode::ALTERNATE); spi1::sck::mode(Mode::ALTERNATE);
spi1::miso::alternateFunction(5); spi1::miso::alternateFunction(5);
spi1::mosi::mode(Mode::ALTERNATE); spi1::miso::mode(Mode::ALTERNATE);
spi1::mosi::alternateFunction(5); spi1::mosi::alternateFunction(5);
spi1::mosi::mode(Mode::ALTERNATE);
spi2::sck::mode(Mode::ALTERNATE);
spi2::sck::alternateFunction(5); spi2::sck::alternateFunction(5);
spi2::miso::mode(Mode::ALTERNATE); spi2::sck::mode(Mode::ALTERNATE);
spi2::miso::alternateFunction(5); spi2::miso::alternateFunction(5);
spi2::mosi::mode(Mode::ALTERNATE); spi2::miso::mode(Mode::ALTERNATE);
spi2::mosi::alternateFunction(5); spi2::mosi::alternateFunction(5);
spi2::mosi::mode(Mode::ALTERNATE);
usart1::rx::mode(Mode::ALTERNATE);
usart1::rx::alternateFunction(7); usart1::rx::alternateFunction(7);
usart1::tx::mode(Mode::ALTERNATE); usart1::rx::mode(Mode::ALTERNATE);
usart1::tx::alternateFunction(7); usart1::tx::alternateFunction(7);
usart1::tx::mode(Mode::ALTERNATE);
usart2::rx::mode(Mode::ALTERNATE);
usart2::rx::alternateFunction(7); usart2::rx::alternateFunction(7);
usart2::tx::mode(Mode::ALTERNATE); usart2::rx::mode(Mode::ALTERNATE);
usart2::tx::alternateFunction(7); usart2::tx::alternateFunction(7);
usart2::tx::mode(Mode::ALTERNATE);
usart3::rx::mode(Mode::ALTERNATE);
usart3::rx::alternateFunction(7); usart3::rx::alternateFunction(7);
usart3::tx::mode(Mode::ALTERNATE); usart3::rx::mode(Mode::ALTERNATE);
usart3::tx::alternateFunction(7); usart3::tx::alternateFunction(7);
usart3::tx::mode(Mode::ALTERNATE);
can1::rx::mode(Mode::ALTERNATE);
can1::rx::alternateFunction(9); can1::rx::alternateFunction(9);
can1::tx::mode(Mode::ALTERNATE); can1::rx::mode(Mode::ALTERNATE);
can1::tx::alternateFunction(9); can1::tx::alternateFunction(9);
can1::tx::mode(Mode::ALTERNATE);
using namespace devices; using namespace devices;
...@@ -124,8 +123,8 @@ void IRQbspInit() ...@@ -124,8 +123,8 @@ void IRQbspInit()
buttons::bypass::mode(Mode::INPUT); buttons::bypass::mode(Mode::INPUT);
buttons::record::mode(Mode::INPUT); buttons::record::mode(Mode::INPUT);
buzzer::drive::mode(Mode::ALTERNATE);
buzzer::drive::alternateFunction(3); buzzer::drive::alternateFunction(3);
buzzer::drive::mode(Mode::ALTERNATE);
leds::led1::mode(Mode::OUTPUT); leds::led1::mode(Mode::OUTPUT);
leds::led1::low(); leds::led1::low();
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
// The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never // The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never
// defined when compiling the code. // defined when compiling the code.
#ifndef PARSING_FROM_IDE #ifndef PARSING_FROM_IDE
//#error This error is a reminder that you have not edited miosix_settings.h // #error This error is a reminder that you have not edited miosix_settings.h
// yet. // yet.
#endif // PARSING_FROM_IDE #endif // PARSING_FROM_IDE
/** /**
...@@ -70,14 +70,14 @@ namespace miosix ...@@ -70,14 +70,14 @@ namespace miosix
// Uncomment only *one* of those // Uncomment only *one* of those
#define SCHED_TYPE_PRIORITY #define SCHED_TYPE_PRIORITY
//#define SCHED_TYPE_CONTROL_BASED // #define SCHED_TYPE_CONTROL_BASED
//#define SCHED_TYPE_EDF // #define SCHED_TYPE_EDF
/// \def WITH_CPU_TIME_COUNTER /// \def WITH_CPU_TIME_COUNTER
/// Allows to enable/disable CPUTimeCounter to save code size and remove its /// Allows to enable/disable CPUTimeCounter to save code size and remove its
/// overhead from the scheduling process. By default it is not defined /// overhead from the scheduling process. By default it is not defined
/// (CPUTimeCounter is disabled). /// (CPUTimeCounter is disabled).
//#define WITH_CPU_TIME_COUNTER // #define WITH_CPU_TIME_COUNTER
// //
// Filesystem options // Filesystem options
...@@ -110,7 +110,7 @@ const unsigned char MAX_OPEN_FILES = 8; ...@@ -110,7 +110,7 @@ const unsigned char MAX_OPEN_FILES = 8;
/// This enables the dynamic loader to load elf programs, the extended system /// This enables the dynamic loader to load elf programs, the extended system
/// call service and, if the hardware supports it, the MPU to provide memory /// call service and, if the hardware supports it, the MPU to provide memory
/// isolation of processes /// isolation of processes
//#define WITH_PROCESSES // #define WITH_PROCESSES
#if defined(WITH_PROCESSES) && defined(__NO_EXCEPTIONS) #if defined(WITH_PROCESSES) && defined(__NO_EXCEPTIONS)
#error Processes require C++ exception support #error Processes require C++ exception support
...@@ -145,7 +145,7 @@ const unsigned char MAX_OPEN_FILES = 8; ...@@ -145,7 +145,7 @@ const unsigned char MAX_OPEN_FILES = 8;
/// \def WITH_DEEP_SLEEP /// \def WITH_DEEP_SLEEP
/// Adds interfaces and required variables to support deep sleep state switch /// Adds interfaces and required variables to support deep sleep state switch
/// automatically when peripherals are not required /// automatically when peripherals are not required
//#define WITH_DEEP_SLEEP // #define WITH_DEEP_SLEEP
/** /**
* \def JTAG_DISABLE_SLEEP * \def JTAG_DISABLE_SLEEP
......
...@@ -55,11 +55,11 @@ void program_startup() ...@@ -55,11 +55,11 @@ void program_startup()
extern unsigned char _bss_end asm("_bss_end"); extern unsigned char _bss_end asm("_bss_end");
// Initialize .data section, clear .bss section // Initialize .data section, clear .bss section
unsigned char *etext = &_etext; unsigned char* etext = &_etext;
unsigned char *data = &_data; unsigned char* data = &_data;
unsigned char *edata = &_edata; unsigned char* edata = &_edata;
unsigned char *bss_start = &_bss_start; unsigned char* bss_start = &_bss_start;
unsigned char *bss_end = &_bss_end; unsigned char* bss_end = &_bss_end;
memcpy(data, etext, edata - data); memcpy(data, etext, edata - data);
memset(bss_start, 0, bss_end - bss_start); memset(bss_start, 0, bss_end - bss_start);
......
...@@ -213,12 +213,12 @@ void IRQbspInit() ...@@ -213,12 +213,12 @@ void IRQbspInit()
RCC_SYNC(); RCC_SYNC();
// Initialize everything // Initialize everything
interfaces::spi1::sck::mode(Mode::ALTERNATE);
interfaces::spi1::sck::alternateFunction(5); interfaces::spi1::sck::alternateFunction(5);
interfaces::spi1::miso::mode(Mode::ALTERNATE); interfaces::spi1::sck::mode(Mode::ALTERNATE);
interfaces::spi1::miso::alternateFunction(5); interfaces::spi1::miso::alternateFunction(5);
interfaces::spi1::mosi::mode(Mode::ALTERNATE); interfaces::spi1::miso::mode(Mode::ALTERNATE);
interfaces::spi1::mosi::alternateFunction(5); interfaces::spi1::mosi::alternateFunction(5);
interfaces::spi1::mosi::mode(Mode::ALTERNATE);
btns::n2o_filling::mode(Mode::INPUT); btns::n2o_filling::mode(Mode::INPUT);
btns::n2o_release::mode(Mode::INPUT); btns::n2o_release::mode(Mode::INPUT);
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
// The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never // The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never
// defined when compiling the code. // defined when compiling the code.
#ifndef PARSING_FROM_IDE #ifndef PARSING_FROM_IDE
//#error This error is a reminder that you have not edited miosix_settings.h // #error This error is a reminder that you have not edited miosix_settings.h
// yet. // yet.
#endif // PARSING_FROM_IDE #endif // PARSING_FROM_IDE
/** /**
...@@ -70,14 +70,14 @@ namespace miosix ...@@ -70,14 +70,14 @@ namespace miosix
// Uncomment only *one* of those // Uncomment only *one* of those
#define SCHED_TYPE_PRIORITY #define SCHED_TYPE_PRIORITY
//#define SCHED_TYPE_CONTROL_BASED // #define SCHED_TYPE_CONTROL_BASED
//#define SCHED_TYPE_EDF // #define SCHED_TYPE_EDF
/// \def WITH_CPU_TIME_COUNTER /// \def WITH_CPU_TIME_COUNTER
/// Allows to enable/disable CPUTimeCounter to save code size and remove its /// Allows to enable/disable CPUTimeCounter to save code size and remove its
/// overhead from the scheduling process. By default it is not defined /// overhead from the scheduling process. By default it is not defined
/// (CPUTimeCounter is disabled). /// (CPUTimeCounter is disabled).
//#define WITH_CPU_TIME_COUNTER // #define WITH_CPU_TIME_COUNTER
// //
// Filesystem options // Filesystem options
...@@ -110,7 +110,7 @@ const unsigned char MAX_OPEN_FILES = 8; ...@@ -110,7 +110,7 @@ const unsigned char MAX_OPEN_FILES = 8;
/// This enables the dynamic loader to load elf programs, the extended system /// This enables the dynamic loader to load elf programs, the extended system
/// call service and, if the hardware supports it, the MPU to provide memory /// call service and, if the hardware supports it, the MPU to provide memory
/// isolation of processes /// isolation of processes
//#define WITH_PROCESSES // #define WITH_PROCESSES
#if defined(WITH_PROCESSES) && defined(__NO_EXCEPTIONS) #if defined(WITH_PROCESSES) && defined(__NO_EXCEPTIONS)
#error Processes require C++ exception support #error Processes require C++ exception support
...@@ -145,7 +145,7 @@ const unsigned char MAX_OPEN_FILES = 8; ...@@ -145,7 +145,7 @@ const unsigned char MAX_OPEN_FILES = 8;
/// \def WITH_DEEP_SLEEP /// \def WITH_DEEP_SLEEP
/// Adds interfaces and required variables to support deep sleep state switch /// Adds interfaces and required variables to support deep sleep state switch
/// automatically when peripherals are not required /// automatically when peripherals are not required
//#define WITH_DEEP_SLEEP // #define WITH_DEEP_SLEEP
/** /**
* \def JTAG_DISABLE_SLEEP * \def JTAG_DISABLE_SLEEP
......
...@@ -55,11 +55,11 @@ void program_startup() ...@@ -55,11 +55,11 @@ void program_startup()
extern unsigned char _bss_end asm("_bss_end"); extern unsigned char _bss_end asm("_bss_end");
// Initialize .data section, clear .bss section // Initialize .data section, clear .bss section
unsigned char *etext = &_etext; unsigned char* etext = &_etext;
unsigned char *data = &_data; unsigned char* data = &_data;
unsigned char *edata = &_edata; unsigned char* edata = &_edata;
unsigned char *bss_start = &_bss_start; unsigned char* bss_start = &_bss_start;
unsigned char *bss_end = &_bss_end; unsigned char* bss_end = &_bss_end;
memcpy(data, etext, edata - data); memcpy(data, etext, edata - data);
memset(bss_start, 0, bss_end - bss_start); memset(bss_start, 0, bss_end - bss_start);
......
...@@ -327,19 +327,19 @@ void IRQbspInit() ...@@ -327,19 +327,19 @@ void IRQbspInit()
#endif //__ENABLE_XRAM #endif //__ENABLE_XRAM
using namespace interfaces; using namespace interfaces;
spi1::sck::mode(Mode::ALTERNATE);
spi1::sck::alternateFunction(5); spi1::sck::alternateFunction(5);
spi1::miso::mode(Mode::ALTERNATE); spi1::sck::mode(Mode::ALTERNATE);
spi1::miso::alternateFunction(5); spi1::miso::alternateFunction(5);
spi1::mosi::mode(Mode::ALTERNATE); spi1::miso::mode(Mode::ALTERNATE);
spi1::mosi::alternateFunction(5); spi1::mosi::alternateFunction(5);
spi1::mosi::mode(Mode::ALTERNATE);
spi2::sck::mode(Mode::ALTERNATE);
spi2::sck::alternateFunction(5); spi2::sck::alternateFunction(5);
spi2::miso::mode(Mode::ALTERNATE); spi2::sck::mode(Mode::ALTERNATE);
spi2::miso::alternateFunction(5); spi2::miso::alternateFunction(5);
spi2::mosi::mode(Mode::ALTERNATE); spi2::miso::mode(Mode::ALTERNATE);
spi2::mosi::alternateFunction(5); spi2::mosi::alternateFunction(5);
spi2::mosi::mode(Mode::ALTERNATE);
// Software I2C // Software I2C
i2c::scl::high(); i2c::scl::high();
...@@ -347,21 +347,21 @@ void IRQbspInit() ...@@ -347,21 +347,21 @@ void IRQbspInit()
i2c::sda::high(); i2c::sda::high();
i2c::sda::mode(Mode::OPEN_DRAIN); i2c::sda::mode(Mode::OPEN_DRAIN);
uart4::rx::mode(Mode::ALTERNATE);
uart4::rx::alternateFunction(8); uart4::rx::alternateFunction(8);
uart4::tx::mode(Mode::ALTERNATE); uart4::rx::mode(Mode::ALTERNATE);
uart4::tx::alternateFunction(8); uart4::tx::alternateFunction(8);
uart4::tx::mode(Mode::ALTERNATE);
can::rx::mode(Mode::ALTERNATE);
can::rx::alternateFunction(9); can::rx::alternateFunction(9);
can::tx::mode(Mode::ALTERNATE); can::rx::mode(Mode::ALTERNATE);
can::tx::alternateFunction(9); can::tx::alternateFunction(9);
can::tx::mode(Mode::ALTERNATE);
using namespace sensors; using namespace sensors;
adis16405::cs::mode(Mode::OUTPUT); adis16405::cs::mode(Mode::OUTPUT);
adis16405::cs::high(); adis16405::cs::high();
adis16405::ckIn::mode(Mode::ALTERNATE);
adis16405::ckIn::alternateFunction(2); adis16405::ckIn::alternateFunction(2);
adis16405::ckIn::mode(Mode::ALTERNATE);
adis16405::dio1::mode(Mode::INPUT); adis16405::dio1::mode(Mode::INPUT);
adis16405::rst::mode(Mode::OUTPUT); adis16405::rst::mode(Mode::OUTPUT);
adis16405::rst::high(); adis16405::rst::high();
...@@ -396,11 +396,11 @@ void IRQbspInit() ...@@ -396,11 +396,11 @@ void IRQbspInit()
motP2::mode(Mode::OUTPUT); motP2::mode(Mode::OUTPUT);
motP2::low(); motP2::low();
rogP1::mode(Mode::ALTERNATE);
rogP1::alternateFunction(2); rogP1::alternateFunction(2);
rogP1::mode(Mode::ALTERNATE);
rogP2::mode(Mode::ALTERNATE);
rogP2::alternateFunction(2); rogP2::alternateFunction(2);
rogP2::mode(Mode::ALTERNATE);
nc_dtch::mode(Mode::INPUT); nc_dtch::mode(Mode::INPUT);
motor_act::mode(Mode::INPUT); motor_act::mode(Mode::INPUT);
...@@ -412,8 +412,8 @@ void IRQbspInit() ...@@ -412,8 +412,8 @@ void IRQbspInit()
motor_gnd::low(); motor_gnd::low();
using namespace actuators; using namespace actuators;
tcPwm::mode(Mode::ALTERNATE);
tcPwm::alternateFunction(3); tcPwm::alternateFunction(3);
tcPwm::mode(Mode::ALTERNATE);
thCut1::ena::mode(Mode::OUTPUT); thCut1::ena::mode(Mode::OUTPUT);
thCut1::ena::low(); thCut1::ena::low();
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
// The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never // The PARSING_FROM_IDE is because Netbeans gets confused by this, it is never
// defined when compiling the code. // defined when compiling the code.
#ifndef PARSING_FROM_IDE #ifndef PARSING_FROM_IDE
//#error This error is a reminder that you have not edited miosix_settings.h // #error This error is a reminder that you have not edited miosix_settings.h
// yet. // yet.
#endif // PARSING_FROM_IDE #endif // PARSING_FROM_IDE
/** /**
...@@ -70,14 +70,14 @@ namespace miosix ...@@ -70,14 +70,14 @@ namespace miosix
// Uncomment only *one* of those // Uncomment only *one* of those
#define SCHED_TYPE_PRIORITY #define SCHED_TYPE_PRIORITY
//#define SCHED_TYPE_CONTROL_BASED // #define SCHED_TYPE_CONTROL_BASED
//#define SCHED_TYPE_EDF // #define SCHED_TYPE_EDF
/// \def WITH_CPU_TIME_COUNTER /// \def WITH_CPU_TIME_COUNTER
/// Allows to enable/disable CPUTimeCounter to save code size and remove its /// Allows to enable/disable CPUTimeCounter to save code size and remove its
/// overhead from the scheduling process. By default it is not defined /// overhead from the scheduling process. By default it is not defined
/// (CPUTimeCounter is disabled). /// (CPUTimeCounter is disabled).
//#define WITH_CPU_TIME_COUNTER // #define WITH_CPU_TIME_COUNTER
// //
// Filesystem options // Filesystem options
...@@ -110,7 +110,7 @@ const unsigned char MAX_OPEN_FILES = 8; ...@@ -110,7 +110,7 @@ const unsigned char MAX_OPEN_FILES = 8;
/// This enables the dynamic loader to load elf programs, the extended system /// This enables the dynamic loader to load elf programs, the extended system
/// call service and, if the hardware supports it, the MPU to provide memory /// call service and, if the hardware supports it, the MPU to provide memory
/// isolation of processes /// isolation of processes
//#define WITH_PROCESSES // #define WITH_PROCESSES
#if defined(WITH_PROCESSES) && defined(__NO_EXCEPTIONS) #if defined(WITH_PROCESSES) && defined(__NO_EXCEPTIONS)
#error Processes require C++ exception support #error Processes require C++ exception support
...@@ -145,7 +145,7 @@ const unsigned char MAX_OPEN_FILES = 8; ...@@ -145,7 +145,7 @@ const unsigned char MAX_OPEN_FILES = 8;
/// \def WITH_DEEP_SLEEP /// \def WITH_DEEP_SLEEP
/// Adds interfaces and required variables to support deep sleep state switch /// Adds interfaces and required variables to support deep sleep state switch
/// automatically when peripherals are not required /// automatically when peripherals are not required
//#define WITH_DEEP_SLEEP // #define WITH_DEEP_SLEEP
/** /**
* \def JTAG_DISABLE_SLEEP * \def JTAG_DISABLE_SLEEP
......
...@@ -55,11 +55,11 @@ void program_startup() ...@@ -55,11 +55,11 @@ void program_startup()
extern unsigned char _bss_end asm("_bss_end"); extern unsigned char _bss_end asm("_bss_end");
// Initialize .data section, clear .bss section // Initialize .data section, clear .bss section
unsigned char *etext = &_etext; unsigned char* etext = &_etext;
unsigned char *data = &_data; unsigned char* data = &_data;
unsigned char *edata = &_edata; unsigned char* edata = &_edata;
unsigned char *bss_start = &_bss_start; unsigned char* bss_start = &_bss_start;
unsigned char *bss_end = &_bss_end; unsigned char* bss_end = &_bss_end;
memcpy(data, etext, edata - data); memcpy(data, etext, edata - data);
memset(bss_start, 0, bss_end - bss_start); memset(bss_start, 0, bss_end - bss_start);
......
...@@ -337,44 +337,44 @@ void IRQbspInit() ...@@ -337,44 +337,44 @@ void IRQbspInit()
using namespace interfaces; using namespace interfaces;
spi1::sck::mode(Mode::ALTERNATE);
spi1::sck::alternateFunction(5); spi1::sck::alternateFunction(5);
spi1::miso::mode(Mode::ALTERNATE); spi1::sck::mode(Mode::ALTERNATE);
spi1::miso::alternateFunction(5); spi1::miso::alternateFunction(5);
spi1::mosi::mode(Mode::ALTERNATE); spi1::miso::mode(Mode::ALTERNATE);
spi1::mosi::alternateFunction(5); spi1::mosi::alternateFunction(5);
spi1::mosi::mode(Mode::ALTERNATE);
spi2::sck::mode(Mode::ALTERNATE);
spi2::sck::alternateFunction(5); spi2::sck::alternateFunction(5);
spi2::miso::mode(Mode::ALTERNATE); spi2::sck::mode(Mode::ALTERNATE);
spi2::miso::alternateFunction(5); spi2::miso::alternateFunction(5);
spi2::mosi::mode(Mode::ALTERNATE); spi2::miso::mode(Mode::ALTERNATE);
spi2::mosi::alternateFunction(5); spi2::mosi::alternateFunction(5);
spi2::mosi::mode(Mode::ALTERNATE);
uart2::rx::mode(Mode::ALTERNATE);
uart2::rx::alternateFunction(7); uart2::rx::alternateFunction(7);
uart2::tx::mode(Mode::ALTERNATE); uart2::rx::mode(Mode::ALTERNATE);
uart2::tx::alternateFunction(7); uart2::tx::alternateFunction(7);
uart2::tx::mode(Mode::ALTERNATE);
uart3::rx::mode(Mode::ALTERNATE);
uart3::rx::alternateFunction(7); uart3::rx::alternateFunction(7);
uart3::tx::mode(Mode::ALTERNATE); uart3::rx::mode(Mode::ALTERNATE);
uart3::tx::alternateFunction(7); uart3::tx::alternateFunction(7);
uart3::tx::mode(Mode::ALTERNATE);
uart4::rx::mode(Mode::ALTERNATE);
uart4::rx::alternateFunction(8); uart4::rx::alternateFunction(8);
uart4::tx::mode(Mode::ALTERNATE); uart4::rx::mode(Mode::ALTERNATE);
uart4::tx::alternateFunction(8); uart4::tx::alternateFunction(8);
uart4::tx::mode(Mode::ALTERNATE);
can::rx::mode(Mode::ALTERNATE);
can::rx::alternateFunction(9); can::rx::alternateFunction(9);
can::tx::mode(Mode::ALTERNATE); can::rx::mode(Mode::ALTERNATE);
can::tx::alternateFunction(9); can::tx::alternateFunction(9);
can::tx::mode(Mode::ALTERNATE);
timers::tim4ch1::mode(Mode::ALTERNATE);
timers::tim4ch1::alternateFunction(2); timers::tim4ch1::alternateFunction(2);
timers::tim8ch2::mode(Mode::ALTERNATE); timers::tim4ch1::mode(Mode::ALTERNATE);
timers::tim8ch2::alternateFunction(3); timers::tim8ch2::alternateFunction(3);
timers::tim8ch2::mode(Mode::ALTERNATE);
camMosfet::mode(Mode::OUTPUT); camMosfet::mode(Mode::OUTPUT);
camMosfet::low(); camMosfet::low();
......