diff --git a/driver/drv/b15f.cpp b/driver/drv/b15f.cpp index fd11ab4..aa9c449 100644 --- a/driver/drv/b15f.cpp +++ b/driver/drv/b15f.cpp @@ -49,6 +49,7 @@ void B15F::init() if(!testConnection()) continue; + if(!testIntConv()) continue; @@ -106,7 +107,6 @@ bool B15F::testConnection() usart.writeByte(RQ_TEST); usart.writeByte(dummy); - usart.writeByte(0x80); uint8_t aw = usart.readByte(); uint8_t mirror = usart.readByte(); @@ -121,7 +121,6 @@ bool B15F::testIntConv() usart.writeByte(RQ_INT); usart.writeInt(dummy); - usart.writeByte(0x80); uint16_t aw = usart.readInt(); return aw == dummy * 3; @@ -133,7 +132,6 @@ std::vector B15F::getBoardInfo(void) std::vector info; usart.writeByte(RQ_INFO); - usart.writeByte(0x80); uint8_t n = usart.readByte(); while(n--) @@ -228,10 +226,13 @@ bool B15F::analogSequence(uint8_t channel_a, uint16_t* buffer_a, uint32_t offset usart.writeInt(start); usart.writeInt(static_cast(delta)); usart.writeInt(count); + + /* uint8_t aw = usart.readByte(); if(aw != MSG_OK) throw DriverException("Mikrocontroller nicht synchron"); + */ for(uint16_t i = 0; i < count; i++) { @@ -239,7 +240,7 @@ bool B15F::analogSequence(uint8_t channel_a, uint16_t* buffer_a, uint32_t offset buffer_b[i] = usart.readInt(); } - aw = usart.readByte(); + uint8_t aw = usart.readByte(); if(aw == MSG_OK) return aw; diff --git a/driver/drv/b15f.o b/driver/drv/b15f.o index 5860c8c..0a9c58b 100644 Binary files a/driver/drv/b15f.o and b/driver/drv/b15f.o differ diff --git a/driver/main b/driver/main index 2538000..3370cd8 100755 Binary files a/driver/main and b/driver/main differ diff --git a/driver/main.cpp b/driver/main.cpp index 40dc56c..320629e 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -129,17 +129,21 @@ void testFunktionen() std::cout << "adc: " << (int) drv.analogRead(4) << std::endl; + std::cout << "Kennlinie..." << std::endl; uint16_t a[1024]; uint16_t b[1024]; drv.analogSequence(0, &a[0], 0, 1, &b[0], 0, 0, 1, 1024); - + for(uint16_t i= 0; i < sizeof(a) / sizeof(uint16_t); i++) + { + std::cout << (int) i << " : " << a[i] << " " << b[i] << std::endl; + } } int main() { - kennlinieZweiterQuadrant(); + testFunktionen(); std::cout << "Schluss." << std::endl; } diff --git a/driver/main.o b/driver/main.o index c3c698d..d905bc5 100644 Binary files a/driver/main.o and b/driver/main.o differ