I2C code testing
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of COM_MNG_TMTC_SIMPLE_pl123 by
Revision 139:17353d6311ce, committed 2016-03-30
- Comitter:
- ee12b079
- Date:
- Wed Mar 30 14:04:48 2016 +0000
- Parent:
- 138:71ed56f2ec50
- Commit message:
- PL I2C worked
Changed in this revision
diff -r 71ed56f2ec50 -r 17353d6311ce COM_MNG_TMTC.h --- a/COM_MNG_TMTC.h Wed Mar 30 13:03:24 2016 +0000 +++ b/COM_MNG_TMTC.h Wed Mar 30 14:04:48 2016 +0000 @@ -1022,11 +1022,14 @@ t_pl.start(); if(rcv_isr == 1) { + #if DEBUG gPC.printf("read_ack = %d",read_ack); + #endif t_pl.stop(); + gPC.printf("data:\n"); //gPC.printf("i2c_t = %d",t_pl.read_ms()); - for(int i = 0;i< PL_TM_SIZE;i++) - tm_pointer->TM_string[i] = PL_I2C_DATA[i]; + for(int i = 0;i< 134;i++) + gPC.printf("%d\n",PL_I2C_DATA[i]); rcv_isr = 0; break; }
diff -r 71ed56f2ec50 -r 17353d6311ce COM_SND_TM.h --- a/COM_SND_TM.h Wed Mar 30 13:03:24 2016 +0000 +++ b/COM_SND_TM.h Wed Mar 30 14:04:48 2016 +0000 @@ -45,7 +45,7 @@ #define print_tm(ptr) {\ for( int i = 0; i < 134; i++ ){\ - gPC.putc(ptr[i]);\ + /* gPC.printf("%d\n",ptr[i]);*/\ }\ } @@ -266,6 +266,8 @@ DS_state = !DS_state;\ if (DS_f){\ DS_f = false;\ + if(bypass_adf)\ + print_tm(ptr);\ exor(ptr);\ convolution(ptr);\ interleave(convoluted_frame,interleave_data[0]);\
diff -r 71ed56f2ec50 -r 17353d6311ce adf.h --- a/adf.h Wed Mar 30 13:03:24 2016 +0000 +++ b/adf.h Wed Mar 30 14:04:48 2016 +0000 @@ -215,8 +215,6 @@ spi.write(0x20);\ for(unsigned char i=0; i<112;i++){\ spi.write(buffer_112[i]);\ - if(bypass_adf == 1)\ - gPC.putc(buffer_112[i]);\ }\ }\ else{\ @@ -224,8 +222,6 @@ spi.write(0x90);\ for(unsigned char i=0; i<112;i++){\ spi.write(buffer_112[i]);\ - if(bypass_adf == 1)\ - gPC.putc(buffer_112[i]);\ }\ }\ gCS_ADF=1;\
diff -r 71ed56f2ec50 -r 17353d6311ce i2c.h --- a/i2c.h Wed Mar 30 13:03:24 2016 +0000 +++ b/i2c.h Wed Mar 30 14:04:48 2016 +0000 @@ -106,6 +106,6 @@ void isr_pyldtm() { gLEDR=!gLEDR; - master.read(addr1,PL_I2C_DATA,134); + read_ack = master.read(addr1,PL_I2C_DATA,134); rcv_isr = 1; } \ No newline at end of file
diff -r 71ed56f2ec50 -r 17353d6311ce main.cpp --- a/main.cpp Wed Mar 30 13:03:24 2016 +0000 +++ b/main.cpp Wed Mar 30 14:04:48 2016 +0000 @@ -5,7 +5,7 @@ char PL_I2C_DATA[150];//Payload i2c array uint8_t rcv_isr = 0; // flag for interrupt -#define DEBUG 1 +#define DEBUG 0 #define SDCARD 0 #define I2C_PL 1 @@ -144,29 +144,6 @@ int i =0 ; char test[1] ; test[0] = 7; - while(1) - { - wait(5); - //test[0] = gPC.getc(); - gPC.printf("Wriring to I2C\n\r"); - - - - master.write(addr_pl|0x00,pia1,11); - - wait (2); - - if(rcv_isr == 1) - { - for(i = 0; i < 134 ; i++) - { - gPC.printf("%d\r\n",PL_I2C_DATA[i]); - PL_I2C_DATA[i] = 0 ; - } - rcv_isr = 0; - } - - } while(true){ Thread::wait(osWaitForever);