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 COM_MNG_TMTC_SIMPLE by
Diff: adf.h
- Revision:
- 17:6eb9387f1fb8
- Parent:
- 9:e9eaada136c6
--- a/adf.h Thu Dec 31 18:35:59 2015 +0000
+++ b/adf.h Fri Jan 01 06:36:18 2016 +0000
@@ -1,13 +1,19 @@
//without reset feature , with state checks.
-InterruptIn IRQ(ADF_IRQ);
-Ticker ticker;
+uint8_t signal = 0x00;
+
+void adf_irq_check(void const *n){
+ if(gIRQ){
+ gCOM_MNG_TMTC_THREAD->signal_set(signal);
+ }
+}
+
+RtosTimer gADF_TICKER(adf_irq_check, osTimerPeriodic, (void *)0);
bool sent_tmfrom_SDcard;
bool loop_on;
bool ADF_off;
bool buffer_state;
bool finish_write_data;
-uint8_t signal = 0x00;
unsigned char bbram_buffer[66]={0x19,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0xF4,0xC2,0x10,0xC0,0x00,0x30,0x31,0x07,0x00,0x01,0x00,0x7F,0x00,0x0B,0x37,0x00,0x00,0x40,0x0C,0x00,0x05,0x00,0x00,0x18,0x12,0x34,0x56,0x10,0x10,0xC4,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00};
//int initialise_card();
@@ -418,15 +424,7 @@
finish_write_data = true;\
gPC.puts("adf_off\r\n");\
}\
-}
-
-
-void check(){
- if(IRQ){
- gCOM_MNG_TMTC_THREAD->signal_set(signal);
- }
-}
-
+}
#define send_data {\
if(sent_tmfrom_SDcard){\
@@ -464,7 +462,7 @@
spi.write(0xFF);\
gCS_ADF=1;\
SPI_mutex.unlock();\
- ticker.attach_us(&check,32000);\
+ gADF_TICKER.start(COM_TX_TICKER_TIME);\
}
@@ -486,7 +484,7 @@
gCOM_MNG_TMTC_THREAD->signal_wait(COM_MNG_TMTC_SIGNAL_ADF_SD);\
if(ADF_off){\
SPI_mutex.lock();\
- ticker.detach();\
+ gADF_TICKER.stop();\
gCS_ADF=0;\
spi.write(0xB1);\
gCS_ADF=1;\
@@ -552,7 +550,7 @@
if(finish_write_data){
if(ADF_off){
SPI_mutex.lock();
- ticker.detach();
+ gADF_TICKER.stop();
// wait_ms(35);
gCS_ADF=0;
spi.write(0xB1);
