View Single Post
  #4   Spotlight this post!  
Unread 08-10-2010, 19:37
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Lego NXT -- NXC blocking bluetooth IO

I believe that the NXC firmware is based on the LEGO FW, and the scheduling in that FW is done statically. The I/O drivers run once per millisecond and the VM is guaranteed to not be running during that period. This simplifies the protection mechanisms.

The user level code that meshes well with this is to poll and if not arrived, sleep 1 millisecond. There would be slightly less overhead if the BT driver had a notification mechanism, but it is pretty capable as long as there is a delay. A slightly better guess is to sleep the appropriate time based on the amount being transferred. Does yield in NXC take a parameter, or is there a better way to sleep a controlled amount?

Greg McKaskle