basic improvements, XOR'D 0x55 before xmit

This commit is contained in:
jjwbruijn
2023-04-01 17:06:26 +02:00
parent 984f46c4f1
commit 55b254fdec
2 changed files with 10 additions and 8 deletions

8
zbs243_Tag_FW/syncedproto.c Normal file → Executable file
View File

@@ -569,7 +569,7 @@ static bool getDataBlock(const uint16_t blockSize) {
pr("failed getting block\n");
return false;
}
uint16_t __xdata dataRequestSize = 0;
static bool downloadFWUpdate(const struct AvailDataInfo *__xdata avail) {
// check if we already started the transfer of this information & haven't completed it
if (xMemEqual((const void *__xdata) & avail->dataVer, (const void *__xdata) & curDataInfo.dataVer, 8) && curDataInfo.dataSize) {
@@ -585,7 +585,6 @@ static bool downloadFWUpdate(const struct AvailDataInfo *__xdata avail) {
while (curDataInfo.dataSize) {
wdt10s();
static uint16_t __xdata dataRequestSize;
if (curDataInfo.dataSize > BLOCK_DATA_SIZE) {
// more than one block remaining
dataRequestSize = BLOCK_DATA_SIZE;
@@ -608,8 +607,10 @@ static bool downloadFWUpdate(const struct AvailDataInfo *__xdata avail) {
// no more data, download complete
return true;
}
uint16_t __xdata imageSize = 0;
static bool downloadImageDataToEEPROM(const struct AvailDataInfo *__xdata avail) {
static uint16_t __xdata imageSize = 0;
// check if we already started the transfer of this information & haven't completed it
if (xMemEqual((const void *__xdata) & avail->dataVer, (const void *__xdata) & curDataInfo.dataVer, 8) && curDataInfo.dataSize) {
// looks like we did. We'll carry on where we left off.
@@ -646,7 +647,6 @@ static bool downloadImageDataToEEPROM(const struct AvailDataInfo *__xdata avail)
while (curDataInfo.dataSize) {
wdt10s();
static uint16_t __xdata dataRequestSize;
if (curDataInfo.dataSize > BLOCK_DATA_SIZE) {
// more than one block remaining
dataRequestSize = BLOCK_DATA_SIZE;

View File

@@ -1,4 +1,5 @@
#include "uart.h"
#include "cpu.h"
#ifdef AP_FW
@@ -12,9 +13,10 @@ void uartInit(void) {
// configure baud rate
UARTBRGH = 0x00;
#ifdef AP_FW
//UARTBRGL = 69; // nice. 230400 baud
UARTBRGL = 70; // 79 == 200k
// UARTBRGL = 69; // nice. 230400 baud
//UARTBRGL = 70; // 79 == 200k
IEN_UART0 = 1;
UARTBRGL = 0x8A; // config for 115200
#else
UARTBRGL = 0x8A; // config for 115200
#endif
@@ -83,7 +85,7 @@ void UART_IRQ1(void) __interrupt(0) {
if (UARTSTA & 1) { // RXC
UARTSTA &= 0xfe;
if (serialBypassActive) {
*blockp++ = UARTBUF;
*blockp++ = 0xAA ^ UARTBUF;
if (blockp == (blockbuffer + 4100)) {
serialBypassActive = false;
blockp = blockbuffer;
@@ -91,7 +93,7 @@ void UART_IRQ1(void) __interrupt(0) {
} else {
rxbuf[rxhead] = UARTBUF;
rxhead++;
//checkcommand(UARTBUF);
// checkcommand(UARTBUF);
}
}
if (UARTSTA & 2) { // TXC