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: Rahix's avatarRahix <rahix@rahix.de>
parent 9d44017b
#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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment