diff options
author | px4dev <px4@purgatory.org> | 2013-07-05 19:02:42 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-07-05 19:02:42 -0700 |
commit | 10e673aa4b16a7b50656962b4ead7fa87fa94d59 (patch) | |
tree | 31929e8891ccb122cabadc891956176c082bde0c /src/modules/px4iofirmware | |
parent | 46a4a443210b73be01da5d63f9cef955658347ee (diff) | |
download | px4-firmware-10e673aa4b16a7b50656962b4ead7fa87fa94d59.tar.gz px4-firmware-10e673aa4b16a7b50656962b4ead7fa87fa94d59.tar.bz2 px4-firmware-10e673aa4b16a7b50656962b4ead7fa87fa94d59.zip |
Send error response if register write fails.
Diffstat (limited to 'src/modules/px4iofirmware')
-rw-r--r-- | src/modules/px4iofirmware/serial.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/px4iofirmware/serial.c b/src/modules/px4iofirmware/serial.c index 38cfd3ccf..e170d5bdf 100644 --- a/src/modules/px4iofirmware/serial.c +++ b/src/modules/px4iofirmware/serial.c @@ -216,8 +216,12 @@ rx_dma_callback(DMA_HANDLE handle, uint8_t status, void *arg) if (PKT_CODE(dma_packet) == PKT_CODE_WRITE) { /* it's a blind write - pass it on */ - if (registers_set(dma_packet.page, dma_packet.offset, &dma_packet.regs[0], PKT_COUNT(dma_packet))) + if (registers_set(dma_packet.page, dma_packet.offset, &dma_packet.regs[0], PKT_COUNT(dma_packet))) { perf_count(pc_regerr); + dma_packet.count_code = PKT_CODE_ERROR; + } else { + dma_packet.count_code = PKT_CODE_SUCCESS; + } } else { |