Commit Graph

98 Commits

Author SHA1 Message Date
Martin Preuss
b4c0ab273d avr: new com2 and timer stack basically works again. 2023-04-12 21:46:34 +02:00
Martin Preuss
18d34450e7 avr: started reworking COM module.
- sending and receiving now basically works again, but too often the
  read buffer is in use when trying to receive a message.
2023-04-12 15:30:52 +02:00
Martin Preuss
5ab35c666a changed order of calls. 2023-04-11 21:19:12 +02:00
Martin Preuss
c16fba0cf0 removed idle time calculation (doesn't work so far). 2023-04-10 23:48:24 +02:00
Martin Preuss
e440746ab5 avr: try calculating idle times. 2023-04-10 23:33:24 +02:00
Martin Preuss
773d44c220 avr: cleanup. 2023-04-10 01:41:21 +02:00
Martin Preuss
2bb298b106 avr: only include lcd strings if lcs module is used. 2023-04-10 01:02:25 +02:00
Martin Preuss
c84f12a228 added message MEMSTATS. 2023-04-10 01:01:48 +02:00
Martin Preuss
dc8fa1a840 avr: reworked timer code.
Allow for more tailored timers.
2023-04-10 01:00:58 +02:00
Martin Preuss
756017985e avr: some formatting. 2023-04-09 18:50:09 +02:00
Martin Preuss
e19b0ef8ac avr: added memstat message. 2023-04-09 18:49:50 +02:00
Martin Preuss
0f678d7d5a avr: cleanup, added labels to calculate module sizes. 2023-04-08 18:18:19 +02:00
Martin Preuss
4a915a3c85 avr: add copyright notices. 2023-04-08 13:05:05 +02:00
Martin Preuss
a7928e0dbf avr: added timer entry for every5s
This will be used for the window check module.
2023-04-08 03:09:12 +02:00
Martin Preuss
2a53ad9ede avr: removed unneeded defs. 2023-04-08 02:49:24 +02:00
Martin Preuss
5175ca7dfd avr: improved timer module.
- simplified timer handling. still using cascading counters but in an
  extendable way
- added onEvery5m while on it
- renamed everyMinute to every1m (unifies routine names)
- send network stats every 5m, not every minute
2023-04-08 02:23:34 +02:00
Martin Preuss
7eb462173c simplified message handling, switch from XOR checksum to CRC8 with polynomial 0x97.
0x97 allows for detection of all 1-3 bit errors in a message of up to
119 bytes
(see https://www.faa.gov/aircraft/air_cert/design_approvals/air_software/media/TC-14-49.pdf)
2023-04-07 23:22:40 +02:00
Martin Preuss
4e1f08b567 reworked com stack.
- prepared for use of CRC8
- organized code in more files
- recv stats message now contains crc errors and io errors
2023-04-07 19:14:05 +02:00
Martin Preuss
604a85d54b avr: increased COM buffer size to 24 bytes. 2023-04-05 23:39:45 +02:00
Martin Preuss
dc19b84fba avr: added message format descriptions. 2023-04-05 22:56:11 +02:00
Martin Preuss
dfd0f3b092 avr: started working on flash protocol. 2023-04-05 22:55:21 +02:00
Martin Preuss
c1efe538b0 avr: adapted to latest changes. 2023-04-05 22:55:01 +02:00
Martin Preuss
a104b78f62 some formatting. 2023-03-28 21:45:16 +02:00
Martin Preuss
c503132234 si7021: disable si7021ReadFirmwareRevision (doesn't work anyway). 2023-03-28 21:44:10 +02:00
Martin Preuss
4cc2e21a79 avr: moved code outside of ifdef/endif pair (fixes a bug). 2023-03-19 23:22:08 +01:00
Martin Preuss
e5401ee060 avr: increased number of COM buffers from 4 to 6. 2023-03-19 23:21:40 +01:00
Martin Preuss
0db8a14972 avr: added code and messages for device information.
- send firmware information in DEVICE message
- introduced new version of VALUE message (sending UID now instead of
  timestamp)
- make SENDSTATS and RECVSTATS messages also send UID instead of timestamp
2023-03-19 23:20:16 +01:00
Martin Preuss
9b7e72c3ad avr: add an initial wait time before starting the node.
This allows for desyncing of nodes to reduce COM collisions.
2023-03-19 13:26:03 +01:00
Martin Preuss
a0e45034fe avr: setup module mask to be later reported to a host. 2023-03-19 13:24:21 +01:00
Martin Preuss
ef6625d421 Shortened blink pattern. 2023-03-19 12:43:52 +01:00
Martin Preuss
267b2e83ff COM: Check for collisions after half a bit length.
Especially with longer cables we need to give the line some time to safely
raise the signal to high.
2023-03-19 12:43:33 +01:00
Martin Preuss
5612e20e11 Improved seeding for random number generation. 2023-03-08 23:02:20 +01:00
Martin Preuss
7dbe3a8e74 avr: started working on flash module. 2023-02-20 23:48:17 +01:00
Martin Preuss
f631d462c1 TIMER: improved module, added some callbacks. 2023-02-20 23:47:56 +01:00
Martin Preuss
08d6cab1e9 avr: started working on base system vs. main system.
base system will be a base system which can be used to flash and start
the main system.
2023-02-20 23:47:30 +01:00
Martin Preuss
5cfdaf5ffe Removed code no longer needed. 2023-02-06 21:55:36 +01:00
Martin Preuss
4d4bdf3203 main.asm: CLI while measuring and preparing packet. Directly call onSystemStart. 2023-02-06 21:55:10 +01:00
Martin Preuss
7e3dfa12fa comproto: Fixed a bug.
Was not saving low byte of value.
2023-02-06 21:54:04 +01:00
Martin Preuss
f0e4ac5595 Always use new shortened address assignment protocol if possible. 2023-02-06 21:11:24 +01:00
Martin Preuss
e5a4f1b1e6 main: only send value messages if we have an address. 2023-02-06 21:10:41 +01:00
Martin Preuss
d56cbd6f25 AVR: More work on address assignment procedure. 2023-02-06 21:09:38 +01:00
Martin Preuss
716248c4e1 Implemented address assignment protocol. 2023-02-05 23:43:16 +01:00
Martin Preuss
0acb92d3cb Moved routine sendValueMsg to Main_SendValueMsg in main.asm. Removed debug code. 2023-02-05 15:38:32 +01:00
Martin Preuss
1adb74aaef comproto: simplified some enqueue routines. Renamed i2c to twi.
- simplified CPRO_EnqueueComSendStats
- simplified CPRO_EnqueueValue
- renamed i2c to twi
2023-02-05 15:37:47 +01:00
Martin Preuss
5a2de1df18 comproto: started simplifying code to prepare and enqueue packets. 2023-02-05 14:57:38 +01:00
Martin Preuss
29e2054ab9 Call UID generator (if necessary). 2023-02-04 16:02:18 +01:00
Martin Preuss
11c167171a COMPROTO: Added CPRO_EnqueueNeedAddress 2023-02-04 16:01:48 +01:00
Martin Preuss
e36d06d00d Added tests for pseudo random generator. 2023-02-04 16:01:32 +01:00
Martin Preuss
369ad2a27e Timer: Added callback onSystemStart 2023-02-04 16:01:09 +01:00
Martin Preuss
40710a003a Utils: Added pseudo random generator. 2023-02-04 16:00:50 +01:00