Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 1:009c799bb5d1
- Parent:
- 0:1d2b7ae1269a
--- a/main.cpp Tue May 07 13:44:48 2019 +0000 +++ b/main.cpp Thu May 09 17:09:02 2019 +0000 @@ -1,12 +1,12 @@ #include "main.h" -#include "mbed.h" +#include <mbed.h> #include "charmap.h" +#include "stm32f70rb.h" +#define USE_PLL_HSE_XTAL (1) /* Use external xtal */ #define DIGIT_CONTROLLER_ID 0xA8 -//#define SLEEP_INTERVAL 0.5f #define SLEEP_INTERVAL 0.003f -//#define SLEEP_INTERVAL 0 #define D_ON 0x3F #define DISPLAYTIMEOUT 5 @@ -21,16 +21,18 @@ //SPI spi(PA_7, PA_6, PA_5); // mosi, miso, sclk SPISlave device(PA_7, PA_6, PA_5, PA_15); //DigitalOut cs(PA_15); //should be cs but seems to be CE_E maybe mislabel -int spiDATA[3]; +int spiDATA[4]; + + int main() -{ - digit_driver.frequency(400000); +{ + //RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + //RCC_OscInitStruct.HSEState = RCC_HSE_ON; + //RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + //RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - //cs = 1; - //spi.frequency(976000); - //spi.format(8,0); - //cs = 0; + digit_driver.frequency(400000); char shutdown_reg[2]; shutdown_reg[0] = 0x00; @@ -83,19 +85,17 @@ int blinkRate = 50; - - - for (int j = 7; j >= 0; j--) { - - - for (int i = 9; i >= 0; i--) { - for (int x = 0; x <= 250; x++){ - segValDisplay(j, 3); - segValDisplay(i, 2); - wait(0.001); - } - } - } + //*********** 70 seccond count for PI Modual boot time ******************** + for (int j = 7; j >= 0; j--) { + for (int i = 9; i >= 0; i--) { + for (int x = 0; x <= 250; x++){ + segValDisplay(j, 3); + segValDisplay(i, 2); + wait(0.001); + } + } + } + //************************************************************************** while(1) { //Check if data exists on SPI BUSS @@ -121,8 +121,8 @@ dig_1 = 1; dig_2 = 1; dig_3 = 1; }else{ segValDisplay(spiDATA[0] ,1); - segValDisplay(11, 2); - segValDisplay(10, 3); + segValDisplay(18, 2); + segValDisplay(13, 3); } if (blinkRate <= 25) { dig_1 = 1; dig_2 = 1; dig_3 = 1;