瀏覽代碼

Don't disturb pin 13 (leftover debugging code)

teensy4-core
PaulStoffregen 6 年之前
父節點
當前提交
7153086e77
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. +4
    -4
      teensy4/startup.c
  2. +2
    -2
      teensy4/usb_serial.c

+ 4
- 4
teensy4/startup.c 查看文件

@@ -39,10 +39,10 @@ void ResetHandler(void)
//__asm__ volatile("mov sp, %0" : : "r" (0x20010000) : );

// pin 13 - if startup crashes, use this to turn on the LED early for troubleshooting
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 5;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = IOMUXC_PAD_DSE(7);
GPIO2_GDIR |= (1<<3);
GPIO2_DR_SET = (1<<3);
//IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 5;
//IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = IOMUXC_PAD_DSE(7);
//GPIO2_GDIR |= (1<<3);
//GPIO2_DR_SET = (1<<3); // digitalWrite(13, HIGH);

// Initialize memory
memory_copy(&_stext, &_stextload, &_etext);

+ 2
- 2
teensy4/usb_serial.c 查看文件

@@ -215,7 +215,7 @@ int usb_serial_write(const void *buffer, uint32_t size)
// TODO: do something so much better that this quick hack....
if (size > sizeof(txbuffer)) size = sizeof(txbuffer);
int count=0;
digitalWriteFast(13, HIGH);
//digitalWriteFast(13, HIGH);
while (1) {
uint32_t status = (volatile)(transfer.status);
if (count > 10) printf("status = %x\n", status);
@@ -225,7 +225,7 @@ int usb_serial_write(const void *buffer, uint32_t size)
// TODO: check for USB offline
delayMicroseconds(5); // polling too quickly seem to block DMA - maybe DTCM issue?
}
digitalWriteFast(13, LOW);
//digitalWriteFast(13, LOW);
delayMicroseconds(1); // TODO: this must not be the answer!
memcpy(txbuffer, buffer, size);
usb_prepare_transfer(&transfer, txbuffer, size, 0);

Loading…
取消
儲存