mirror of
https://github.com/lucysrausch/hoverboard-firmware-hack.git
synced 2025-08-04 01:54:28 +02:00
refactored code, moved user-relevant defines to config.h
This commit is contained in:
21
Inc/config.h
Normal file
21
Inc/config.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#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 5 // Motor DC current limit in amps
|
||||
|
||||
#define DEBUG_SERIAL_SERVOTERM
|
||||
//#define DEBUG_SERIAL_ASCII
|
||||
#define DEBUG_BAUD 115200 // UART baud rate
|
||||
//#define DEBUG_I2C_LCD
|
@@ -117,13 +117,8 @@
|
||||
#define CHARGER_PIN GPIO_PIN_12
|
||||
#define CHARGER_PORT GPIOA
|
||||
|
||||
#define PWM_FREQ 16000
|
||||
#define DEAD_TIME 32
|
||||
|
||||
#define R 0.27
|
||||
#define P 15
|
||||
#define PSI 0.02
|
||||
#define V 23
|
||||
#define MOTOR_AMP_CONV_DC_AMP 0.02
|
||||
#define ADC_BATTERY_VOLT 0.02647435897435897435897435897436
|
||||
|
||||
#define MILLI_R (R * 1000)
|
||||
#define MILLI_PSI (PSI * 1000)
|
||||
|
Reference in New Issue
Block a user