Skip to content

[NUCLEO_F302R8] Minor changes #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 22, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}
* @{
*/

void SetSysClock(void);

#if (USE_PLL_HSE_XTAL != 0) || (USE_PLL_HSE_EXTC != 0)
uint8_t SetSysClock_PLL_HSE(uint8_t bypass);
#endif
Expand Down Expand Up @@ -208,10 +206,6 @@ void SystemInit(void)
/* Disable all interrupts */
RCC->CIR = 0x00000000;

/* Configure the System clock source, PLL Multiplier and Divider factors,
AHB/APBx prescalers and Flash settings */
SetSysClock();

/* Configure the Vector Table location add offset address ------------------*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Cloc

extern void SystemInit(void);
extern void SystemCoreClockUpdate(void);
extern void SetSysClock(void);

/**
* @}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "analogin_api.h"
#include "wait_api.h"

#if DEVICE_ANALOGIN

#include "wait_api.h"
#include "cmsis.h"
#include "pinmap.h"
#include "error.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
#include <stddef.h>
#include "cmsis.h"

#include "gpio_irq_api.h"
#include "pinmap.h"
#include "error.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl) {
void i2c_frequency(i2c_t *obj, int hz) {
I2C_TypeDef *i2c = (I2C_TypeDef *)(obj->i2c);
I2C_InitTypeDef I2C_InitStructure;
uint32_t tim;
uint32_t tim = 0;

// Disable the Fast Mode Plus capability
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); // Enable SYSCFG clock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

extern void SystemCoreClockUpdate(void);
#include "cmsis.h"

// This function is called after RAM initialization and before main.
void mbed_sdk_init() {
/* Configure the System clock source, PLL Multiplier and Divider factors,
AHB/APBx prescalers and Flash settings */
SetSysClock();

// Update the SystemCoreClock variable.
SystemCoreClockUpdate();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
#include "pwmout_api.h"

#if DEVICE_PWMOUT

#include "cmsis.h"
#include "pinmap.h"
#include "error.h"
Expand Down Expand Up @@ -275,3 +277,5 @@ void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
float value = (float)us / (float)obj->period;
pwmout_write(obj, value);
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
#include "rtc_api.h"

#if DEVICE_RTC

static int rtc_inited = 0;

void rtc_init(void) {
Expand Down Expand Up @@ -136,3 +138,5 @@ void rtc_write(time_t t) {
RTC_SetTime(RTC_Format_BIN, &timeStruct);
PWR_BackupAccessCmd(DISABLE); // Disable access to RTC
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
*******************************************************************************
*/
#include "serial_api.h"

#if DEVICE_SERIAL

#include "cmsis.h"
#include "pinmap.h"
#include "error.h"
Expand Down Expand Up @@ -309,3 +312,5 @@ void serial_break_clear(serial_t *obj) {
USART_RequestCmd(usart, USART_Request_SBKRQ, DISABLE);
USART_ClearFlag(usart, USART_FLAG_SBK);
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
*******************************************************************************
*/
#include "sleep_api.h"
#include "cmsis.h"

// This function is in the system_stm32f30x.c file
extern void SetSysClock(void);
#if DEVICE_SLEEP

#include "cmsis.h"

// MCU SLEEP mode
void sleep(void) {
Expand All @@ -53,3 +53,5 @@ void deepsleep(void) {
// After wake-up from STOP reconfigure the PLL
SetSysClock();
}

#endif