Skip to content

Commit a2cdb10

Browse files
Merge pull request #4932 from LMESTM/can_reset
Fix STM32 CAN reset to not lose context
2 parents 617f410 + 5997811 commit a2cdb10

File tree

33 files changed

+139
-184
lines changed

33 files changed

+139
-184
lines changed

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F0/common_objects.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ struct dac_s {
128128
};
129129
#endif
130130

131+
#if DEVICE_CAN
132+
struct can_s {
133+
CAN_HandleTypeDef CanHandle;
134+
int index;
135+
int hz;
136+
};
137+
#endif
138+
131139
#ifdef __cplusplus
132140
}
133141
#endif

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F1/common_objects.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ struct analogin_s {
116116
uint8_t channel;
117117
};
118118

119+
#if DEVICE_CAN
120+
struct can_s {
121+
CAN_HandleTypeDef CanHandle;
122+
int index;
123+
int hz;
124+
};
125+
#endif
126+
119127
#include "gpio_object.h"
120128

121129
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F2/objects.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,13 @@ struct pwmout_s {
136136
uint8_t inverted;
137137
};
138138

139+
#ifdef DEVICE_CAN
139140
struct can_s {
140-
CANName can;
141+
CAN_HandleTypeDef CanHandle;
141142
int index;
143+
int hz;
142144
};
145+
#endif
143146

144147
#define GPIO_IP_WITHOUT_BRR
145148
#include "gpio_object.h"

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/objects.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
#if defined (DEVICE_CAN)
58-
struct can_s {
59-
CANName can;
60-
int index;
61-
};
62-
#endif
63-
6457
#include "common_objects.h"
6558

6659
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F3/common_objects.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ struct analogin_s {
124124
uint8_t channel;
125125
};
126126

127+
#if DEVICE_CAN
128+
struct can_s {
129+
CAN_HandleTypeDef CanHandle;
130+
int index;
131+
int hz;
132+
};
133+
#endif
134+
127135
#include "gpio_object.h"
128136

129137
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ struct port_s {
4040
__IO uint32_t *reg_out;
4141
};
4242

43-
struct can_s {
44-
CANName can;
45-
int index;
46-
};
47-
4843
struct trng_s {
4944
RNG_HandleTypeDef handle;
5045
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ struct port_s {
4040
__IO uint32_t *reg_out;
4141
};
4242

43-
struct can_s {
44-
CANName can;
45-
int index;
46-
};
47-
4843
struct trng_s {
4944
RNG_HandleTypeDef handle;
5045
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ struct trng_s {
5959
};
6060

6161
#include "common_objects.h"
62-
struct can_s {
63-
CANName can;
64-
int index;
65-
};
66-
6762
#include "gpio_object.h"
6863

6964
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
#include "common_objects.h"
6358

6459
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F4/common_objects.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ struct dac_s {
133133
};
134134
#endif
135135

136+
#if DEVICE_CAN
137+
struct can_s {
138+
CAN_HandleTypeDef CanHandle;
139+
int index;
140+
int hz;
141+
};
142+
#endif
143+
136144
#ifdef __cplusplus
137145
}
138146
#endif

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32F7/common_objects.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ struct flash_s {
132132
uint32_t dummy;
133133
};
134134

135+
#if DEVICE_CAN
136+
struct can_s {
137+
CAN_HandleTypeDef CanHandle;
138+
int index;
139+
int hz;
140+
};
141+
#endif
142+
135143
#ifdef __cplusplus
136144
}
137145
#endif

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ struct port_s {
5454
__IO uint32_t *reg_out;
5555
};
5656

57-
struct can_s {
58-
CANName can;
59-
int index;
60-
};
61-
6257
struct trng_s {
6358
RNG_HandleTypeDef handle;
6459
};

0 commit comments

Comments
 (0)