예제 #1
0
static int16_t get_channel(uint8_t i) {
    int16_t val = 0;
    uint8_t src = channel_source[i];
    switch (SRC_SYS(src)) {
    case SRC_ADC:
        val = adc_get(SRC_NUM(src));
        break;
    case SRC_SW:
        val = sw_get(SRC_NUM(src));
        break;
    case SRC_DS:
        val = ds_get_next_pulse();
        break;
#ifdef USE_TWI_ADC
    case SRC_TWI_ADC:
        val = twi_adc_get(SRC_NUM(src));
        break;
#endif
#ifdef USE_NUNCHUK
    case SRC_NUNCHUK:
        val = nunchuk_get(SRC_NUM(src));
        break;
#endif
    default: /* unknown source */
        break;
    }
    return val;
}
예제 #2
0
static int16_t get_channel(uint8_t i) {
	int16_t val = 0;
	uint8_t src = channel_source[i];
	switch (SRC_SYS(src)) {
		case SRC_ADC:
			val = adc_get(SRC_NUM(src));
			break;
		case SRC_SW:
			val = sw_get(SRC_NUM(src));
			break;
		case SRC_DS:
			val = ds_get_next_pulse();
			break;
		case SRC_PS2PAD:
			val = ps2_get(SRC_NUM(src));
			break;
		default: /* unknown source */
			break;
	}
	return val;
}