Browse Source

Don't disturb pin 13 (leftover debugging code)

teensy4-core
PaulStoffregen 6 years ago
parent
commit
7153086e77
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      teensy4/startup.c
  2. +2
    -2
      teensy4/usb_serial.c

+ 4
- 4
teensy4/startup.c View File

@@ -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 View File

@@ -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…
Cancel
Save