Hallo,
ich bin nach langer Zeit wieder einmal dabei einen AT Tiny 416 zu
programmieren.
Momentan sind es ca. 20 Zeilen C Code und äusserst trivial. Nur habe ich
einen komischen Effekt im AVR Studio. Wenn ich den Code übersetzen lasse
zum Debuggen erhalte ich folgenden Compiler Output.
Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files
(x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
Task "RunOutputFileVerifyTask"
Program Memory Usage : 3102 bytes 75.7 % Full
Data Memory Usage : 3 bytes 1.2 % Full
Warning: Memory Usage estimation may not be accurate if there
are sections other than .text sections in ELF file
Done executing task "RunOutputFileVerifyTask".
Dieser suggeriert mir das nach einigen Zeilen C-Code der Controller (4k)
mit 75,7% belegt ist.
Übersetze ich den Quellcode im Release Modus erhalte ich folgenden
Output:
Done executing task "RunCompilerTask".
Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files
(x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
Task "RunOutputFileVerifyTask"
Program Memory Usage : 510 bytes 12.5 % Full
Data Memory Usage : 3 bytes 1.2 % Full
Warning: Memory Usage estimation may not be accurate if there
are sections other than .text sections in ELF file
Done executing task "RunOutputFileVerifyTask".
Da sind nur 12.5% des Programmspeichers belegt. An den Compilerschaltern
wurde nichts verändert.
Meine Frage geht dahin, was wird da alles im Debug Modus dazugelinkt,
was ich garnicht benötige. Schon garnicht ein printf etc.
Wie bekomme ich den Compiler dazu dass er mir nicht über 50% mehr Code
erzeugt bzw. dazulinkt? Wo gibt es dazu Einstellungen?
Ich hoffe es kann mir jemand helfen.
Ciao Hans
Das ist im wesentlichen der Code es geht dabei um eine Entprellroutine
1 | /*
|
2 | * Periodic Interrupt
|
3 | * wird alle 60 ms aufgerufen
|
4 | */
|
5 | ISR(RTC_PIT_vect)
|
6 | {
|
7 | /* Insert your PIT interrupt handling code here */
|
8 | if(Button_get_level() == 0){
|
9 | ButtonTick--;
|
10 | if(ButtonTick == 0){
|
11 | ButtonTick = BUTTONTICKS;
|
12 | ButtonPressedFlag = true;
|
13 | }
|
14 | } else {
|
15 | ButtonTick = BUTTONTICKS;
|
16 | }
|
17 | /* The interrupt flag has to be cleared manually */
|
18 | RTC.PITINTFLAGS = RTC_PI_bm;
|
19 | }
|
20 |
|
21 | int main(void)
|
22 | {
|
23 | /* Initializes MCU, drivers and middleware */
|
24 | atmel_start_init();
|
25 | LED_set_level(false); // LED einschalten
|
26 | /* Replace with your application code */
|
27 | while (1) {
|
28 | if(ButtonPressedFlag == true){
|
29 | LED_set_level(true)
|
30 | }
|
31 |
|
32 | }
|
33 | }
|