new battery bar
Dependencies: CAN_IDs CanControl Dashboard PinDetect PowerControl mbed-rtos mbed
Revision 4:dfd10f43cc8b, committed 2017-05-12
- Comitter:
- kwasymodo
- Date:
- Fri May 12 20:19:56 2017 +0000
- Parent:
- 3:b164662f9740
- Child:
- 5:c90a7b40c930
- Commit message:
- changed PowerControl ; changed pinout
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CanControl.lib Fri May 12 20:19:56 2017 +0000 @@ -0,0 +1,1 @@ +CanControl#274e6fb7df45
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PinDetect.lib Fri May 12 20:19:56 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/xeta05/code/PinDetect/#cb6051b90a52
--- a/PowerControl.lib Wed May 10 18:45:51 2017 +0000 +++ b/PowerControl.lib Fri May 12 20:19:56 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/kwasymodo/code/PowerControl/#1bae9ab7241e +https://developer.mbed.org/users/kwasymodo/code/PowerControl/#1e3291e8294d
--- a/main.cpp Wed May 10 18:45:51 2017 +0000 +++ b/main.cpp Fri May 12 20:19:56 2017 +0000 @@ -1,5 +1,5 @@ /******************************************************************************* -This software is especially designed for Solarboat Twente for the use in their solarboat v1.0 +This software is especially designed for Solarboat Twente for the use in their Solarboat v1.0 Written by: Niels Leijen, Jesse van Rhijn, Bram Seinhorst @@ -7,7 +7,7 @@ Thanks to: Jasper Admiraal, Hidde Pik (hihihihi), Lisa Postma, Heleen Jeurink, Ruben Peters, Martijn Groot Jebbink, Martijn Wilpshaar, Bram Seinhorst, Robert Geels, Arnoud Meutstege, -Jeroen te Braake, Ids de Vos, Jesse van Rhijn, Sam Benou and Niels Leijen +Jeroen te Braake, Ids de Vos, Jesse van Rhijn, Sam Benou, Niels Leijen and Mark Bruijn DISCLAIMER: THIS SOFTWARE IS SUPPLIED "AS IS" WITHOUT ANY WARRANTIES AND SUPPORT. @@ -18,7 +18,7 @@ #define DEBUG //include 3rd party libraries -#include "mbed.h" +#include "mbed.h" //needs to be revision 136 else SD filesystem will not work #include "rtos.h" // include Solarboat libraries @@ -32,7 +32,6 @@ // initialize canbus CAN can(CAN_RD, CAN_TD); -DigitalOut canEnable(CAN_ENABLE); // initialze onboard leds DigitalOut ledError(LED3); @@ -41,100 +40,21 @@ DigitalOut ledFona(LED5); DigitalOut led24V(LED4); -// initialeze buck converters -DigitalOut buckCan(BUCK2); -DigitalOut buckXSens(BUCK3); -DigitalOut buckScreen(BUCK4); -DigitalOut buck24V(BUCK5); - -// global variables -// Thread 1 -//static bool goSleep = true; - - - - -/* -// Thread 1 - Power - Functions -void greenButtonPressed(){ -#ifdef DEBUG - printf("green button pressed\r\n "); -#endif - -} - if(goSleep){ -#ifdef DEBUG - printf("waking up\n"); -#endif +//DigitalOut buckCan(BUCK2); +//DigitalOut buckXSens(BUCK3); +//DigitalOut buckScreen(BUCK4); +//DigitalOut buck24V(BUCK5); - goSleep = false; - - canEnable = 1; - buckCan = 1; - wait_ms(200); - can.write(CANMessage(0x033, "1")); - ledRelay = 1; - wait_ms(300); - buckXSens = 1; - buckScreen = 1; - buck24V = 1; - led24V = 1; - -#ifdef DEBUG - printf("fully awake\n"); -#endif - } -} - -void redButtonPressed(){ -#ifdef DEBUG - printf("red button pressed\r\n "); -#endif -#ifdef DEBUG - printf("going to sleep\n"); -#endif - - goSleep = true; - can.write(CANMessage(0x033, "0")); - - ledRelay = 0; - wait_ms(200); - buckXSens = 0; - buckScreen = 0; - buck24V = 0; - led24V = 0; - wait_ms(300); - canEnable = 0; - buckCan = 0; - -#ifdef DEBUG - printf("entering sleep mode\n"); -#endif - - //sleep(); -} -*/ // Thread 1 - Power void power(){ + PowerControl powercontrol(PUSH_GREEN); + #ifdef DEBUG - pc.printf("Thread 1 - Power start\r\n "); + pc.printf("Thread 1 - Power started\r\n "); #endif - PowerControl powercontrol(PUSH_GREEN, PUSH_RED); -#ifdef DEBUG - pc.printf("Thread 1 - started\r\n "); -#endif - - //sleep(); - - while(1){ - //if(!goSleep){ - // can.write(CANMessage(0x033, "1")); - //} - ledError = !ledError; - Thread::wait(1000); - } + Thread::wait(osWaitForever); }
--- a/pinout.h Wed May 10 18:45:51 2017 +0000 +++ b/pinout.h Fri May 12 20:19:56 2017 +0000 @@ -13,11 +13,11 @@ LED2 - x x - 3V3 BUCK2 - x x - BIEM_CS1 LED1 - x x - 5V LED5 - x x - NC GND - x x - GND LED4 - x x - GND -(hack FONA_KEY) - x x - GND XSENS_RX - x x - BIEM_CS3 +FONA_KEY (hack) - x x - GND XSENS_RX - x x - BIEM_CS3 PUSH_GREEN - x x - NC SCRN_LED2 - x x - BIEM_CS2 NC(old PUSH_RED)- x x - NC SCRN_LED3 - x x - SPI_MOSI -FONA_RTS - x x - FONA_RX SCRN_CS3 - x x - SPI_MISO -FONA_RI - x x - FONA_TX SCRN_CS2 - x x - SPI_CLK +NC(old FONA_RTS)- x x - FONA_RX SCRN_CS3 - x x - SPI_MISO +FONA_RTS(old FONA_RI)- x x - FONA_TX SCRN_CS2 - x x - SPI_CLK FONA_NS - x x - FONA_PS SCRN_CS1 - x x - NC FONA_BAT - x x - SCRN_LED4 XSENS_TX - x x - SCRN_DC BUCK5 - x x - SCRN_LED1 USB_TX - x x - NC @@ -67,8 +67,8 @@ #define FONA_RX PA_0 #define FONA_TX PA_1 -#define FONA_RTS PC_15 -#define FONA_RI PH_0 +#define FONA_RTS PH_0 +#define FONA_RI #define FONA_NS PH_1 #define FONA_PS PA_4 #define FONA_KEY PB_7