Mercurial > public > hwos_code
comparison src/sleepmode.asm @ 560:b7eb98dbd800
bump to 2.96beta (REFACTORED VERSION)
author | heinrichsweikamp |
---|---|
date | Wed, 31 Jan 2018 19:39:37 +0100 |
parents | 69a98f3f3b84 |
children | b455b31ce022 |
comparison
equal
deleted
inserted
replaced
559:9cb967d844f0 | 560:b7eb98dbd800 |
---|---|
166 ; movff apnoe_max_pressure+1,WREG | 166 ; movff apnoe_max_pressure+1,WREG |
167 ; call piezo_config_tx | 167 ; call piezo_config_tx |
168 return | 168 return |
169 | 169 |
170 deepsleep_get_accel: | 170 deepsleep_get_accel: |
171 call I2C_init_compass | 171 call I2C_init_compass ; required for compass1 |
172 call I2C_init_accelerometer ; required for compass2 | |
172 call I2C_RX_accelerometer ; read Accelerometer | 173 call I2C_RX_accelerometer ; read Accelerometer |
173 call I2C_sleep_compass | 174 call I2C_sleep_compass ; required for compass1 |
175 call I2C_sleep_accelerometer ; required for compass2 | |
174 movff accel_DZ+0,WREG | 176 movff accel_DZ+0,WREG |
175 return | 177 return |
176 | 178 |
177 onehour_sleep: | 179 onehour_sleep: |
178 call update_battery_registers ; update battery registers into EEPROM | 180 call update_battery_registers ; update battery registers into EEPROM |
294 call get_temperature_value ; State 1: Get temperature | 296 call get_temperature_value ; State 1: Get temperature |
295 call get_pressure_start ; Start pressure integration. | 297 call get_pressure_start ; Start pressure integration. |
296 banksel common | 298 banksel common |
297 rcall sleepmode_sleep ; Wait at least 35ms (every 62,5ms Timer7 wakeup) | 299 rcall sleepmode_sleep ; Wait at least 35ms (every 62,5ms Timer7 wakeup) |
298 rcall sleepmode_sleep ; Wait at least 35ms (every 62,5ms Timer7 wakeup) | 300 rcall sleepmode_sleep ; Wait at least 35ms (every 62,5ms Timer7 wakeup) |
299 bsf LEDg ; Show some activity | |
300 banksel isr_backup ; Back to Bank0 ISR data | 301 banksel isr_backup ; Back to Bank0 ISR data |
301 call get_pressure_value ; State2: Get pressure (51us) | 302 call get_pressure_value ; State2: Get pressure (51us) |
302 call calculate_compensation ; calculate temperature compensated pressure (27us) | 303 call calculate_compensation ; calculate temperature compensated pressure (27us) |
303 banksel common | 304 banksel common |
304 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility | 305 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility |
305 bcf LEDg | |
306 return | 306 return |
307 | 307 |
308 sleepmode_sleep: | 308 sleepmode_sleep: |
309 banksel 0xF16 ; Addresses, F16h through F5Fh, are also used by SFRs, but are not part of the Access RAM. | 309 banksel 0xF16 ; Addresses, F16h through F5Fh, are also used by SFRs, but are not part of the Access RAM. |
310 clrf T7GCON ; Reset Timer7 Gate Control register | 310 clrf T7GCON ; Reset Timer7 Gate Control register |