/* * adc.c * * Created on: 08.02.2019 * Author: julian */ #include "adc.h" #include "main.h" #include #include // global adc instance volatile adc_t adc; static inline void adc_next() { do { adc.current_channel = (adc.current_channel+1)%8; if (!adc.current_channel) { adc.current_sample = adc.buffer.ptr-1; // update app state (remap channels) app.state.state.slider = adc.buffer.ptr[4]; app.state.state.poti[0] = adc.buffer.ptr[3]; app.state.state.poti[1] = adc.buffer.ptr[2]; app.state.state.poti[2] = adc.buffer.ptr[0]; app.state.state.poti[3] = adc.buffer.ptr[1]; } } while(!(adc.channel_mask & (1<