Skip to content
Snippets Groups Projects
Verified Commit 070867f8 authored by rahix's avatar rahix
Browse files

chore(epicardium): Switch from MXC_ASSERT to assert


Newlib assert uses __assert_func and thus our panic() function while
MXC_ASSERT uses a custom assertion logic.  Newlib assert is also more
portable as it works in expression position while MXC_ASSERT only works
as a statement.

Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 9d44017b
No related branches found
No related tags found
No related merge requests found
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#define MXC_ASSERT_ENABLE
#include "mxc_assert.h"
#include "max32665.h"
#include <assert.h>
/* CMSIS keeps a global updated with current system clock in Hz */
#define configCPU_CLOCK_HZ ((unsigned long)96000000)
......@@ -69,7 +68,7 @@
#define xPortSysTickHandler SysTick_Handler
/* Assert */
#define configASSERT(x) MXC_ASSERT(x)
#define configASSERT(x) assert(x)
/* Tickless idle hooks */
typedef uint32_t TickType_t;
......
#include <assert.h>
#include <stdio.h>
#include <string.h>
......@@ -259,14 +260,14 @@ bhi160_handle_packet(bhy_data_type_t data_type, bhy_data_generic_t *sensor_data)
wakeup = true;
/* fall through */
case VS_ID_TIMESTAMP_MSW:
MXC_ASSERT(data_type == BHY_DATA_TYPE_SCALAR_U16);
assert(data_type == BHY_DATA_TYPE_SCALAR_U16);
timestamp = sensor_data->data_scalar_u16.data << 16;
break;
case VS_ID_TIMESTAMP_LSW_WAKEUP:
wakeup = true;
/* fall through */
case VS_ID_TIMESTAMP_LSW:
MXC_ASSERT(data_type == BHY_DATA_TYPE_SCALAR_U16);
assert(data_type == BHY_DATA_TYPE_SCALAR_U16);
timestamp = (timestamp & 0xFFFF0000) |
sensor_data->data_scalar_u16.data;
break;
......@@ -303,7 +304,7 @@ bhi160_handle_packet(bhy_data_type_t data_type, bhy_data_generic_t *sensor_data)
break;
}
MXC_ASSERT(data_type == BHY_DATA_TYPE_VECTOR);
assert(data_type == BHY_DATA_TYPE_VECTOR);
if (bhi160_streams[sensor_type].queue == NULL) {
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment