Can bus start without handle

This commit is contained in:
@CarlWachter
2024-02-16 17:43:28 +01:00
parent bfba17245f
commit 16b2ed5a20
5 changed files with 30 additions and 17 deletions

View File

@@ -11,6 +11,7 @@
#include <sta/tacos/thread.hpp>
#include <sta/tacos/manager.hpp>
#include <sta/tacos/statemachine.hpp>
#include <sta/tacos/can_bus.hpp>
#include <initializer_list>
#include <type_traits>
@@ -76,6 +77,8 @@ namespace sta
return thread_ptr;
}
//bool queueCanBusMsg(const CanDataMsg & msg, uint32_t timeout);
} // namespace tacos
}

View File

@@ -32,19 +32,19 @@ namespace sta
{
public:
CanBus(CAN_HandleTypeDef * controller);
CanBus();
/**
* @brief Getter function for the singleton instance.
*/
static CanBus* instance(CAN_HandleTypeDef * handle)
static CanBus* instance()
{
static CGuard g;
if (!_instance)
{
// Create the can bus singleton instance.
CanBus::_instance = new CanBus(handle);
CanBus::_instance = new CanBus();
}
return _instance;
@@ -115,7 +115,7 @@ namespace sta
AlpakaCanBus canBus_;
static RtosEvent messageEvent;
};