Thanks for the great example.
The problem is related to the last piece of outstanding work from all the arduino additions of the past months.
Historically the function prototypes that are automatically inserted into the temp compiler version of the code, after the first valid code line. The first line is deduced using a regex expression so it was always prone to issues.
In your case the first line is incorrectly assumed to be
#if !REMOTE_CONTROL && !OBSTACLE_DETECTION && !SERIAL_INPUT && !SHOW_DEMO
You can get around the issue in one of two ways. The 1st suggestion is the easiest.
1) Solution 1 -
Add the following int dummy = 0 near the top of the code (or add any of your own declaration(s) that are not pre-processor statements) // There are (currently) four ways to control this robot:
// 1) Obstacle Detection
// 2) Remote Control
// 3) Serial Input
// 4) Fixed Demo
//
int dummy = 0;
2) Solution 2 - Add prototypes for methods prior to their first reference. For example: Add the timeIsr prototype at a valid location before it is first referenced in the code. (Visual Micro won't try to insert the prototype again if it finds it in the code with matching signature to the method)
void timerIsr();
It can sometimes be confusing with the compile being in the temp folder but it is actually very easy to take a look if you ever need to. Open the following source in VS and you will see the prototypes are grayed out because they are in invalid location within an #if condition:- ot.cpp
Visual Micro will shortly be updated to manage the insertion of prototypes better. Adding prototypes to different locations in the code, instead of as a block, adds compelixity when it comes to determining drill down from compiler errors into .ino source code which is why it's taken a a few months to implement.