XC16 Compiler Optimizations and Code Configurator
I have been using the Code Configurator and XC16 compiler with the optimization level set to 0 to target a PIC24FJ128GC006 processor. So far so good and I have I2C, comm ports, timers, all running using interrupts totally managed by the code generated by the code configurator.
Noticing that I was getting over 70% on my flash utilization, I though I would set the compiler optimization to one and try running the code. As you have probably guessed, it did not run at all. I traced it down and it seems to be getting stuck trying to access an I2C peripheral. I placed some volatile keywords in the stucture declarations used for the initiating I2C transfers and that seemed to help as the code seems to make it past this block with good status.
However, now when compiling the code, I get all kinds of warnings because the volatile keyword is not part of the structure typedef that was created by code configurator-
So, the base line question is if you are going to use compiler optimizations, should you or should you not be using code generated from the code configurator? And, if it is ok to use the code configurator, is it safe to ignore all the warnings?