From ccd2773c5a55d3cd4adc53343304a8cc4d82d35e Mon Sep 17 00:00:00 2001 From: schneider <schneider@blinkenlichts.net> Date: Fri, 3 May 2019 21:24:48 +0200 Subject: [PATCH] fix(BHI): Stub HAL --- .../driver/inc/bhy_support.h | 1 - .../driver/src/bhy_support.c | 25 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/bosch/BHy1_driver_and_MCU_solution/driver/inc/bhy_support.h b/lib/bosch/BHy1_driver_and_MCU_solution/driver/inc/bhy_support.h index 0953c634..339a2d76 100644 --- a/lib/bosch/BHy1_driver_and_MCU_solution/driver/inc/bhy_support.h +++ b/lib/bosch/BHy1_driver_and_MCU_solution/driver/inc/bhy_support.h @@ -56,7 +56,6 @@ /* HEADER FILES */ /********************************************************************************/ #include "bhy.h" -#include "twi.h" /********************************************************************************/ /* MACROS */ diff --git a/lib/bosch/BHy1_driver_and_MCU_solution/driver/src/bhy_support.c b/lib/bosch/BHy1_driver_and_MCU_solution/driver/src/bhy_support.c index bca9c5ae..a92e254c 100644 --- a/lib/bosch/BHy1_driver_and_MCU_solution/driver/src/bhy_support.c +++ b/lib/bosch/BHy1_driver_and_MCU_solution/driver/src/bhy_support.c @@ -56,21 +56,28 @@ #include "bhy_support.h" #include "bhy_uc_driver_config.h" -#include "FreeRTOS.h" -#include "task.h" +#include "i2c.h" +#include "tmr_utils.h" +#include <stdio.h> /********************************************************************************/ /* STATIC VARIABLES */ /********************************************************************************/ static struct bhy_t bhy; -static uint8_t *version = BHY_MCU_REFERENCE_VERSION; +static char *version = BHY_MCU_REFERENCE_VERSION; /********************************************************************************/ /* EXTERN FUNCTION DECLARATIONS */ /********************************************************************************/ -extern int8_t sensor_i2c_write(uint8_t addr, uint8_t reg, uint8_t *p_buf, uint16_t size); -extern int8_t sensor_i2c_read(uint8_t addr, uint8_t reg, uint8_t *p_buf, uint16_t size); -extern void trace_log(const char *fmt, ...); +static int8_t sensor_i2c_write(uint8_t addr, uint8_t reg, uint8_t *p_buf, uint16_t size) +{ + return 0; +} + +static int8_t sensor_i2c_read(uint8_t addr, uint8_t reg, uint8_t *p_buf, uint16_t size) +{ + return 0; +} /********************************************************************************/ /* FUNCTION DECLARATIONS */ @@ -114,20 +121,20 @@ int8_t bhy_initialize_support(void) */ void bhy_delay_msec(uint32_t msec) { - vTaskDelay(msec); + TMR_Delay(MXC_TMR0, MSEC(msec), 0); } /*! * @brief provides a print function to the bhy driver on DD2.0 platform */ void bhy_printf(const u8 * string) { - trace_log("%s",string); + printf("%s",string); } /*! * @brief provides the mcu reference code version */ uint8_t * bhy_get_version(void) { - return (version); + return (uint8_t *)version; } /** @}*/ -- GitLab