diff options
Diffstat (limited to 'software/hhd70dongle/hhd70dongle.c')
-rw-r--r-- | software/hhd70dongle/hhd70dongle.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c index 3d7fa95..c221ffc 100644 --- a/software/hhd70dongle/hhd70dongle.c +++ b/software/hhd70dongle/hhd70dongle.c @@ -47,9 +47,10 @@ uint8_t read_buffer[64]; // buffer for reading usb signals uint8_t write_buffer[64]; // buffer for writing usb signals //TODOs: +// * remove code duplications +// * speed up and simplify code // * make as much use of sleep modes as possible // * use adc noise canceler (i.e. automatic sampling during cpu sleep) -// * define and listen for an usb_hid reset command -> jump to bootload address // * read atmega temp // * safely save state in eeprom (2 memory regions, only use the one with the "written successfully bit" which is written last) @@ -67,7 +68,9 @@ int main(void) //usb_rawhid_send(write_buffer, 23); usb_rawhid_send((uint8_t*)"hhd70dongle ready",17); - + + c1101_init(); + for(;;) { _delay_ms(250); @@ -90,6 +93,17 @@ int main(void) usb_rawhid_send((uint8_t*)"c1101 version:",255); debug_sprint_int16hex(write_buffer, c1101_getVersion()); usb_rawhid_send(write_buffer,255); + _delay_ms(250); + usb_rawhid_send((uint8_t*)"c1101 freq0:",255); + debug_sprint_int16hex(write_buffer, spi_c1101_read_register(SPIC1101_ADDR_FREQ0)); + usb_rawhid_send(write_buffer,255); + usb_rawhid_send((uint8_t*)"c1101 freq1:",255); + debug_sprint_int16hex(write_buffer, spi_c1101_read_register(SPIC1101_ADDR_FREQ1)); + usb_rawhid_send(write_buffer,255); + usb_rawhid_send((uint8_t*)"c1101 freq2:",255); + debug_sprint_int16hex(write_buffer, spi_c1101_read_register(SPIC1101_ADDR_FREQ2)); + usb_rawhid_send(write_buffer,255); + //~ char buf[10]; //~ unsigned int len; //~ spi_read(sizeof(buf),buf,&len); |