Skip to content

Commit 100e305

Browse files
Merge branch 'main' into feature/p3t1755
2 parents 0b337d4 + 7967fa7 commit 100e305

4 files changed

Lines changed: 27 additions & 2 deletions

File tree

Testing/cmock-config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
:cmock:
33
:mock_prefix: mock_
4-
:includes:
5-
- stubs.h
64
:plugins:
75
- :ignore
86
- :ignore_arg

platforms/stm32h563/src/fdcan.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ HAL_StatusTypeDef can_init(can_t *can, FDCAN_HandleTypeDef *hcan)
2929
return status;
3030
}
3131

32+
/* Set up the global filter to reject all messages by default. You must explicitly add messages to your filters in the app layer to receive them. */
33+
status = HAL_FDCAN_ConfigGlobalFilter(hcan, FDCAN_REJECT, FDCAN_REJECT, FDCAN_REJECT_REMOTE, FDCAN_REJECT_REMOTE);
34+
if(status != HAL_OK) {
35+
printf("[fdcan.c/can_init()] ERROR: Failed to run HAL_FDCAN_ConfigGlobalFilter() (Status: %d).\n", status);
36+
return status;
37+
} else {
38+
printf("[fdcan.c/can_init()] Ran HAL_FDCAN_ConfigGlobalFilter()!\n");
39+
}
40+
3241
/* Start FDCAN */
3342
status = HAL_FDCAN_Start(can->hcan);
3443
if (status != HAL_OK)

threadX/inc/u_tx_threads.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ typedef struct {
2424
TX_THREAD _TX_THREAD;
2525
} thread_t;
2626

27+
/* Creates a thread based on the provided configuration.
28+
*
29+
* @param byte_pool Pointer to the byte pool to allocate the thread's stack from.
30+
* @param thread Pointer to a thread_t struct containing the thread's configuration.
31+
* @return U_SUCCESS if the thread was created successfully, U_ERROR otherwise.
32+
*/
2733
uint8_t create_thread(TX_BYTE_POOL *byte_pool, thread_t *thread);
2834

35+
/**
36+
* Sleeps the current thread for the specified number of milliseconds.
37+
*/
38+
uint8_t thread_sleep_ms(uint32_t ms);
39+
2940
#endif

threadX/src/u_tx_threads.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#include "u_tx_threads.h"
33
#include "u_tx_debug.h"
4+
#include "u_tx_general.h"
45

56
// clang-format off
67

@@ -27,4 +28,10 @@ uint8_t create_thread(TX_BYTE_POOL *byte_pool, thread_t *thread)
2728
return U_SUCCESS;
2829
}
2930

31+
uint8_t thread_sleep_ms(uint32_t ms)
32+
{
33+
tx_thread_sleep(MS_TO_TICKS(ms));
34+
return U_SUCCESS;
35+
}
36+
3037
// clang-format on

0 commit comments

Comments
 (0)