浏览代码

Delete extra / old copy of pinMode

teensy4-core
PaulStoffregen 6 年前
父节点
当前提交
4c7cf387c8
共有 1 个文件被更改,包括 0 次插入28 次删除
  1. +0
    -28
      teensy4/digital.c

+ 0
- 28
teensy4/digital.c 查看文件

@@ -119,34 +119,6 @@ void pinMode(uint8_t pin, uint8_t mode)
*(p->mux) = 5 | 0x10;
}

void pinMode(uint8_t pin, uint8_t mode)
{
const struct digital_pin_bitband_and_config_table_struct *p;

if (pin >= CORE_NUM_DIGITAL) return;
p = digital_pin_to_info_PGM + pin;
if (mode == OUTPUT || mode == OUTPUT_OPENDRAIN) {
*(p->reg + 1) |= p->mask; // TODO: atomic
if (mode == OUTPUT) {
*(p->pad) = IOMUXC_PAD_DSE(7);
} else { // OUTPUT_OPENDRAIN
*(p->pad) = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_ODE;
}
} else {
*(p->reg + 1) &= ~(p->mask); // TODO: atomic
if (mode == INPUT) {
*(p->pad) = 0;
} else if (mode == INPUT_PULLUP) {
*(p->pad) = IOMUXC_PAD_PKE | IOMUXC_PAD_PUE | IOMUXC_PAD_PUS(3) | IOMUXC_PAD_HYS;
} else if (mode == INPUT_PULLDOWN) {
*(p->pad) = IOMUXC_PAD_PKE | IOMUXC_PAD_PUE | IOMUXC_PAD_PUS(0) | IOMUXC_PAD_HYS;
} else { // INPUT_DISABLE
*(p->pad) = IOMUXC_PAD_HYS;
}
}
*(p->mux) = 5 | 0x10;
}

void _shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t value)
{
if (bitOrder == LSBFIRST) {

正在加载...
取消
保存