This code snippet shows the critical parts of my sketch.
The weird thing is: accessMyTriHour compiles fine as it is.
When i have accessMyTriMin without a printf, it compiles fine.
When i have accessMyTriMin with a printf statement, it doesn’t compile. Even when printf is in a called subroutine.
All i get is
Error: Could not compile. Please review your code.
In the RAW output i see at the end (amongst many other lines before)
/usr/local/gcc-arm-embedded/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/lib/armv7-m/libg_nano.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x10): undefined reference to `_read'
collect2: error: ld returned 1 exit status
../../../build/module.mk:232: recipe for target 'target/workspace.elf' failed
make[1]: Leaving directory '/firmware/modules/photon/user-part'
make[1]: *** [target/workspace.elf] Error 1
../build/recurse.mk:11: recipe for target 'modules/photon/user-part' failed
make: *** [modules/photon/user-part] Error 2
The code snippet:
void accessTriHour () {
// output each array element's value
for ( i = 0; i < igregg; i++ ) {
for ( j = 0; j < hours; j++ ) {
printf("myTriHour %d, %d = %d \n", i, j, myTriHour[i][j] ); // this line in: compiles.
}
}
}
void accessTriMin () {
// output each array element's value
for ( i = 0; i < igregg; i++ ) {
for ( j = 0; j < minutes; j++ ) {
m = myTriMin[i][j] ;
//printf("m %d, %d = %d \n", i, j, m ); // if commented out: compiles, IF
blastitout (m); // having that in: compiler fails. commented this out, too: compiles.
}
}
}
void blastitout (int m) {
h=2;
printf("a\n" );
}
Any help is highly appreciated.