mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 07:15:18 +03:00
Cleanup project structure. Update unit test Makefile to place object
files in obj/test
This commit is contained in:
parent
fb9e3a2358
commit
d19a5e7046
330 changed files with 657 additions and 638 deletions
34
src/main/drivers/adc.c
Executable file
34
src/main/drivers/adc.c
Executable file
|
@ -0,0 +1,34 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "system.h"
|
||||
|
||||
#include "accgyro.h"
|
||||
|
||||
#include "adc.h"
|
||||
|
||||
adc_config_t adcConfig[ADC_CHANNEL_COUNT];
|
||||
volatile uint16_t adcValues[ADC_CHANNEL_COUNT];
|
||||
|
||||
extern int16_t debug[4];
|
||||
|
||||
uint16_t adcGetChannel(uint8_t channel)
|
||||
{
|
||||
#if 1
|
||||
if (adcConfig[0].enabled) {
|
||||
debug[0] = adcValues[adcConfig[0].dmaIndex];
|
||||
}
|
||||
if (adcConfig[1].enabled) {
|
||||
debug[1] = adcValues[adcConfig[1].dmaIndex];
|
||||
}
|
||||
if (adcConfig[2].enabled) {
|
||||
debug[2] = adcValues[adcConfig[2].dmaIndex];
|
||||
}
|
||||
if (adcConfig[3].enabled) {
|
||||
debug[3] = adcValues[adcConfig[3].dmaIndex];
|
||||
}
|
||||
#endif
|
||||
return adcValues[adcConfig[channel].dmaIndex];
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue