diff options
| author | Keith Packard <keithp@keithp.com> | 2012-10-23 22:17:49 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-10-25 00:07:14 -0700 | 
| commit | b119e19604aa557a40e848c60d98a67b5f259bbd (patch) | |
| tree | 2391c2fb7db1843096ec4e3d288cb26f7cb88b92 /src/drivers/ao_ms5607.c | |
| parent | 7d34811ba035367bbf26a8510265754f3fbb5a95 (diff) | |
altos: profiling on STM32L
Add sample-based profiling, using a 1kHz timer
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_ms5607.c')
| -rw-r--r-- | src/drivers/ao_ms5607.c | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c index 077a40e6..ce0bcf4b 100644 --- a/src/drivers/ao_ms5607.c +++ b/src/drivers/ao_ms5607.c @@ -130,6 +130,7 @@ static uint32_t  ao_ms5607_get_sample(uint8_t cmd) {  	uint8_t	reply[3];  	uint8_t read; +	uint32_t loops;  	ao_ms5607_done = 0; @@ -141,10 +142,15 @@ ao_ms5607_get_sample(uint8_t cmd) {  #if AO_MS5607_PRIVATE_PINS  	ao_spi_put(AO_MS5607_SPI_INDEX);  #endif +//	loops = 0;  	cli(); -	while (!ao_ms5607_done) +	while (!ao_ms5607_done) { +//		loops++;  		ao_sleep((void *) &ao_ms5607_done); +	}  	sei(); +//	if (loops > 1) +//		printf ("ms5607 loops %d\n", loops);  #if AO_MS5607_PRIVATE_PINS  	stm_gpio_set(AO_MS5607_CS_PORT, AO_MS5607_CS_PIN, 1);  #else | 
