-
Notifications
You must be signed in to change notification settings - Fork 350
Description
Chapter 07
using the atmel328P
Wondering why I get these compile warnings. slowScope is working here anyway.
$ sudo make flash avr-gcc -Os -g -std=gnu99 -Wall -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -DF_CPU=16000000UL -DBAUD=9600UL -I. -I../../AVR-Programming-Library -mmcu=atmega328p -c -o slowScope.o slowScope.c In file included from /usr/avr/include/avr/io.h:99, from slowScope.c:4: In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:13:3: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds=] 13 | ADMUX |= (1 << REFS0); /* reference voltage on AVCC */ | ^~~~~ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:13:9: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds=] 13 | ADMUX |= (1 << REFS0); /* reference voltage on AVCC */ | ^ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:15:3: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds=] 15 | ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); /* ADC clock prescaler /16 */ | ^~~~~~ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:15:10: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds=] 15 | ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); /* ADC clock prescaler /16 */ | ^ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:17:3: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds=] 17 | ADMUX |= (1 << ADLAR); /* left-adjust result, return only 8 bits */ | ^~~~~ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:17:9: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds=] 17 | ADMUX |= (1 << ADLAR); /* left-adjust result, return only 8 bits */ | ^ In function 'main': cc1: note: source object is likely at address zero In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:19:3: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Wa 19 | ADCSRA |= (1 << ADEN); /* enable ADC */ | ^~~~~~ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:19:10: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-W 19 | ADCSRA |= (1 << ADEN); /* enable ADC */ | ^ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:20:3: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Wa 20 | ADCSRA |= (1 << ADATE); /* auto-trigger enable */ | ^~~~~~ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:20:10: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-W 20 | ADCSRA |= (1 << ADATE); /* auto-trigger enable */ | ^ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:21:3: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Wa 21 | ADCSRA |= (1 << ADSC); /* start first conversion */ | ^~~~~~ In function 'main': cc1: note: source object is likely at address zero In function 'initFreerunningADC', inlined from 'main' at slowScope.c:27:3: slowScope.c:21:10: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-W 21 | ADCSRA |= (1 << ADSC); /* start first conversion */ | ^ In function 'main': cc1: note: source object is likely at address zero slowScope.c:30:5: warning: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Wa 30 | transmitByte(ADCH); /* transmit the high byte, left-adjusted */ | ^~~~~~~~~~~~~~~~~~ cc1: note: source object is likely at address zero avr-gcc -Wl,-Map,slowScope.map -Wl,--gc-sections -mmcu=atmega328p slowScope.o ../../AVR-Programming-Library/USART.o -o slowScope avr-objcopy -j .text -j .data -O ihex slowScope.elf slowScope.hex avrdude -c usbasp -p atmega328p -P usb -U flash:w:slowScope.hex avrdude: AVR device initialized and ready to accept instructions