A programming problem

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
mark-jack
Member++
Posts: 28
Joined: Fri Oct 13, 2017 4:11 am

A programming problem

Post by mark-jack »

When I modify the program provided by the official website, there are the following questions, what is the reason?I just added something in the while (1) loop, and I got the following question。If you can give me some inspiration, I would be greatly appreciated.
Image

Image


ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

Combinable functions have a strict format (initialisation + while(1){select{select-cases}}).
This is to make combining several of them together straight forward to the user and the compiler - no surprises, no confusion, no problems.
Effectively, all the initialisations will be pasted together and then all the select-cases will be pasted into one big while(1){select{}} block.
You could do this yourself, but having the compiler combining all the different bits onto a single logical-core is probably easier and more flexible.
It is a bit too restrictive (can't use unsafe{} blocks) and future versions of the compiler will hopefully relax some of the strictness.
mark-jack
Member++
Posts: 28
Joined: Fri Oct 13, 2017 4:11 am

Post by mark-jack »

robertxmos wrote:Combinable functions have a strict format (initialisation + while(1){select{select-cases}}).
This is to make combining several of them together straight forward to the user and the compiler - no surprises, no confusion, no problems.
Effectively, all the initialisations will be pasted together and then all the select-cases will be pasted into one big while(1){select{}} block.
You could do this yourself, but having the compiler combining all the different bits onto a single logical-core is probably easier and more flexible.
It is a bit too restrictive (can't use unsafe{} blocks) and future versions of the compiler will hopefully relax some of the strictness.
After your detailed explanation, I have a deeper understanding of this grammar, thank you very much.
Post Reply