Skip to content

Commit

Permalink
Patched using inertial monitor project
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence authored and Laurence committed May 20, 2013
1 parent b94d863 commit d9e3563
Show file tree
Hide file tree
Showing 80 changed files with 5,106 additions and 2,399 deletions.
Binary file added Sensors/ppg_new.o
Binary file not shown.
Binary file added Sensors/pressure.o
Binary file not shown.
Binary file added Sensors/temperature.o
Binary file not shown.
Binary file added Util/USB/hw_config.o
Binary file not shown.
Binary file added Util/USB/mass_mal.o
Binary file not shown.
Binary file added Util/USB/memory.o
Binary file not shown.
Binary file added Util/USB/scsi_data.o
Binary file not shown.
Binary file added Util/USB/usb_bot.o
Binary file not shown.
Binary file added Util/USB/usb_desc.o
Binary file not shown.
Binary file added Util/USB/usb_endp.o
Binary file not shown.
Binary file added Util/USB/usb_istr.o
Binary file not shown.
Binary file added Util/USB/usb_prop.o
Binary file not shown.
Binary file added Util/USB/usb_pwr.o
Binary file not shown.
Binary file added Util/USB/usb_scsi.o
Binary file not shown.
Binary file added Util/buffer.o
Binary file not shown.
Binary file added Util/delay.o
Binary file not shown.
Binary file added Util/fat_fs/option/cc932.o
Binary file not shown.
Binary file added Util/fat_fs/option/ccsbcs.o
Binary file not shown.
Binary file added Util/fat_fs/option/syscall.o
Binary file not shown.
Binary file added Util/fat_fs/src/fattime.o
Binary file not shown.
Binary file added Util/fat_fs/src/ff.o
Binary file not shown.
Binary file added Util/fat_fs/src/rtc.o
Binary file not shown.
Binary file added Util/fat_fs/src/sd_spi_stm32.o
Binary file not shown.
Binary file added Util/rprintf.o
Binary file not shown.
Binary file added adc.o
Binary file not shown.
Binary file added bootload.o
Binary file not shown.
Binary file added gpio.o
Binary file not shown.
Binary file added i2c_int.o
Binary file not shown.
2 changes: 1 addition & 1 deletion interrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ __attribute__((externally_visible)) void EXTI0_IRQHandler(void) {
}
if(USB_SOURCE==bootsource) {
if(file_opened)
shutdown_filesystem(); //This should not happen
shutdown_filesystem(1,file_opened);//This should not happen
red_flash(); //Flash red led - provides some debouncing on jack removal
shutdown(); //Shuts down - only wakes up on power pin i.e. WKUP
}
Expand Down
344 changes: 344 additions & 0 deletions interrupts.c~

Large diffs are not rendered by default.

Binary file added interrupts.o
Binary file not shown.
Binary file modified lib/CMSIS_CM3/core_cm3.o
Binary file not shown.
Binary file modified lib/CMSIS_CM3/startup/gcc/startup_stm32f10x_md.o
Binary file not shown.
Binary file modified lib/CMSIS_CM3/system_stm32f10x.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/libstm32fw.a
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/misc.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.o
Binary file not shown.
Binary file modified lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/libstm32usb.a
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/otgd_fs_cal.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/otgd_fs_dev.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/otgd_fs_int.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/otgd_fs_pcd.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/usb_core.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/usb_init.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/usb_int.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/usb_mem.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/usb_regs.o
Binary file not shown.
Binary file modified lib/STM32_USB-FS-Device_Driver/src/usb_sil.o
Binary file not shown.
Binary file added main.bin
Binary file not shown.
Binary file added main.elf
Binary file not shown.
7,086 changes: 4,693 additions & 2,393 deletions main.map

Large diffs are not rendered by default.

Binary file added main.o
Binary file not shown.
4 changes: 0 additions & 4 deletions pwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,4 @@ void shutdown_filesystem(uint8_t reason, uint8_t file_flags) {
f_truncate(&FATFS_logfile); //Truncate the lenght - fix pre allocation
f_close(&FATFS_logfile); //Close any opened file
}
if(file_flags&0x02)
wave_terminate(&FATFS_wavfile_accel); //Close all opened files - terminate wav files correctly
if(file_flags&0x04)
wave_terminate(&FATFS_wavfile_gyro); //Close all opened files - terminate wav files correctly
}
56 changes: 56 additions & 0 deletions pwr.c~
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include "pwr.h"

/**
* @brief Enables the power domain
* @param None
* @retval None
*/
void setuppwr() {
PWR_DeInit();
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE);//clk to the pwr control
}

/**
* @brief Enables the wakeup pin functionality and places device in low power mode
* @param None
* @retval None
*/
void shutdown() {
PWR_WakeUpPinCmd(ENABLE); //enable the pin
PWR_EnterSTANDBYMode(); //only wakes on RTC signals or WKUP pin
}

/**
* @brief Disables the wakeup pin functionality
* @param None
* @retval None
*/
void disable_pin() {
PWR_WakeUpPinCmd(DISABLE); //disable the pin
}

/**
* @brief This function closes any open files, leaving a file footer in the FATFS_logfile
* @param uint8_t reason: reason for shutdown, uses enum definitions in main.h, uint8_t file_flags: flag bits for open files
* @retval None
*/
void shutdown_filesystem(uint8_t reason, uint8_t file_flags) {
uint8_t c[25] = {};
if(reason==BUTTON_TURNOFF)
strncpy(c,"\r\nLogger turned off\r\n",sizeof(c));
else if(reason==USB_INSERTED)
strncpy(c,"\r\nUSB cable inserted\r\n",sizeof(c));
else
strncpy(c,"\r\nLow Battery\r\n",sizeof(c));
if(file_flags&0x01) {
uint32_t a;
f_write(&FATFS_logfile,c,strlen(c),&a); //Write the error to the file
f_sync(&FATFS_logfile); //Flush buffers
f_truncate(&FATFS_logfile); //Truncate the lenght - fix pre allocation
f_close(&FATFS_logfile); //Close any opened file
}
if(file_flags&0x02)
wave_terminate(&FATFS_wavfile_accel); //Close all opened files - terminate wav files correctly
if(file_flags&0x04)
wave_terminate(&FATFS_wavfile_gyro); //Close all opened files - terminate wav files correctly
}
3 changes: 2 additions & 1 deletion pwr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include <string.h>
#include "stm32f10x.h"
#include "main.h"
#include "Util/fat_fs/inc/diskio.h"
Expand All @@ -7,4 +8,4 @@
void setuppwr(void);
void shutdown(void);
void disable_pin(void);
void shutdown_filesystem(void);
void shutdown_filesystem(uint8_t reason, uint8_t file_flags);
10 changes: 10 additions & 0 deletions pwr.h~
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
#include "stm32f10x.h"
#include "main.h"
#include "Util/fat_fs/inc/diskio.h"
#include "Util/fat_fs/inc/ff.h"

void setuppwr(void);
void shutdown(void);
void disable_pin(void);
void shutdown_filesystem(void);
Binary file added pwr.o
Binary file not shown.
Binary file added timer.o
Binary file not shown.
Binary file added usart.o
Binary file not shown.
Binary file added watchdog.o
Binary file not shown.

0 comments on commit d9e3563

Please sign in to comment.