Update
Dependencies: mbed mbed-rtos X_NUCLEO_IHM02A1
Diff: main.cpp
- Revision:
- 33:de144094bdd1
- Parent:
- 30:e464b2bb2376
- Child:
- 34:0dee9a606869
--- a/main.cpp Thu Apr 11 15:20:05 2019 +0000 +++ b/main.cpp Mon Apr 22 11:56:38 2019 +0000 @@ -1,63 +1,19 @@ -/** - ****************************************************************************** - * @file main.cpp - * @author Fabian Scherrer - * @version V1.0.0 - * @date April 7th, 2019 - * @brief - ****************************************************************************** - * @attention - * Verwendete I/O's: Input: - * PA9 (InputKontrollmodul Pin von Kontroll-Modul)(CN5-1) - * - * Output: - * PA10 (D2) (Select Steppmotor Treiber2) - PA9 (InputKontrollModul) - * PA7 (D11) (mosi Steppmotor Treiber1) - * PA6 (D12) (miso Steppmotor Treiber1) - * PA4 (A2) (Select Steppmotor Treiber1) - * - * PB15 (mosi Steppmotor Treiber2) - * PB14 (miso Steppmotor Treiber2) - * PB13 (slk Steppmotor Treiber2) - * PB6 (D10)(pwm_io)(CN5-3) - * PB5 (D4)(Standby_reset Steppmotor) - * PB4 (D5)(pwm_io2)(CN9-6) - * PB3 (D3)(Select Steppmotor Treiber1) - - * PC1 (A4)(Flag_irq Steppmotor) - * PC0 (A5)(Busy_irq Steppmotor) - - - ******************************************************************************/ - -/* Includes ------------------------------------------------------------------*/ - -/* mbed specific header files. */ -#include "mbed.h" -#include "main.h" -#include "PWM.h" -#include "ST_SOLO.h" -#include "ST_DUO.h" -#include "SCHRITTMOTOREN_INIT.h" - -/* Helper header files. */ -#include "DevSPI.h" - -/* Expansion Board specific header files. */ -#include "XNucleoIHM02A1.h" - - -/* Definitions ---------------------------------------------------------------*/ - +#include "SETUP.h" /* Status Spleisser definieren*/ int StatusSpleisser = ST_SOLO; /*Input initalisieren für Status Spleisser*/ -DigitalIn InputKontrollmodul(PA_9); +DigitalIn InputKontrollmodul(COM_SIGNAL); + + + + + +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ InterruptIn button1(USER_BUTTON); volatile int idx = 0; volatile bool button1_pressed = false; // Used in the main loop @@ -85,6 +41,11 @@ button1_timeout.attach(callback(button1_enabled_cb), 0.03); // Debounce time 300 ms } } +//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ + + + @@ -95,8 +56,6 @@ /*----- Initialization. -----*/ SchrittmotorenInit(); - - pwm_io2(20000, 0.075); button1.fall(callback(button1_onpressed_cb)); // Attach ISR to handle button press event while(1) @@ -104,7 +63,7 @@ switch (StatusSpleisser) { case ST_SOLO: - if(InputKontrollmodul ==0) + if(InputKontrollmodul == 0) { EntrySOLO(); } @@ -114,7 +73,7 @@ } break; case ST_DUO: - if(InputKontrollmodul ==1) + if(InputKontrollmodul == 1) { EntryDUO(); }