japaric-archived / photon-quickstart

Cargo template for developing photon applications
Apache License 2.0
43 stars 5 forks source link

use the higher level API #10

Closed japaric closed 7 years ago

japaric commented 7 years ago

updated some examples to use the safe API implemented in japaric/particle-hal#10. I also have an idea to make global variable safe but haven't implemented it. The basic idea is that since there doesn't seem to be a mechanism for preemption then accessing global variables is safe as long as you don't hand out more than one mutable reference (&mut-) to the variable at a time and the simplest way to preserve that rule is that is to only hand out shared (&-) references to global data. (Mutation through shared references can be achieved using Cell / RefCell).

cc @dbrgn

dbrgn commented 7 years ago

Looks good so far! :)

japaric commented 7 years ago

@homunkulus r+

homunkulus commented 7 years ago

:pushpin: Commit 1eb58e5 has been approved by japaric

homunkulus commented 7 years ago

:hourglass: Testing commit 1eb58e5 with merge 1eb58e5...

homunkulus commented 7 years ago

:sunny: Test successful - status-travis Approved by: japaric Pushing 1eb58e50cc9a0021f6bb088de0bcbe8948d36cc7 to master...