Browse Source

Don't disturb pin 13 (leftover debugging code)

main
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

//__asm__ volatile("mov sp, %0" : : "r" (0x20010000) : ); //__asm__ volatile("mov sp, %0" : : "r" (0x20010000) : );


// pin 13 - if startup crashes, use this to turn on the LED early for troubleshooting // 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 // Initialize memory
memory_copy(&_stext, &_stextload, &_etext); memory_copy(&_stext, &_stextload, &_etext);

+ 2
- 2
teensy4/usb_serial.c View File

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

Loading…
Cancel
Save