Skip to content

Commit 662df45

Browse files
fix: try to fix tests part 6
1 parent 18c9915 commit 662df45

8 files changed

Lines changed: 41 additions & 158 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ target_compile_options(${STLIB_LIBRARY} PRIVATE
274274

275275
target_include_directories(${STLIB_LIBRARY} PUBLIC
276276
# CMSIS + HAL
277-
$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/CMSIS/Device/ST/STM32H7xx/Include>
278-
$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/CMSIS/Include>
277+
#$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/CMSIS/Device/ST/STM32H7xx/Include>
278+
#$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/CMSIS/Include>
279+
${STM32CUBEH7}/Drivers/CMSIS/Device/ST/STM32H7xx/Include
280+
${STM32CUBEH7}/Drivers/CMSIS/Include
279281
$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/CMSIS/Core_A/Include>
280282
$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/STM32H7xx_HAL_Driver/Inc>
281283
$<$<BOOL:${CMAKE_CROSSCOMPILING}>:${STM32CUBEH7}/Drivers/STM32H7xx_HAL_Driver/Inc/Legacy>

Inc/MockedDrivers/NVIC.hpp

Lines changed: 2 additions & 152 deletions
Large diffs are not rendered by default.

Inc/MockedDrivers/compiler_specific.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
* ARM GCC intrinsics that don't work on x86_64 / host platforms.
77
*/
88

9+
//////////////////////////////////////////////////////////////////
10+
11+
#ifdef __COMPILER_BARRIER
12+
#undef __COMPILER_BARRIER
13+
#endif
14+
15+
//////////////////////////////////////////////////////////////////
16+
917
static inline uint32_t __RBIT(uint32_t val) {
1018
// 1. Hardware Byte Swap (Optimization: handles the large movements)
1119
// MSVC uses _byteswap_ulong, GCC/Clang uses __builtin_bswap32

Inc/MockedDrivers/ll_tim_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#ifndef __STM32H7xx_LL_TIM_H
2121
#define __STM32H7xx_LL_TIM_H
2222

23+
#include "stm32h723xx_wrapper.h"
2324
#include "mocked_ll_tim.hpp"
2425

2526
#ifdef __cplusplus
@@ -28,7 +29,7 @@ extern "C" {
2829

2930
#include <stdint.h>
3031

31-
#define TIM1
32+
//#define TIM1
3233

3334
/** @addtogroup STM32H7xx_LL_Driver
3435
* @{

Inc/MockedDrivers/mocked_ll_tim.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <cstdint>
3+
#include "MockedDrivers/stm32h723xx_wrapper.h"
34
#include "MockedDrivers/common.hpp"
45
#include "MockedDrivers/NVIC.hpp"
56
#include "MockedDrivers/tim_register_definitions.hpp"
@@ -129,5 +130,7 @@ struct RegisterTraits<TimReg,TimReg::Reg_CNT> {
129130
TIM_TypeDef __htim##TIM_IDX{TIM_IDX##_IRQHandler,TIM_IDX##_IRQn}; \
130131
TIM_TypeDef* TIM_IDX##_BASE = &__htim##TIM_IDX;
131132

133+
#undef TIM1_BASE
132134
DECLARE_TIMER(TIM1)
135+
#undef TIM2_BASE
133136
DECLARE_TIMER(TIM2)

Inc/MockedDrivers/stm32h723xx_wrapper.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
#ifndef STM32H723xx_WRAPPER_H
22
#define STM32H723xx_WRAPPER_H
33

4+
#include <stdint.h>
5+
#ifdef __cplusplus
6+
#define __I volatile /*!< Defines 'read only' permissions */
7+
#else
8+
#define __I volatile const /*!< Defines 'read only' permissions */
9+
#endif
10+
#define __IO volatile
11+
12+
// necessary remove of some warnings due to cmsis made for 32 bit arch and not 64 bit arch
13+
#define __RBIT __RBIT__CMSIS
14+
#define TIM_TypeDef TIM_TypeDef__CMSIS
15+
#pragma GCC diagnostic push
16+
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
17+
18+
// don't do anything in "core_cm7.h"
19+
#define __CORE_CM7_H_GENERIC
20+
#define __CORE_CM7_H_DEPENDANT
421
#include "stm32h723xx.h"
522

23+
#pragma GCC diagnostic pop
24+
#undef __RBIT
25+
#undef TIM_TypeDef
26+
627
#undef RCC
728

829
extern RCC_TypeDef *RCC;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "stm32h7xx_wrapper.h"
1+
#include "MockedDrivers/stm32h723xx_wrapper.h"
22

33
static RCC_TypeDef RCC_struct;
44
RCC_TypeDef *RCC = &RCC_struct;

Tests/Time/scheduler_test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include <thread>
33
#include<chrono>
44

5-
#include "Inc/MockedDrivers/stm32h723xx_wrapper.h"
6-
75
#include "HALAL/Services/Time/Scheduler.hpp"
86

97
int count = 0;

0 commit comments

Comments
 (0)