Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/libfx2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ae4faf1eedae
Choose a base ref
...
head repository: whitequark/libfx2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 81f4998a243b
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 19, 2019

  1. Copy the full SHA
    81f4998 View commit details
Showing with 4 additions and 1 deletion.
  1. +4 −1 firmware/library/include/fx2debug.h
5 changes: 4 additions & 1 deletion firmware/library/include/fx2debug.h
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@

#define _DEBUG_FN_DIV(a, b) (((a)+(b)/2+1)/(b))

// This implementation not only keeps overhead to absolute minimum, but it also takes great care
// to execute in constant time per bit to minimize clock drift.
#define _DEBUG_FN(retty, name, argty, tx, baud) \
retty name(argty c) __naked { \
c; \
@@ -99,7 +101,8 @@
* This macro defines a function `void name(uint8_t c)` that implements a robust blocking serial
* transmitter for debug output. The `tx` parameter may point to any pin, and is defined in
* the format `Pxn`. The serial format is fixed at 8 data bits, no parity, 1 stop bit, and
* the baud rate is configurable, up to 115200 at 48 MHz and 24 MHz, and up to 57600 at 12 MHz.
* the baud rate is configurable, up to 230400 at 48 MHz, up to 115200 at 24 MHz, and up to
* 57600 at 12 MHz.
*
* For example, invoking the macro as `DEFINE_DEBUG_FN(tx_byte, PA0, 57600)` defines a routine
* `void tx_byte(uint8_t c)` that assumes an UART receiver's RX pin is connected to A0.