Midnight Sun Firmware
Loading...
Searching...
No Matches
Miscellaneous

Miscellaneous libraries. More...

Macros

#define SIZEOF_ARRAY(arr)   (sizeof((arr)) / sizeof((arr)[0]))
 
#define SIZEOF_FIELD(type, field)   (sizeof(((type *)0)->field))
 
#define SWAP_UINT16(x)   (uint16_t)(((uint16_t)(x) >> 8) | ((uint16_t)(x) << 8))
 
#define STRINGIFY_(x)   #x
 
#define STRINGIFY(x)   STRINGIFY_(x)
 
#define MIN(a, b)
 
#define MAX(a, b)
 
#define TEST_ASSERT_OK(code)   TEST_ASSERT_EQUAL(STATUS_CODE_OK, (code))
 
#define TEST_ASSERT_NOT_OK(code)   TEST_ASSERT_NOT_EQUAL(STATUS_CODE_OK, (code))
 
#define TEST_MOCK(func)   __attribute__((used)) __wrap_##func
 
#define TEST_CASE(...)
 
#define TEST_PRE_TASK
 
#define TEST_IN_TASK
 

Functions

void test_helpers_init_semphr (void)
 Initializes test start and end semaphores.
 
uint8_t test_helpers_start_get_semphr (void)
 Gets the semaphore for the test start. More...
 
uint8_t test_helpers_end_get_semphr (void)
 Gets the semaphore for the test end. More...
 
StatusCode test_helpers_start_give_semphr (void)
 Gives the test start semaphore. More...
 
StatusCode test_helpers_end_give_semphr (void)
 Gives the test end semaphore. More...
 
StatusCode test_helpers_start_take_semphr (void)
 Takes the test start semaphore. More...
 
StatusCode test_helpers_end_take_semphr (void)
 Takes the test end semaphore. More...
 

Detailed Description

Miscellaneous libraries.

Macro Definition Documentation

◆ MAX

#define MAX (   a,
 
)
Value:
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a > _b ? _a : _b; \
})

◆ MIN

#define MIN (   a,
 
)
Value:
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})

Function Documentation

◆ test_helpers_end_get_semphr()

uint8_t test_helpers_end_get_semphr ( void  )

Gets the semaphore for the test end.

Returns
Value from 0-10

◆ test_helpers_end_give_semphr()

StatusCode test_helpers_end_give_semphr ( void  )

Gives the test end semaphore.

Returns
STATUS_CODE_OK if the semaphore was given successfully STATUS_CODE_INTERNAL_ERROR if it fails

◆ test_helpers_end_take_semphr()

StatusCode test_helpers_end_take_semphr ( void  )

Takes the test end semaphore.

Returns
STATUS_CODE_OK if the semaphore was successfully taken STATUS_CODE_INTERNAL_ERROR if it fails

◆ test_helpers_start_get_semphr()

uint8_t test_helpers_start_get_semphr ( void  )

Gets the semaphore for the test start.

Returns
Value from 0-10

◆ test_helpers_start_give_semphr()

StatusCode test_helpers_start_give_semphr ( void  )

Gives the test start semaphore.

Returns
STATUS_CODE_OK if the semaphore was given successfully STATUS_CODE_INTERNAL_ERROR if it fails

◆ test_helpers_start_take_semphr()

StatusCode test_helpers_start_take_semphr ( void  )

Takes the test start semaphore.

Returns
STATUS_CODE_OK if the semaphore was successfully taken STATUS_CODE_INTERNAL_ERROR if it fails