mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-06-06 22:08:57 -04:00
More commenting
This commit is contained in:
parent
9ab8eaa020
commit
fd6fbf7018
2 changed files with 7 additions and 1 deletions
|
@ -565,6 +565,7 @@ uint8_t afsk_dac_isr(Afsk *afsk) {
|
||||||
// Handy for sending and receiving data :) //
|
// Handy for sending and receiving data :) //
|
||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Read from the modem
|
||||||
static size_t afsk_read(KFile *fd, void *_buf, size_t size) {
|
static size_t afsk_read(KFile *fd, void *_buf, size_t size) {
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
Afsk *afsk = AFSK_CAST(fd);
|
||||||
uint8_t *buffer = (uint8_t *)_buf;
|
uint8_t *buffer = (uint8_t *)_buf;
|
||||||
|
@ -593,6 +594,7 @@ static size_t afsk_read(KFile *fd, void *_buf, size_t size) {
|
||||||
return buffer - (uint8_t *)_buf;
|
return buffer - (uint8_t *)_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write to the modem
|
||||||
static size_t afsk_write(KFile *fd, const void *_buf, size_t size) {
|
static size_t afsk_write(KFile *fd, const void *_buf, size_t size) {
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
Afsk *afsk = AFSK_CAST(fd);
|
||||||
const uint8_t *buf = (const uint8_t *)_buf;
|
const uint8_t *buf = (const uint8_t *)_buf;
|
||||||
|
@ -609,6 +611,7 @@ static size_t afsk_write(KFile *fd, const void *_buf, size_t size) {
|
||||||
return buf - (const uint8_t *)_buf;
|
return buf - (const uint8_t *)_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Waits for the write operation to finish
|
||||||
static int afsk_flush(KFile *fd) {
|
static int afsk_flush(KFile *fd) {
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
Afsk *afsk = AFSK_CAST(fd);
|
||||||
while (afsk->sending) {
|
while (afsk->sending) {
|
||||||
|
@ -617,6 +620,8 @@ static int afsk_flush(KFile *fd) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check whether there was any errors
|
||||||
|
// while reading or writing
|
||||||
static int afsk_error(KFile *fd) {
|
static int afsk_error(KFile *fd) {
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
Afsk *afsk = AFSK_CAST(fd);
|
||||||
int err;
|
int err;
|
||||||
|
@ -624,6 +629,7 @@ static int afsk_error(KFile *fd) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allows resetting the error-state
|
||||||
static void afsk_clearerr(KFile *fd) {
|
static void afsk_clearerr(KFile *fd) {
|
||||||
Afsk *afsk = AFSK_CAST(fd);
|
Afsk *afsk = AFSK_CAST(fd);
|
||||||
ATOMIC(afsk->status = 0);
|
ATOMIC(afsk->status = 0);
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define VERS_BUILD 383
|
#define VERS_BUILD 387
|
||||||
#define VERS_HOST "vixen"
|
#define VERS_HOST "vixen"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue