From 312d08b94462ba00aeefea9d0542c3b860bf5bcb Mon Sep 17 00:00:00 2001 From: Niklas Fauth Date: Tue, 8 May 2018 13:02:20 +0200 Subject: [PATCH] FIX: license information --- Inc/config.h | 15 +++------------ Inc/defines.h | 7 ++++--- Inc/setup.h | 7 ++++--- Src/main.c | 11 ++++++----- Src/setup.c | 9 ++++----- 5 files changed, 21 insertions(+), 28 deletions(-) diff --git a/Inc/config.h b/Inc/config.h index 9bfb6eb..cad47e8 100644 --- a/Inc/config.h +++ b/Inc/config.h @@ -1,25 +1,16 @@ #pragma once #include "stm32f1xx_hal.h" -#define R 0.27 -#define P 15 -#define PSI 0.02 -#define V 23 - -#define MILLI_R (R * 1000) -#define MILLI_PSI (PSI * 1000) -#define MILLI_V (V * 1000) - // ################################################################################ #define PWM_FREQ 16000 // PWM frequency in Hz #define DEAD_TIME 32 // PWM deadtime -#define DC_CUR_LIMIT 25 // Motor DC current limit in amps +#define DC_CUR_LIMIT 15 // Motor DC current limit in amps #define BAT_LOW_LVL1 36.0 // gently beeps at this voltage level #define BAT_LOW_LVL2 33.0 // your battery is almost empty. Charge now! -#define BAT_LOW_DEAD 30.0 // undervoltage lockout +#define BAT_LOW_DEAD 31.0 // undervoltage lockout // ################################################################################ @@ -30,7 +21,7 @@ #define DEBUG_SERIAL_ASCII //#define DEBUG_I2C_LCD -#define TIMEOUT 5 //wrong commands before emergency off +#define TIMEOUT 5 //number of wrong / missing commands before emergency off // ################################################################################ diff --git a/Inc/defines.h b/Inc/defines.h index b2b94e5..93c17c6 100644 --- a/Inc/defines.h +++ b/Inc/defines.h @@ -1,8 +1,9 @@ /* -* This file is part of the stmbl project. +* This file is part of the hoverboard-firmware-hack project. * -* Copyright (C) 2013-2018 Rene Hopf -* Copyright (C) 2013-2018 Nico Stute +* Copyright (C) 2017-2018 Rene Hopf +* Copyright (C) 2017-2018 Nico Stute +* Copyright (C) 2017-2018 Niklas Fauth * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Inc/setup.h b/Inc/setup.h index 48a16e9..a024fe6 100644 --- a/Inc/setup.h +++ b/Inc/setup.h @@ -1,8 +1,9 @@ /* -* This file is part of the stmbl project. +* This file is part of the hoverboard-firmware-hack project. * -* Copyright (C) 2013-2018 Rene Hopf -* Copyright (C) 2013-2018 Nico Stute +* Copyright (C) 2017-2018 Rene Hopf +* Copyright (C) 2017-2018 Nico Stute +* Copyright (C) 2017-2018 Niklas Fauth * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Src/main.c b/Src/main.c index ba99bed..0bfc254 100644 --- a/Src/main.c +++ b/Src/main.c @@ -1,8 +1,9 @@ /* -* This file is part of the stmbl project. +* This file is part of the hoverboard-firmware-hack project. * -* Copyright (C) 2013-2018 Rene Hopf -* Copyright (C) 2013-2018 Nico Stute +* Copyright (C) 2017-2018 Rene Hopf +* Copyright (C) 2017-2018 Nico Stute +* Copyright (C) 2017-2018 Niklas Fauth * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -124,8 +125,8 @@ int main(void) { cmd1 = CLAMP((nunchuck_data[0] - 127) * 8, -1000, 1000); // x - axis. Nunchuck joystick readings range 30 - 230 cmd2 = CLAMP((nunchuck_data[1] - 128) * 8, -1000, 1000); // y - axis - //uint8_t button1 = (uint8_t)nunchuck_data[5] & 1; - //uint8_t button2 = (uint8_t)(nunchuck_data[5] >> 1) & 1; + uint8_t button1 = (uint8_t)nunchuck_data[5] & 1; + uint8_t button2 = (uint8_t)(nunchuck_data[5] >> 1) & 1; #endif #ifdef CONTROL_PPM diff --git a/Src/setup.c b/Src/setup.c index d665be3..771b163 100644 --- a/Src/setup.c +++ b/Src/setup.c @@ -1,8 +1,9 @@ /* -* This file is part of the stmbl project. +* This file is part of the hoverboard-firmware-hack project. * -* Copyright (C) 2013-2018 Rene Hopf -* Copyright (C) 2013-2018 Nico Stute +* Copyright (C) 2017-2018 Rene Hopf +* Copyright (C) 2017-2018 Nico Stute +* Copyright (C) 2017-2018 Niklas Fauth * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -144,10 +145,8 @@ void UART_Init() { */ DMA_HandleTypeDef hdma_i2c2_rx; - DMA_HandleTypeDef hdma_i2c2_tx; - void I2C_Init() {