Skip to content

Commit

Permalink
Clarify how to print interrupt arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
hokeun authored Oct 31, 2023
1 parent 8e3a7c3 commit a7f96aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Interrupts.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sure to understand static variables in C.

## 6.2. Interrupt Service Routine

1. The [`gpio_set_irq_enabled_with_callback`](https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#ga6165f07f4b619dd08ea6dc97d069e78a) function of the Pico SDK provides a convenient "one-stop shop" for specifying a callback function to invoke upon a voltage event on a GPIO pin. Create a simple program `InterruptCallbackSolution.lf` that prints the arguments to the callback function each time you press button A on the robot.
1. The [`gpio_set_irq_enabled_with_callback`](https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#ga6165f07f4b619dd08ea6dc97d069e78a) function of the Pico SDK provides a convenient "one-stop shop" for specifying a callback function to invoke upon a voltage event on a GPIO pin. Create a simple program `InterruptCallbackSolution.lf` that prints the arguments to the callback function each time you press button A on the robot. (Use `printf` to a serial port for printing the arguments.)

**Hint:** To define a C function as part of a Lingua Franca program, use a [preamble](https://www.lf-lang.org/docs/handbook/preambles?target=c) within your reactor definition.

Expand Down

0 comments on commit a7f96aa

Please sign in to comment.