LCOV - code coverage report
Current view: top level - src/MIDI_Inputs/LEDs/MCU - VPotRingLEDs.hpp (source / functions) Hit Total Coverage
Test: e224b347cd670555e44f06608ac41bd1ace9d9d8 Lines: 11 11 100.0 %
Date: 2020-09-08 17:44:46 Functions: 6 7 85.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <AH/Hardware/LEDs/LEDs.hpp>
       4             : #include <MIDI_Inputs/MCU/VPotRing.hpp>
       5             : 
       6             : BEGIN_CS_NAMESPACE
       7             : 
       8             : namespace MCU {
       9             : 
      10             : class VPotRingLEDsCallback {
      11             :   public:
      12           1 :     VPotRingLEDsCallback(const AH::LEDs<11> &leds) : leds(leds) {}
      13             : 
      14             :     template <class T>
      15           1 :     void begin(const T &) {
      16           1 :         leds.begin();
      17           1 :     }
      18             : 
      19             :     template <class T>
      20           2 :     void update(const T &t) {
      21           2 :         leds.displayRange(t.getStartOn(), t.getStartOff());
      22           2 :     }
      23             : 
      24             :   private:
      25             :     const AH::LEDs<11> leds;
      26             : };
      27             : 
      28             : // -------------------------------------------------------------------------- //
      29             : 
      30             : class VPotRingLEDs : public GenericVPotRing<VPotRingLEDsCallback> {
      31             :   public:
      32             :     VPotRingLEDs(const PinList<11> &ledPins, uint8_t track,
      33             :                  MIDIChannelCN channelCN = CHANNEL_1)
      34             :         : GenericVPotRing<VPotRingLEDsCallback>{track, channelCN, {ledPins}} {}
      35             : };
      36             : 
      37             : namespace Bankable {
      38             : 
      39             : template <setting_t NumBanks>
      40           1 : class VPotRingLEDs : public GenericVPotRing<NumBanks, VPotRingLEDsCallback> {
      41             :   public:
      42           1 :     VPotRingLEDs(BankConfig<NumBanks> config, const PinList<11> &ledPins,
      43             :                  uint8_t track, MIDIChannelCN channelCN = CHANNEL_1)
      44           1 :         : GenericVPotRing<NumBanks, VPotRingLEDsCallback>{
      45           2 :               config, track, channelCN, {ledPins}} {}
      46             : };
      47             : 
      48             : } // namespace Bankable
      49             : 
      50             : } // namespace MCU
      51             : 
      52             : END_CS_NAMESPACE

Generated by: LCOV version 1.14-6-g40580cd