summaryrefslogtreecommitdiff
path: root/prototype/fw/src
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2020-11-27 18:48:54 +0100
committerjaseg <git@jaseg.de>2020-11-27 18:48:54 +0100
commit2967dcee39e937248c21df59e6dbdd6336f8f9fb (patch)
tree6aa2fcae4614b9d874c149694ff1430c369271fd /prototype/fw/src
parent822c8a21d7fd834a75be20765be4b4f2e5133009 (diff)
downloadihsm-2967dcee39e937248c21df59e6dbdd6336f8f9fb.tar.gz
ihsm-2967dcee39e937248c21df59e6dbdd6336f8f9fb.tar.bz2
ihsm-2967dcee39e937248c21df59e6dbdd6336f8f9fb.zip
Bidir optical comms working
Diffstat (limited to 'prototype/fw/src')
-rw-r--r--prototype/fw/src/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/prototype/fw/src/main.c b/prototype/fw/src/main.c
index 51e69e8..0998fce 100644
--- a/prototype/fw/src/main.c
+++ b/prototype/fw/src/main.c
@@ -73,18 +73,20 @@ int main(void) {
int i = 0;
while (23) {
if (tx_st.remaining_bytes == 0) {
- if (i > 10000) {
+ if (i > 1000) {
res_buf.req_seq = req_seq;
res_buf.res_seq = res_seq;
res_seq += 1;
- //packetize(&res_buf, &res_buf.trailer);
+ packetize(&res_buf, &res_buf.trailer);
tx_st.tx_char = tx_buf;
- //tx_st.remaining_bytes = cobs_encode((uint8_t *)&res_buf, sizeof(res_buf), tx_buf, sizeof(tx_buf));;
+ tx_st.remaining_bytes = cobs_encode((uint8_t *)&res_buf, sizeof(res_buf), tx_buf, sizeof(tx_buf));;
+ /*
for (int k=0; k < 8; k++)
tx_buf[k] = 255-k;
for (int k=0; k < 8; k++)
tx_buf[8+k] = (k + 1) % 8;
tx_st.remaining_bytes = 16;
+ */
i = 0;
} else {
i++;