Scalar getAbsoluteTimeInSeconds() const { // This is super wonky, should be improved someday const auto delta = chVTTimeElapsedSinceX(previous_time_systicks_); previous_time_systicks_ += delta; absolute_time_systicks_ += delta; return Scalar(absolute_time_systicks_) / Scalar(CH_CFG_ST_FREQUENCY); }
static void setVariableFromIRQ(const Value value) { static_assert(Index < NumVariables, "Index out of range"); auto& self = getInstance(); self.vars_[Index] = Scalar(value); self.update_flags_[Index] = true; }
void set(const Value x) { static_assert(Index < NumVariables, "Debug variable index out of range"); vars_[Index] = Scalar(x); }
static void setVariableFromIRQ(const unsigned index, const Value value) { auto& self = getInstance(); self.vars_.at(index) = Scalar(value); self.update_flags_.at(index) = true; }