FM
Dependencies: SimpleDMA eeprom mbed-rtos mbed FreescaleIAP
Fork of CDMS_CODE by
Diff: FMS_all.h
- Revision:
- 353:e1803e801e20
- Parent:
- 352:022c513aee03
- Child:
- 354:0da912441c7b
--- a/FMS_all.h Mon Feb 06 16:36:46 2017 +0000 +++ b/FMS_all.h Tue Feb 21 06:30:56 2017 +0000 @@ -107,6 +107,14 @@ gCS_RTC=0; spi.write(0x81); //register address with write flag spi.write(0x00);//disabling stop bit in the seconds register + gCS_RTC=1; + gCS_RTC=0; + spi.write(0x8C); //register address with write flag + spi.write(0x00);//enabling halt bit in the seconds register + gCS_RTC=1; + EN_RTC = 0x01; +// CDMS_RTC_DISABLE =1; + WRITE_TO_EEPROM(6,1); SPI_mutex.unlock(); gPC.printf("sw on rtc\n"); } @@ -118,6 +126,15 @@ gCS_RTC=0; spi.write(0x81); //register address with write flag spi.write(0x80);//enabling stop bit in the seconds register + gCS_RTC=1; + gCS_RTC=0; + spi.write(0x8C); //register address with write flag + spi.write(0x40);//enabling halt bit in the seconds register + gCS_RTC=1; + + EN_RTC = 0x00; +// CDMS_RTC_DISABLE = 0; + WRITE_TO_EEPROM(6,0); SPI_mutex.unlock(); gPC.printf("sw off rtc\n"); } @@ -220,10 +237,10 @@ void SW_RST_BAE() { - BAE_SW_EN_DS = 0; - wait_ms(10); - BAE_SW_EN_DS = 1; - wait_ms(100); + BAE_SW_EN_DS = 0; + wait(5); + BAE_SW_EN_DS = 1; + BAE_STATUS = DEVICE_POWERED; WRITE_TO_EEPROM(1,DEVICE_POWERED); gPC.printf("rst bae\n");