updated relays by linking with the timer module.
This commit is contained in:
parent
4118e68268
commit
d558b3552c
|
@ -5,3 +5,7 @@ add_library(Relays STATIC
|
|||
target_include_directories(Relays PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(Relays
|
||||
timer
|
||||
)
|
||||
|
|
|
@ -6,24 +6,24 @@
|
|||
*/
|
||||
|
||||
#include "Relays.h"
|
||||
#include "timer.h"
|
||||
|
||||
/*
|
||||
static void WaitForRelayConnect(void) {
|
||||
while (!(PORTA.IN & RELAYREADINGPIN)) {
|
||||
;
|
||||
|
||||
void Relay_MeasureMakeTime(Relay *relay) {
|
||||
Timer_Start();
|
||||
while (Relay_ReadState(relay)) {
|
||||
}
|
||||
Timer_Disable();
|
||||
relay->make_time = Timer_GetOverflowCount();
|
||||
}
|
||||
|
||||
static void WaitForRelayDisconnect(void) {
|
||||
while (PORTA.IN & RELAYREADINGPIN) {
|
||||
;
|
||||
void Relay_MeasureBreakTime(Relay *relay) {
|
||||
Timer_Start();
|
||||
while (Relay_ReadState(relay)) {
|
||||
}
|
||||
Timer_Disable();
|
||||
relay->make_time = Timer_GetOverflowCount();
|
||||
}
|
||||
*/
|
||||
|
||||
void Relay_MeasureMakeTime(Relay *relay) {}
|
||||
|
||||
void Relay_MeasureBreakTime(Relay *relay) {}
|
||||
|
||||
void Relay_Enable(Relay *relay) {
|
||||
if (relay->disabled_fpc) {
|
||||
|
|
|
@ -26,6 +26,9 @@ typedef struct Relay {
|
|||
bool disabled_fpc;
|
||||
} Relay;
|
||||
|
||||
// extern void ptr_Timer_Start(void);
|
||||
// extern void Timer_Disable(void);
|
||||
|
||||
/**
|
||||
* Uses the AVR timer/counter to get the time it takes the relay to fully
|
||||
* activate. The value is then saved into the passed structure. To get the
|
||||
|
|
Loading…
Reference in New Issue