Closed Defragster closed 7 years ago
I need the source file to find the reason. Thanks.
Attached are the INO sketch files for the Teensy T_3.6 and the STM32 LadyBug I was using adcdma_stm32.ino.txt Acorr_Teensy.ino.txt
I fixed a few codes. Thanks.
I pulled that change and the Auto Format worked - but it introduced CODE ERRORS.
I started with the INO posted above and attached is what I got after a Reformat.
Here are the error lines pointed out: `d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:4:2: error: invalid preprocessing directive #x
^ d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:19:53: error: "|" may not appear in macro parameter list
^
d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:5:1: error: 'Serial' does not name a type Serial.println(x, HEX) // Debug print HEX ^ d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino: In function 'void timer_isr(void, uint32_t)': d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:15:3: error: 'ticks' was not declared in this scope ticks++; ^ d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino: In function 'void readADC(bool)': d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:80:87: error: 'DMA_OPTIONS' was not declared in this scope stm32l4_dma_start(& dma,(uint32_t) adcbuf[0],(uint32_t) & (ADC1 -> DR), ADCBUF_CNT, DMA_OPTIONS); ^ d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino: In function 'void stm32l4_ADC_dma_callback(void, uint32_t)': d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:92:87: error: 'DMA_OPTIONS' was not declared in this scope stm32l4_dma_start(& dma,(uint32_t) adcbuf[0],(uint32_t) & (ADC1 -> DR), ADCBUF_CNT, DMA_OPTIONS); ^ d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino: In function 'void setup()': d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:112:87: error: 'DMA_OPTIONS' was not declared in this scope stm32l4_dma_start(& dma,(uint32_t) adcbuf[0],(uint32_t) & (ADC1 -> DR), ADCBUF_CNT, DMA_OPTIONS); ^ d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino: In function 'void loop()': d:/Users/xxx/Documents/GitHub/STM32L4_tests/adcdma/adcdma.ino:185:18: error: 'ticks' was not declared in this scope Serial.print(ticks); ^ [Build] Error occurred. `
I can switch between board sketches and Auto Format and Upload without issue.
It compiles without error and runs, but Auto Format is still doing something odd with these two lines: `#define PRREG(x) Serial.print(#x" 0x"); Serial.println(x,HEX) // Debug print HEX
becomes three lines and extra space before the #define where the prior lined ends without a semi-colon: `#define PRREG(x) Serial.print(#x " 0x"); Serial.println(x, HEX) // Debug print HEX
`
Looks good - fixed that #define line break
I have Teensy and STM32 sketches open.
Auto Format is lost in one or the other after UPLOAD from the other.
Open Sublime Teensy sketch, do Auto Format, upload to Teensy, go to STM32 sketch and it won't do Auto Format.
Error Text may be this?