The Arduino IDE does a lot of stuff for you in the background. One thing it does is to scan your code looking for functions that are defined after their use, like your task1code
and task2code
.
If it finds any, it attempts to declare those functions at the top, before their use. In PlatformIO, you need to do this yourself.
Change the top of your code to this:
#include <Arduino.h>
#include <FreeRTOS.h>
void task1code (void * pvParameters);
void task2code (void * pvParameters);
...
The compiler now knows about your two tasks, before it finds references or calls to them while compiling your source.
You might find this useful: Tutorial for creating multi cpp file arduino project - #38 by NormanDunbar.
Cheers,
Norm.