From 7b5e4772ea3c85a92ba2c904dc9dd050cb2e530c Mon Sep 17 00:00:00 2001 From: Will Toohey Date: Tue, 6 Apr 2021 20:30:47 +1000 Subject: [PATCH] Clarify p4io_cmd_init's lack of response checking --- src/main/p4iodrv/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/p4iodrv/device.c b/src/main/p4iodrv/device.c index e13e326..279964d 100644 --- a/src/main/p4iodrv/device.c +++ b/src/main/p4iodrv/device.c @@ -87,7 +87,10 @@ static bool p4io_send(struct p4iodrv_ctx *ctx, uint8_t cmd) { return p4io_transfer(ctx, cmd, NULL, 0, NULL, 0); } -// real IO does not check the return value, so neither do we +// Real IO does not check the return value, so neither do we. +// Even if we were to check the return value here, the reset command returns a 0 +// byte response - not even an "OK" status, 0 bytes in total. That technically +// should be raising an error, but because reset is a special case it's ignored static void p4io_cmd_init(struct p4iodrv_ctx *ctx) { p4io_send(ctx, P4IO_CMD_INIT); }