Skip to content

Commit

Permalink
Fixed sensor_tag bug.
Browse files Browse the repository at this point in the history
Fixed sensor_tag which can not read sensor data.
  • Loading branch information
birdyou committed May 17, 2016
1 parent 1093637 commit 57fd105
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
12 changes: 2 additions & 10 deletions applications/juma/echo/mdk-arm/echo.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
<TargetName>ECHO</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060020::V5.06 (build 20)::ARMCC</pCCUsed>
<TargetOption>
<TargetCommonOption>
<Device>STM32F401RETx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.2.3.0</PackID>
<PackID>Keil.STM32F4xx_DFP.2.7.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08000000,0x80000) IRAM(0x20000000,0x18000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
Expand Down Expand Up @@ -85,8 +84,6 @@
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
Expand Down Expand Up @@ -230,7 +227,6 @@
<useUlib>1</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>3</RoSelD>
<RwSelD>3</RwSelD>
<CodeSel>0</CodeSel>
Expand Down Expand Up @@ -365,10 +361,6 @@
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<useXO>0</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>0</vShortEn>
<vShortWch>0</vShortWch>
<VariousControls>
<MiscControls>--C99 --gnu -W#177</MiscControls>
<Define>STM32F401xE,USE_HAL_DRIVER,USE_STM32F4XX_NUCLEO,ENABLE_SPI_FIX,BLUENRG_MS,RTC_LSE,SENSOR_FIFO,NO_PRINTF,SERVER_ROLE,CANNON_V2</Define>
Expand Down Expand Up @@ -734,7 +726,7 @@
</Files>
</Group>
<Group>
<GroupName>system/cmiss</GroupName>
<GroupName>system/cmsis</GroupName>
<Files>
<File>
<FileName>system_stm32f4xx.c</FileName>
Expand Down
4 changes: 2 additions & 2 deletions applications/juma/sensor_tag/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void read_humidity(void* arg);
static void read_pressure(void* arg);
static void read_magenetometer(void* arg);
static void read_accelerometer(void* arg);
static void gyroscopic(void* arg);
static void read_gyroscopic(void* arg);
static void led_on(void* arg);
static void led_off(void* arg);

Expand Down Expand Up @@ -138,7 +138,7 @@ static void read_accelerometer(void* arg)
ble_device_send(0x04, 6, (uint8_t*)ACC);
}

run_after_delay(gyroscopic, NULL, UPDATE_INTERVAL);
run_after_delay(read_gyroscopic, NULL, UPDATE_INTERVAL);
}

static void read_gyroscopic(void* arg)
Expand Down
8 changes: 6 additions & 2 deletions applications/juma/sensor_tag/mdk-arm/sensor_tag.uvprojx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<TargetCommonOption>
<Device>STM32F401RETx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.2.7.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08000000,0x80000) IRAM(0x20000000,0x18000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
Expand Down Expand Up @@ -72,6 +74,8 @@
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>0</RunUserProg1>
Expand Down Expand Up @@ -128,6 +132,7 @@
<RestoreFunctions>1</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
<RestoreSysVw>1</RestoreSysVw>
</Simulator>
<Target>
<UseTarget>1</UseTarget>
Expand All @@ -139,8 +144,7 @@
<RestoreFunctions>0</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreSysVw>1</RestoreSysVw>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>11</TargetSelection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<TargetCommonOption>
<Device>STM32F401RETx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32F4xx_DFP.2.7.0</PackID>
<PackURL>http://www.keil.com/pack</PackURL>
<Cpu>IROM(0x08000000,0x80000) IRAM(0x20000000,0x18000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
Expand Down Expand Up @@ -72,6 +74,8 @@
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>0</RunUserProg1>
Expand Down Expand Up @@ -128,6 +132,7 @@
<RestoreFunctions>1</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
<RestoreSysVw>1</RestoreSysVw>
</Simulator>
<Target>
<UseTarget>1</UseTarget>
Expand All @@ -139,8 +144,7 @@
<RestoreFunctions>0</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreTracepoints>1</RestoreTracepoints>
<RestoreSysVw>1</RestoreSysVw>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>6</TargetSelection>
Expand Down
4 changes: 4 additions & 0 deletions system/bsp/cannon_v2/bsp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ void bsp_init(void)
/*UART2 init*/
UART_Init();
HAL_Delay(1000);
/*sensor layer init*/
#ifdef SENSOR_FIFO
jsensor_sys_init();
#endif
/* Initialize the BlueNRG SPI driver */
BNRG_SPI_Init();
/* Initialize the BlueNRG HCI */
Expand Down
2 changes: 1 addition & 1 deletion system/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

int main(void)
{
bsp_init();
bsp_init();
dispatch_init();
on_ready();
while(1)
Expand Down

0 comments on commit 57fd105

Please sign in to comment.