Commit Graph

26 Commits

Author SHA1 Message Date
Sebastián Mestre ddb6952f00 Isobuffer refactor - Part 3 (#66)
* Start moving towards cstdint types. Change m_bufferEnd to m_bufferLen (i.e. dont substract 1 when constructing), this fixes a bunch of small bugs and off by one errors

* Fix loop in isoBuffer::getDelayedTriggerPoint not touching the first element

* Comments, formatting

* Reorder some of isobuffer.cpp's functions

* Fix compile error caused by not fully renaming a variable

* Fix some off-by-one errors

* formatting

* Tabs -> Spaces
2019-02-12 18:32:16 +11:00
Sebastián Mestre 015d41624d Isobuffer refactor (#64)
* make isobuffer.cpp follow the common bracket style

* Add a few utility functions to isoBuffer, and reorganize and comment isobuffer.h

* refactor a few functions in isoBuffer using the newly added functions

* Clean up isoBuffer::readBuffer. Requires particular attention during review

* remove unused variable isoBuffer::firstTime

* Fix formatting and add a comment to isoBuffer::maybeOutputSampleToFile

* move invariant out of loop in isoBuffer::writeBuffer_short

* Substantially refactor isoBuffer::readBuffer

* change spaces to tabs on isoBuffer.h

* spaces to tabs on isobuffer.cpp and isobuffer.h, but properly

* Enforce const correctness on some methods of isoBuffer

* Add some comments to isobuffer.cpp

* Remove duplication in isoBuffer::cap_xnfromxxx functions by extracting common functionality to a free function

* Format isobuffer.h and isobuffer.cpp

* add inserted count to isoBuffer

* further modification to isoBuffer::readBuffer

* Correct a comment in isoBuffer::readBuffer

* add an anonymous namespace with file-wide constants

* remove isoBuffer::openFile, and move initialization isoBuffer to initializer list

* add lines between if statements in isoBuffer::insertIntoBuffer

* add spaces after // to some comments

* extract common functionality from writeBuffer_xxx functions to function template

* update header file to reflect previous commits

* make isoBuffer::return nullptr in a troublesome case

* add space after // to some other comments

* Make capSample a member function of isoBuffer, delete a macro in isobuffer.cpp

* clean up various comments and declarations in isobuffer.cpp

* make isoBuffer::gainBuffer work for any gain value

* make enableFileIO use the constant definitions made in a recent commit

* Remove type argument from isoBuffer::serialManage

* make isoBuffer::readBuffer return a zero-filled buffer instead of null

* Remove isoBuffer::glitchInsert

* Add a bunch of TODOs to isobuffer.cpp and isobuffer.h

* Rename member variables of isoBuffer to have an m_ prefix

* Move isoBuffer::capSample comparison functors to anonymous namespace

* Make CONSOLE_UPDATE_TIMER_PERIOD on isobuffer.h a constexpr intead of a macro
2019-01-23 16:13:40 +11:00
Sebastián Mestre 4499db10bf Isobufferbuffer integration (#62)
* Update all code to use the new isoBufferBuffer interface, and remove the old one; also rename isoBufferBuffer::add(uint8_t) to insert_hex

* remove unnecessary include directive from isobuffer.h

* Remove 'Legacy Interface' comment from isoBufferBuffer header and implementation, move insert_hex closer to other insert functions in the header and implementation

* Remove TODO comment of a finished task
2018-12-31 10:02:04 +11:00
Chris Esposito 672cf414d1 isobufferbuffer can take uint8_t 2018-11-06 10:55:45 +11:00
Chris Esposito effeb8ed4a Data decode _should_ work (untested) 2018-11-06 10:46:47 +11:00
Chris Esposito b5069f1264 Address gets sent to console along with r/w and ACK 2018-11-06 10:36:04 +11:00
Chris Esposito b19900e9a0 IsoBufferBuffer cleaned 2018-11-06 10:15:48 +11:00
Chris Esposito bdf1055157 Decodes address bytes 2018-11-06 09:50:36 +11:00
Chris Esposito e63a97e23a I2C start condition does not get detected as stop 2018-11-04 11:46:17 +11:00
Chris Esposito 124bcd3a61 Timings approximately correct for i2c 2018-11-04 11:31:48 +11:00
Chris Esposito e5bfb2e748 i2c state invalidation fix 2018-11-04 10:49:10 +11:00
Chris Esposito 2772fee1cd i2c state invalidation 2018-11-04 10:47:25 +11:00
Chris Esposito 0f00af0c08 i2c decoder no longer tries to read invalid buffer region 2018-11-04 10:36:11 +11:00
Chris Esposito d65b647ab4 Fixed some I2C edge detection issues 2018-11-04 10:07:15 +11:00
Chris Esposito dde6d6ac42 Started Debugging i2c 2018-09-04 18:55:03 +10:00
Chris Esposito ba4644bc35 i2c clock multiplication in place 2018-08-14 17:40:55 +10:00
EspoTek b112f5b691 Fixed build problems. 2018-08-12 16:21:05 +10:00
Chris Esposito ca86c1da0a basic i2c skeleton in place and fleshed out. Have to get the timings right (e.g. data bytes should only be read in on the middle of each scl high pulse) and then debug but coming together 2018-08-08 19:20:32 +10:00
Chris Esposito b5afeff380 more... 2018-08-08 19:14:08 +10:00
Chris Esposito a998a59a60 more fleshing...: 2018-08-08 18:58:41 +10:00
Chris Esposito 95b4a01d81 More fleshed out state machine 2018-08-08 18:35:26 +10:00
Chris Esposito 091c37cd37 START and STOP transitions in state machine 2018-08-08 09:31:05 +10:00
Chris Esposito b414923fd3 more i2c flesh 2018-08-08 09:19:30 +10:00
Chris Esposito 634a046097 more i2 skeleton 2018-08-02 18:27:09 +10:00
Chris Esposito 4c61a0a327 another i2c function 2018-07-31 09:05:58 +10:00
Chris Esposito d1ac3618f5 very basic skellington code for i2c in 2018-07-27 18:39:13 +10:00