DIY Auto-Correlator 1.0
Auto-Correlator Card implementation using Teensy 4.x microcontrollers.
discarder.hpp
Go to the documentation of this file.
1#pragma once
2
3//#include <Arduino.h>
4#include "./../types.hpp"
6#ifdef CORR_SIMULATOR
7 #include "pseudoSerial.hpp"
8#else
9 #include <Arduino.h>
10#endif
11
13template <unsigned int Series_size, unsigned int Front, unsigned int End>
15{
16public:
17 template <typename LinCorrType>
18 void output(const LinCorrType &channel) const //__attribute__((always_inline))
19 {
20 // ↓ Which is usually uint32_t or 32-bit float
21 Serial.write((char8cast_t*)(channel.Channel_array + Front),
22 sizeof(channel_t)*(Series_size - (Front + End))
23 );
24 }
25
27 unsigned int discard_count() const //__attribute__((always_inline))
28 {
29 return (Front + End);
30 }
31
32};
Teensy specific Front back discarder implementation.
Definition: discarder.hpp:15
unsigned int discard_count() const
Returns the number of elements discarded by the discarder object.
Definition: discarder.hpp:27
void output(const LinCorrType &channel) const
Definition: discarder.hpp:18