Teensy 3.0 minimal source code

Status
Not open for further replies.
0

000000

Guest
Hi,

I would known what minimal source code should I include for a simple program?
source files: mk20dx128.c
header files: mk20dx128.h
linker script: mk20dx128.ld

And that's all? There is no default crt.s from arm-gcc?
 
mk20dx128.c contains all the startup stuff. It calls main(), so at the very least you must also have a function with main(). Of course, if main() actually does anything useful, you'll probably want some of the functions from the many other files. But if you want "minimal", you could write directly to registers rather than using the already-developed functions that do it easily.

I wouldn't necessarily call that "simple". Probably the simplest is Arduino's 01.Basics > Blink example, which contains very little code but gets linked with lots of stuff by the build process.

There can be a big difference between "simple" and "minimal".
 
Yeah, simple was very subjective in my post. I'm asking that because I want 2 things:
- Firstly, try to avoid any cpp (im really not familiar with this language, dunno what will gcc produce, how does it manage object in memory, etc.)
- Secondly, write a SPI slave.

The startup section seems to use an external symbol which is _init_Teensyduino_internal_.
Could be nice if this routine was directly located in mk20dx128.c and don't call analog_init, usb_init, init_pin_interrupts. What do you think about letting programmer call those routines?
 
Status
Not open for further replies.
Back
Top