mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 00:36:00 +00:00
Updated SPATZ to ignore TICK() when disabled
This commit is contained in:
parent
b79279dcbc
commit
86b72a2efd
@ -45,7 +45,7 @@ namespace sta
|
||||
* @param buffer The float buffer to write the data to.
|
||||
* @param length The number of floats to request.
|
||||
*/
|
||||
void request(uint8_t id, float * buffer, size_t length);
|
||||
bool request(uint8_t id, float * buffer, size_t length);
|
||||
|
||||
/**
|
||||
* @brief Request doubles for a specific sensor id via the printable.
|
||||
@ -80,6 +80,8 @@ namespace sta
|
||||
|
||||
#define STA_SPATZ_INIT(mutex, signal) ((void)0)
|
||||
|
||||
#define STA_SPATZ_TICK() ((void)0)
|
||||
|
||||
#endif // STA_SPATZ_ENABLED
|
||||
|
||||
#endif // STA_CORE_SPATZ_HPP
|
||||
|
@ -47,15 +47,20 @@ namespace sta
|
||||
mutex_->release();
|
||||
}
|
||||
|
||||
void request(uint8_t id, float * buffer, size_t length)
|
||||
bool request(uint8_t id, float * buffer, size_t length)
|
||||
{
|
||||
mutex_->acquire();
|
||||
|
||||
HAL_UART_Receive_IT(&huart1, reinterpret_cast<uint8_t*>(buffer), length * sizeof(float));
|
||||
Debug->printf("%d", id);
|
||||
signal_->wait(0x01, 100);
|
||||
if (signal_->wait(0x01, 100) != 0x01)
|
||||
{
|
||||
mutex_->release();
|
||||
return false;
|
||||
}
|
||||
|
||||
mutex_->release();
|
||||
return true;
|
||||
}
|
||||
|
||||
void request(uint8_t id, double * buffer, size_t length)
|
||||
|
Loading…
x
Reference in New Issue
Block a user