Extremely early stm32 work

I was bored
This commit is contained in:
Josh Stewart 2017-02-08 15:40:44 +11:00
parent 279893f580
commit 8b4008ce27
3 changed files with 53 additions and 26 deletions

View File

@ -22,6 +22,24 @@ board=teensy35
framework=arduino
lib_deps = EEPROM, FlexCAN
[env:LaunchPad_tm4c1294ncpdt]
platform = titiva
framework = energia
board = lptm4c1294ncpdt
lib_deps = EEPROM
[env:genericSTM32F103RB]
platform = ststm32
framework = arduino
; framework-arduinoststm32
board = genericSTM32F103RB
lib_deps = EEPROM
build_flags = -fpermissive
[platformio]
src_dir=speeduino
env_default = megaatmega2560, teensy35
;The following lines are for testing / experimentation only. Comment the line above to try them out
;env_default = LaunchPad_tm4c1294ncpdt
;env_default = genericSTM32F103RB

View File

@ -15,6 +15,8 @@ sendcancommand is called when a comman d is to be sent via serial3 to the Can in
//#include "globals.h"
//#include "storage.h"
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
void canCommand()
{
switch (Serial3.read())
@ -92,3 +94,8 @@ void sendCancommand(uint8_t cmdtype, uint16_t canaddress, uint8_t candata1, uint
}
}
#else
void canCommand() { return; }
void sendCancommand(uint8_t cmdtype, uint16_t canaddress, uint8_t candata1, uint8_t candata2) { return; }
#endif

View File

@ -25,14 +25,11 @@ See page 136 of the processors datasheet: http://www.atmel.com/Images/doc2549.pd
#ifndef SCHEDULER_H
#define SCHEDULER_H
#ifdef __SAM3X8E__
//Do stuff for ARM based CPUs
#else
#include <avr/interrupt.h>
#include <avr/io.h>
#endif
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#include <avr/interrupt.h>
#include <avr/io.h>
//Refer to http://svn.savannah.nongnu.org/viewvc/trunk/avr-libc/include/avr/iomxx0_1.h?root=avr-libc&view=markup
#define FUEL1_COUNTER TCNT3
#define FUEL2_COUNTER TCNT3
@ -129,6 +126,11 @@ See page 136 of the processors datasheet: http://www.atmel.com/Images/doc2549.pd
#define MAX_TIMER_PERIOD 139808 // 2.13333333uS * 65535
#define uS_TO_TIMER_COMPARE(uS) ((uS * 15) >> 5) //Converts a given number of uS into the required number of timer ticks until that time has passed.
#elif defined(STM32_MCU_SERIES)
//Placeholders ONLY!
#define MAX_TIMER_PERIOD 139808 // 2.13333333uS * 65535
#define uS_TO_TIMER_COMPARE(uS) ((uS * 15) >> 5) //Converts a given number of uS into the required number of timer ticks until that time has passed.
#endif
void initialiseSchedulers();