mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-16 21:32:49 +02:00
libubb/swuart.c: only return error codes or fail silently; don't print messages
This commit is contained in:
parent
506db2d69e
commit
5f3828f710
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
@ -238,10 +237,8 @@ int swuart_open(uint32_t tx, uint32_t rx, int bps)
|
|||||||
* Make sure code and rx/tx buffers are locked into memory before we
|
* Make sure code and rx/tx buffers are locked into memory before we
|
||||||
* disable interrupts in swuart_trx.
|
* disable interrupts in swuart_trx.
|
||||||
*/
|
*/
|
||||||
if (mlockall(MCL_CURRENT | MCL_FUTURE)) {
|
if (mlockall(MCL_CURRENT | MCL_FUTURE))
|
||||||
perror("mlockall");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
ticks = TCLK/bps-1;
|
ticks = TCLK/bps-1;
|
||||||
tx_mask = tx;
|
tx_mask = tx;
|
||||||
@ -257,6 +254,5 @@ int swuart_open(uint32_t tx, uint32_t rx, int bps)
|
|||||||
|
|
||||||
void swuart_close(void)
|
void swuart_close(void)
|
||||||
{
|
{
|
||||||
if (munlockall())
|
munlockall();
|
||||||
perror("munlockall");
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user