Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of standaloneworkingi2c_cdms by
Revision 160:25a01d8da5d4, committed 2016-07-06
- Comitter:
- prasanthbj05
- Date:
- Wed Jul 06 10:17:44 2016 +0000
- Parent:
- 159:390ca9b41d0e
- Commit message:
- cdms_i2c_hardware;
Changed in this revision
--- a/COM_MNG_TMTC.h Mon Jul 04 20:58:30 2016 +0000
+++ b/COM_MNG_TMTC.h Wed Jul 06 10:17:44 2016 +0000
@@ -1016,7 +1016,6 @@
while(1)
{
- gLEDG = !gLEDG;
t_pl.start();
if(rcv_isr == 1)
{
@@ -1264,9 +1263,6 @@
gMASTER_STATE = TCL_STATE_EXECUTING;\
/*gPC.printf("%u\r\n", gTOTAL_VALID_TC);*/\
for(uint8_t execute_psc = PSC_START_VALUE ; execute_psc < gTOTAL_VALID_TC ; ++execute_psc ){\
- /*gPC.printf("executing normal %u\r\n", execute_psc);*/\
- /*gLEDG = !gLEDG;*/\
- /*gLEDR = !gLEDR;*/\
Base_tc* current_TC = gHEAD_NODE_TCL;\
int overflowCount = 0;\
while(current_TC != NULL){\
--- a/DefinitionsAndGlobals.h Mon Jul 04 20:58:30 2016 +0000 +++ b/DefinitionsAndGlobals.h Wed Jul 06 10:17:44 2016 +0000 @@ -125,8 +125,17 @@ // ****************GLOBAL VARIABLES****************** // DEBUG Serial gPC( USBTX, USBRX ); -DigitalOut gLEDR(LED_RED); -DigitalOut gLEDG(LED_GREEN); + +DigitalOut gLED1(LED1); +DigitalOut gLED2(LED2); +DigitalOut gLED3(LED3); +DigitalOut gLED4(LED4); + + //LEDs + #define LED1 PTB7 + #define LED2 PTB17 + #define LED3 PTB16 + #define LED4 PTB11 // COM_RX RawSerial RX1M( COM_RX_UART_TX, COM_RX_UART_RX );
--- a/ThreadsAndFunctions.h Mon Jul 04 20:58:30 2016 +0000
+++ b/ThreadsAndFunctions.h Wed Jul 06 10:17:44 2016 +0000
@@ -70,8 +70,6 @@
void COM_MNG_TMTC_FUN(void const *args){
if( !(gFLAGS & COM_SESSION_FLAG) ){
- //gLEDR = 1;
- //gLEDG = 1;
}
while(true){
Thread::signal_wait( COM_MNG_TMTC_SIGNAL_UART_INT );
@@ -85,18 +83,12 @@
PUT_RAW_BYTE;
// PENDING : MEASURE RSSI
if( gFLAGS & COM_SESSION_FLAG ){
- //gLEDR = 0;
- //gLEDG = 0;
}
}
else if( gFLAGS & COM_RX_FLAG ){
- //gLEDR = 0;
- //gLEDG = 1;
PUT_RAW_BYTE;
}
else{
- //gLEDR = 1;
- //gLEDG = 0;
gFLAGS = gFLAGS | COM_RX_FLAG;
PUT_RAW_BYTE;
}
@@ -150,7 +142,7 @@
#endif
// DEBUF_PRINT("EXECUTING TELECOMMANDS\r\n");
EXECUTE_OBOSC_ONLY;
- EXECUTE_TC;
+ //EXECUTE_TC;
/*gPC.puts("COMPLETED EXECUTION\r\n");*/
}
else{
@@ -250,7 +242,7 @@
gCOM_PA_COOLING_TIMEOUT.detach();
COM_POWER_ON_TX;
EXECUTE_OBOSC_ONLY;
- EXECUTE_TC;
+ //EXECUTE_TC;
}
}
}
--- a/i2c.h Mon Jul 04 20:58:30 2016 +0000
+++ b/i2c.h Wed Jul 06 10:17:44 2016 +0000
@@ -395,11 +395,4 @@
return write_ack;
//gPC.printf("\n\r %d \n",t.read_us());
//t.reset();
-}
-void isr_pyldtm()
-{
-
- read_ack = master.read(addr_pl|1,PL_I2C_DATA,134);
- gLEDR=!gLEDR;
- rcv_isr = 1;
}
\ No newline at end of file
--- a/main.cpp Mon Jul 04 20:58:30 2016 +0000
+++ b/main.cpp Wed Jul 06 10:17:44 2016 +0000
@@ -222,6 +222,33 @@
ptr_t_i2c->signal_set(0x4);
}
+void blink2(float delay)
+{
+ for(uint8_t i=0;i<20;i++)
+ {
+ gLED2 = !gLED2;
+ wait(delay);
+ }
+ gLED2 = 0;
+}
+void blink3(float delay)
+{
+ for(uint8_t i=0;i<20;i++)
+ {
+ gLED3 = !gLED3;
+ wait(delay);
+ }
+ gLED3 = 0;
+}
+void blink4(float delay)
+{
+ for(uint8_t i=0;i<20;i++)
+ {
+ gLED4 = !gLED4;
+ wait(delay);
+ }
+ gLED4 = 0;
+}
int main()
{
CDMS_I2C_GPIO = 0;
@@ -370,7 +397,7 @@
bool write_ack=1,read_ack=1;
wait(5);
- while(q<250)
+ while(q<1)
{
//printf("\n\rSize:%d\t\tdelay:%d",arr[q][0],arr[q][1]);
wait(arr1[q][1]);
@@ -388,9 +415,14 @@
wait(1); //should poll instead of wait
if(write_ack==0)
{
+ blink2(1);
if(BAE_I2C_GPIO == 1)
{
read_ack = FCTN_I2C_READ((char*)TM,arr1[q][2]);
+ if(read_ack == 0)
+ blink3(1);
+ else if(read_ack ==1)
+ blink3(0.3);
}
else
{
@@ -405,6 +437,8 @@
}
write_ack=1;
}
+ else if (write_ack ==1)
+ blink2(0.3);
i2c_mutex.unlock();
//gPC.printf("\n\rMutex Unlocked by Main");
//gPC.printf("\n\Flag = %d",temp_flag);
@@ -446,7 +480,8 @@
while(true){
Thread::wait(osWaitForever);
//state = gCOM_MNG_TMTC_THREAD->get_state() + '0';
- gLEDG = !gLEDG;
+ gLED1 = !gLED1;
+ //wait(1);
//gPC.putc(state);
}
}
\ No newline at end of file
