From 06a913dc411c37236015ac49b9f3a5670322b6d4 Mon Sep 17 00:00:00 2001 From: but0n Date: Wed, 7 Sep 2016 21:40:38 +0800 Subject: [PATCH] MOD:Standard --- .../STM32F10x_StdPeriph_Driver/inc/mpu6050.h | 3 +-- .../Libraries/STM32F10x_StdPeriph_Driver/src/oled.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/inc/mpu6050.h b/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/inc/mpu6050.h index 1043888..ee27b23 100644 --- a/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/inc/mpu6050.h +++ b/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/inc/mpu6050.h @@ -51,8 +51,7 @@ typedef struct{ float aX; float aY; float aZ; -}SixAxis; -typedef SixAxis* pSixAxis; +}SixAxis, *pSixAxis; void initLED(); diff --git a/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/src/oled.c b/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/src/oled.c index cacff4c..ad3eb91 100644 --- a/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/src/oled.c +++ b/libs/STM32_USB-FS-Device_Lib_V4.0.0/Libraries/STM32F10x_StdPeriph_Driver/src/oled.c @@ -17,6 +17,13 @@ void oled_portInit() { GPIOB->CRL &= 0x00000FFF; GPIOB->CRL |= 0x33333FFF; + + SDIN_OLED = 0; + SCLK_OLED = 0; + DC_OLED = 0; + RST_OLED = 0; + CS_OLED = 0; + } void oled_sendData(unsigned char dat) { @@ -25,13 +32,14 @@ void oled_sendData(unsigned char dat) { unsigned char i; for(i = 0; i < 8; i++) { - SCLK_OLED = 0; SDIN_OLED = (dat&0x80)>>7; dat <<= 1; delay_oled(10); SCLK_OLED = 1; delay_oled(10); + SCLK_OLED = 0; } + delay_oled(10); CS_OLED = 1; } @@ -41,13 +49,14 @@ void oled_sendCmd(unsigned char cmd) { unsigned char i; for(i = 0; i < 8; i++) { - SCLK_OLED = 0; SDIN_OLED = (cmd&0x80)>>7; cmd <<= 1; delay_oled(10); SCLK_OLED = 1; delay_oled(10); + SCLK_OLED = 0; } + delay_oled(10); CS_OLED = 1; }