#1 Your code as is won’t compile. Period.
william@beaglebone:~$ pru-gcc -o main main.c
main.c:10:13: error: redefinition of ‘turnOn’
static void turnOn(){
^~~~~~
main.c:5:13: note: previous definition of ‘turnOn’ was here
static void turnOn(){
^~~~~~
#2 If you use the -Wall compiler option, you’ll be given more information as to why.
william@beaglebone:~$ pru-gcc -Wall -o main main.c
main.c:10:13: error: redefinition of ‘turnOn’
static void turnOn(){
^~~~~~
main.c:5:13: note: previous definition of ‘turnOn’ was here
static void turnOn(){
^~~~~~
main.c:5:13: warning: ‘turnOn’ defined but not used [-Wunused-function]
#3 If you only have one function of the same name.
william@beaglebone:~$ pru-gcc -Wall -o main main.c
william@beaglebone:~$ ls |grep main
main
main.c
#4 I suspect you’re not showing all your code. So for anyone to give a proper answer you need to provide all_your_code