7
mirror of https://github.com/tenderlove/initial-v.git synced 2025-04-14 19:29:34 +00:00

make this work with cpp

This commit is contained in:
Aaron Patterson 2022-08-20 12:22:59 -07:00
parent f9543171be
commit 1d40fa353a
No known key found for this signature in database
GPG Key ID: 953170BCB4FFAFC6
5 changed files with 20 additions and 3 deletions
firmware
CMakeLists.txt
components
crc/include
shifter/include
main

View File

@ -3,6 +3,7 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 17)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(bmw-keyboard)
project(initial-v)

View File

@ -1,3 +1,11 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
uint8_t crc8(uint8_t crc, uint8_t const *buf, uint32_t len);
#ifdef __cplusplus
}
#endif

View File

@ -5,6 +5,10 @@
#include <driver/twai.h>
#include <bmw_crc.h>
#ifdef __cplusplus
extern "C" {
#endif
static inline bool
SHIFTER_BACK_P(twai_message_t message)
{
@ -29,4 +33,8 @@ void shifter_send_drive(bool moveable);
void shifter_send_reset(void);
void shifter_send_light(uint8_t counter);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,2 +1,2 @@
idf_component_register(SRCS "bmw-keyboard.c"
idf_component_register(SRCS "initial-v.cpp"
INCLUDE_DIRS ".")

View File

@ -139,7 +139,7 @@ timer_callback(TimerHandle_t pxTimer)
xQueueSend(tx_task_queue, &tx_action, portMAX_DELAY);
}
void app_main(void)
extern "C" void app_main(void)
{
ctrl_task_sem = xSemaphoreCreateBinary();
tx_task_queue = xQueueCreate(1, sizeof(tx_task_action_t));