Skip to content

Commit 9a5f432

Browse files
authored
Merge pull request #537 from tock/sync-doc-fix
doc: guide: remove old sync instructions
2 parents ded5c54 + 2591dfc commit 9a5f432

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

doc/guide.md

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -392,34 +392,13 @@ extern "C" {
392392

393393
### Example:
394394

395-
For our sensor example:
396-
397-
Create a struct to be set by the asynchronous callback:
398-
399-
```c
400-
struct data {
401-
bool fired;
402-
int val;
403-
returncode_t result;
404-
};
405-
406-
static struct data result = { .fired = false };
407-
```
408-
409-
Define a static callback function to pass to the asynchronous implementation:
395+
For our sensor example, define the external function in the `libtocksync_` name
396+
space for the sync operation:
410397

411398
```c
412-
static void sensor_cb(returncode_t ret, int val) {
413-
result.val = val;
414-
result.fired = true;
415-
result.result = ret;
416-
}
417-
```
418-
419-
Define the external function in the `libtocksync_` name space for the sync
420-
operation:
399+
#include "temperature.h"
400+
#include "syscalls/temperature_syscalls.h"
421401

422-
```c
423402
returncode_t libtocksync_sensor_read(int* val) {
424403
returncode_t err;
425404

0 commit comments

Comments
 (0)