From 0d98a7c11486c23195046fc6be3fc5aed7779a1a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Dec 2022 19:18:51 -0600 Subject: [PATCH 1/5] Preparing the Cheap FOCer to use the new header file method --- hwconf/other/hw_Cheap_FOCer_2.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hwconf/other/hw_Cheap_FOCer_2.h b/hwconf/other/hw_Cheap_FOCer_2.h index dfe8d5de..ff6168ac 100644 --- a/hwconf/other/hw_Cheap_FOCer_2.h +++ b/hwconf/other/hw_Cheap_FOCer_2.h @@ -17,10 +17,16 @@ along with this program. If not, see . */ -#ifndef HW_Cheap_FOCer_2 -#define HW_Cheap_FOCer_2 +#ifndef HW_CHEAP_FOCER_2_CORE_H_ +#define HW_CHEAP_FOCER_2_CORE_H_ -#define HW_NAME "Cheap_FOCer_2" +#ifdef CFOC_IS_V09 + #define HW_NAME "Cheap_FOCer_2_v09" +#elif defined(CFOC_IS_V1) + #define HW_NAME "Cheap_FOCer_2" +#else + #error "Must define hardware type" +#endif // HW properties #define HW_HAS_DRV8301 @@ -103,8 +109,12 @@ #define VIN_R2 2200.0 #endif #ifndef CURRENT_AMP_GAIN +#ifdef CFOC_IS_V09 +#define CURRENT_AMP_GAIN 20 +#else #define CURRENT_AMP_GAIN 10 #endif +#endif #ifndef CURRENT_SHUNT_RES #define CURRENT_SHUNT_RES 0.0005 #endif @@ -299,4 +309,4 @@ #define HW_LIM_TEMP_FET -40.0, 110.0 -#endif /* HW_Cheap_FOCer_2 */ +#endif /* HW_CHEAP_FOCER_2_CORE_H_ */ From 591ac525a19e122d9a0971de1661f14793f71bc4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Dec 2022 19:19:34 -0600 Subject: [PATCH 2/5] Renaming files --- hwconf/other/{hw_Cheap_FOCer_2.c => hw_Cheap_FOCer_2_core.c} | 0 hwconf/other/{hw_Cheap_FOCer_2.h => hw_Cheap_FOCer_2_core.h} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename hwconf/other/{hw_Cheap_FOCer_2.c => hw_Cheap_FOCer_2_core.c} (100%) rename hwconf/other/{hw_Cheap_FOCer_2.h => hw_Cheap_FOCer_2_core.h} (100%) diff --git a/hwconf/other/hw_Cheap_FOCer_2.c b/hwconf/other/hw_Cheap_FOCer_2_core.c similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2.c rename to hwconf/other/hw_Cheap_FOCer_2_core.c diff --git a/hwconf/other/hw_Cheap_FOCer_2.h b/hwconf/other/hw_Cheap_FOCer_2_core.h similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2.h rename to hwconf/other/hw_Cheap_FOCer_2_core.h From 732d5472f8361b1b54e590cdc82bbb783b986cdf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Dec 2022 19:21:57 -0600 Subject: [PATCH 3/5] Adding V1.0 and V0.9 options --- hwconf/other/hw_Cheap_FOCer_2.h | 27 +++++++++++++++++++++++++++ hwconf/other/hw_Cheap_FOCer_2_V09.h | 27 +++++++++++++++++++++++++++ hwconf/other/hw_Cheap_FOCer_2_core.h | 2 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 hwconf/other/hw_Cheap_FOCer_2.h create mode 100644 hwconf/other/hw_Cheap_FOCer_2_V09.h diff --git a/hwconf/other/hw_Cheap_FOCer_2.h b/hwconf/other/hw_Cheap_FOCer_2.h new file mode 100644 index 00000000..8b05bc44 --- /dev/null +++ b/hwconf/other/hw_Cheap_FOCer_2.h @@ -0,0 +1,27 @@ +/* + Copyright 2016 Benjamin Vedder benjamin@vedder.se + + This file is part of the VESC firmware. + + The VESC firmware is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + The VESC firmware is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#ifndef HW_CHEAP_FOCER_2_H_ +#define HW_CHEAP_FOCER_2_H_ + +#define CFOC_IS_V10 + +#include "hw_Cheap_FOCer_2_core.h" + +#endif /* HW_CHEAP_FOCER_2_H_ */ diff --git a/hwconf/other/hw_Cheap_FOCer_2_V09.h b/hwconf/other/hw_Cheap_FOCer_2_V09.h new file mode 100644 index 00000000..fce66d5e --- /dev/null +++ b/hwconf/other/hw_Cheap_FOCer_2_V09.h @@ -0,0 +1,27 @@ +/* + Copyright 2016 Benjamin Vedder benjamin@vedder.se + + This file is part of the VESC firmware. + + The VESC firmware is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + The VESC firmware is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#ifndef HW_CHEAP_FOCER_2_H_ +#define HW_CHEAP_FOCER_2_H_ + +#define CFOC_IS_V09 + +#include "hw_Cheap_FOCer_2_core.h" + +#endif /* HW_CHEAP_FOCER_2_H_ */ diff --git a/hwconf/other/hw_Cheap_FOCer_2_core.h b/hwconf/other/hw_Cheap_FOCer_2_core.h index ff6168ac..4984897e 100644 --- a/hwconf/other/hw_Cheap_FOCer_2_core.h +++ b/hwconf/other/hw_Cheap_FOCer_2_core.h @@ -22,7 +22,7 @@ #ifdef CFOC_IS_V09 #define HW_NAME "Cheap_FOCer_2_v09" -#elif defined(CFOC_IS_V1) +#elif defined(CFOC_IS_V10) #define HW_NAME "Cheap_FOCer_2" #else #error "Must define hardware type" From 0c2213af8528557a5c146ce6997389222b7914ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Dec 2022 19:25:56 -0600 Subject: [PATCH 4/5] Adding no-limit versions --- hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h | 28 +++++++++++++++++++ hwconf/other/hw_Cheap_FOCer_2_no_limits.h | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h create mode 100644 hwconf/other/hw_Cheap_FOCer_2_no_limits.h diff --git a/hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h b/hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h new file mode 100644 index 00000000..02502c3e --- /dev/null +++ b/hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h @@ -0,0 +1,28 @@ +/* + Copyright 2016 Benjamin Vedder benjamin@vedder.se + + This file is part of the VESC firmware. + + The VESC firmware is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + The VESC firmware is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#ifndef HW_CHEAP_FOCER_2_V09_NO_LIMITS_H_ +#define HW_CHEAP_FOCER_2_V09_NO_LIMITS_H_ + +#define CFOC_IS_V09 +#define DISABLE_HW_LIMITS + +#include "hw_Cheap_FOCer_2_core.h" + +#endif /* HW_CHEAP_FOCER_2_V09_NO_LIMITS_H_ */ diff --git a/hwconf/other/hw_Cheap_FOCer_2_no_limits.h b/hwconf/other/hw_Cheap_FOCer_2_no_limits.h new file mode 100644 index 00000000..561e5094 --- /dev/null +++ b/hwconf/other/hw_Cheap_FOCer_2_no_limits.h @@ -0,0 +1,28 @@ +/* + Copyright 2016 Benjamin Vedder benjamin@vedder.se + + This file is part of the VESC firmware. + + The VESC firmware is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + The VESC firmware is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#ifndef HW_CHEAP_FOCER_2_NO_LIMITS_H_ +#define HW_CHEAP_FOCER_2_NO_LIMITS_H_ + +#define CFOC_IS_V10 +#define DISABLE_HW_LIMITS + +#include "hw_Cheap_FOCer_2_core.h" + +#endif /* HW_CHEAP_FOCER_2_NO_LIMITS_H_ */ From 6bbf9cca717a9ad718d7153cbc3dd9b6e28b64ff Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Dec 2022 19:30:38 -0600 Subject: [PATCH 5/5] Organizing files --- hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2.h | 0 hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_V09.h | 0 .../Cheap_FOCer_2}/hw_Cheap_FOCer_2_V09_no_limits.h | 0 hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_core.c | 0 hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_core.h | 0 .../{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_no_limits.h | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2.h (100%) rename hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_V09.h (100%) rename hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_V09_no_limits.h (100%) rename hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_core.c (100%) rename hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_core.h (100%) rename hwconf/{other => shaman/Cheap_FOCer_2}/hw_Cheap_FOCer_2_no_limits.h (100%) diff --git a/hwconf/other/hw_Cheap_FOCer_2.h b/hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2.h similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2.h rename to hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2.h diff --git a/hwconf/other/hw_Cheap_FOCer_2_V09.h b/hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_V09.h similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2_V09.h rename to hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_V09.h diff --git a/hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h b/hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_V09_no_limits.h similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2_V09_no_limits.h rename to hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_V09_no_limits.h diff --git a/hwconf/other/hw_Cheap_FOCer_2_core.c b/hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_core.c similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2_core.c rename to hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_core.c diff --git a/hwconf/other/hw_Cheap_FOCer_2_core.h b/hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_core.h similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2_core.h rename to hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_core.h diff --git a/hwconf/other/hw_Cheap_FOCer_2_no_limits.h b/hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_no_limits.h similarity index 100% rename from hwconf/other/hw_Cheap_FOCer_2_no_limits.h rename to hwconf/shaman/Cheap_FOCer_2/hw_Cheap_FOCer_2_no_limits.h