mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-05-02 06:26:24 -04:00
Phase sync experiments
This commit is contained in:
parent
13873775e8
commit
f42f6d8bae
4 changed files with 24 additions and 3 deletions
|
@ -1,7 +1,11 @@
|
|||
#include "mp1.h"
|
||||
#include "hardware.h"
|
||||
#include <string.h>
|
||||
#include <drv/ser.h>
|
||||
|
||||
static int okC; // FIXME: remove
|
||||
static int erC;
|
||||
|
||||
static void mp1Decode(MP1 *mp1) {
|
||||
// This decode function is basic and bare minimum.
|
||||
// It does nothing more than extract the data
|
||||
|
@ -41,9 +45,11 @@ void mp1Poll(MP1 *mp1) {
|
|||
// kprintf("Got checksum: %d.\n", mp1->buffer[mp1->packetLength-1]);
|
||||
if ((mp1->checksum_in & 0xff) == 0x00) {
|
||||
//kprintf("Correct checksum. Found %d.\n", mp1->buffer[mp1->packetLength-1]);
|
||||
kprintf("[OK%d] ", okC++);
|
||||
mp1Decode(mp1);
|
||||
} else {
|
||||
// Checksum was incorrect
|
||||
kprintf("[ER%d] ", erC++);
|
||||
mp1Decode(mp1);
|
||||
//kprintf("Incorrect checksum. Found %d, ", mp1->buffer[mp1->packetLength]);
|
||||
//kprintf("should be %d\n", mp1->checksum_in);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue