Closed andysworkshop closed 8 years ago
@Elektroman2 I've reviewed your pull request and have commited it to a new branch can-support
. Can you verify that it still works for you?
Also, are you planning to commit a simple CAN bus example?
Of course I will publish a simple example soon. Currently I'm using it in a more complex project. I tried to build your last version, unfortunatly it failed.
In file included from /home/elektroman/projects/ARMWorkspace/stm32plus/include/config/can.h:28:0, from ../PowerSupply.cpp:18: /home/elektroman/projects/ARMWorkspace/stm32plus/include/can/CanPeripheral.h: In instantiation of 'stm32plus::CanPeripheral<TPinPackage, TPeripheralName>::CanPeripheral(const stm32plus::CanPeripheral<TPinPackage, TPeripheralName>::Parameters&) [with TPinPackage = stm32plus::Can1DefaultPinPackage; stm32plus::PeripheralName TPeripheralName = (stm32plus::PeripheralName)58u]': /home/elektroman/projects/ARMWorkspace/stm32plus/include/can/f1/Can1.h:50:42: required from 'stm32plus::Can1<Features>::Can1(const stm32plus::CanPeripheral<stm32plus::Can1DefaultPinPackage, (stm32plus::PeripheralName)58u>::Parameters&) [with Features = {stm32plus::Can1InterruptFeature, stm32plus::CanFilterBypassFeature}]' ../PowerSupply.cpp:153:74: required from here /home/elektroman/projects/ARMWorkspace/stm32plus/include/can/CanPeripheral.h:123:75: error: incomplete type 'stm32plus::PeripheralTraits<(stm32plus::PeripheralName)58u>' used in nested name specifier : Can((CAN_TypeDef * )PeripheralTraits<TPeripheralName>::PERIPHERAL_BASE) { ^ /home/elektroman/projects/ARMWorkspace/stm32plus/include/can/CanPeripheral.h: In instantiation of 'void stm32plus::CanPeripheral<TPinPackage, TPeripheralName>::initialisePeripheral() [with TPinPackage = stm32plus::Can1DefaultPinPackage; stm32plus::PeripheralName TPeripheralName = (stm32plus::PeripheralName)58u]': /home/elektroman/projects/ARMWorkspace/stm32plus/include/can/f1/Can1.h:52:6: required from 'stm32plus::Can1<Features>::Can1(const stm32plus::CanPeripheral<stm32plus::Can1DefaultPinPackage, (stm32plus::PeripheralName)58u>::Parameters&) [with Features = {stm32plus::Can1InterruptFeature, stm32plus::CanFilterBypassFeature}]' ../PowerSupply.cpp:153:74: required from here /home/elektroman/projects/ARMWorkspace/stm32plus/include/can/CanPeripheral.h:168:86: error: incomplete type 'stm32plus::PeripheralTraits<(stm32plus::PeripheralName)58u>' used in nested name specifier CAN_Init((CAN_TypeDef *)PeripheralTraits<TPeripheralName>::PERIPHERAL_BASE,&_init); ^ make: *** [PowerSupply.o] Error 1
Too hard to tell the root cause without seeing the line in your source that causes the error. However, this sort of thing compiles cleanly for me. Please compare to yours:
#include "config/can.h"
typedef Can1<CanFilterBypassFeature,CanLoopbackModeFeature,Can1InterruptFeature> MyCan;
MyCan::Parameters p;
MyCan can(p);
I found it, I will send everything tomorrow. ( I messed up things with git :( )
thanks to @spiralray we've now got F4 support and I'm about ready to merge can-support
to master
unless anyone's got any objections...
can-support
is now merged to master
. F0 support will complete this feature but I'll close this issue now and track F0 support under a new issue.
CAN is a major peripheral on the STM32 family and we don't yet support it in stm32plus.