aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/include/psxsio.h
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2022-10-23 15:03:16 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2022-10-23 15:03:16 +0200
commit5f25c0bf306d316c87fca9d3fe160d6661be230d (patch)
tree399317390f789c0a9f4a9f5a342ca8233cb1b313 /libpsn00b/include/psxsio.h
parentb1632d7df0e840692612461a80d0e05d6a3228ed (diff)
downloadpsn00bsdk-5f25c0bf306d316c87fca9d3fe160d6661be230d.tar.gz
Library bugfixes and additions, _sdk_log_inner() removal
Diffstat (limited to 'libpsn00b/include/psxsio.h')
-rw-r--r--libpsn00b/include/psxsio.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/libpsn00b/include/psxsio.h b/libpsn00b/include/psxsio.h
index e0cc49b..d5f7d9a 100644
--- a/libpsn00b/include/psxsio.h
+++ b/libpsn00b/include/psxsio.h
@@ -145,15 +145,19 @@ int SIO_ReadSync(int mode);
/**
* @brief Registers a function to be called whenever a byte is received. The
- * received byte is appended to the RX buffer and passed as an argument to the
- * callback. The callback will run in the exception handler's context, so it
- * should be as fast as possible and not use any function that relies on
- * interrupts in order to work.
+ * received byte is passed as an argument to the callback, which shall then
+ * return a zero value to also store the byte in the RX buffer or a non-zero
+ * value to drop it. This can be used to e.g. filter or validate incoming data,
+ * or to bypass the library's RX buffer for custom buffering purposes.
+ *
+ * The callback will run in the exception handler's context, so it should be as
+ * fast as possible and shall not call any function that relies on interrupts
+ * being enabled.
*
* @param func
* @return Previously set callback or NULL
*/
-void *SIO_ReadCallback(void (*func)(uint8_t));
+void *SIO_ReadCallback(int (*func)(uint8_t));
/**
* @brief Sends the given byte, or appends it to the TX buffer if the serial