STM32F411: get rid of asserts.
No functional change, binary size 118 bytes smaller.
This commit is contained in:
parent
03457bdf4f
commit
b1fa1e2e88
|
|
@ -127,7 +127,6 @@ ifeq ($(MCU), stm32f411)
|
|||
SOURCES += mbed-stm32f4xx_hal_rcc.c
|
||||
SOURCES += mbed-stm32f4xx_hal_tim.c
|
||||
SOURCES += mbed-stm32f4xx_hal_uart.c
|
||||
SOURCES += mbed-assert.c
|
||||
SOURCES += mbed-cmsis_nvic_stm32.c
|
||||
SOURCES += mbed-pinmap_stm32.c
|
||||
SOURCES += mbed-PeripheralPins_stm32.c
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2013 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "mbed-mbed_assert.h"
|
||||
#include "mbed-mbed_error.h"
|
||||
|
||||
void mbed_assert_internal(const char *expr, const char *file, int line)
|
||||
{
|
||||
error("mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
|
||||
}
|
||||
|
|
@ -42,7 +42,6 @@
|
|||
#ifndef MBED_GPIO_OBJECT_H
|
||||
#define MBED_GPIO_OBJECT_H
|
||||
|
||||
#include "mbed-mbed_assert.h"
|
||||
#include "mbed-cmsis_stm32.h"
|
||||
#include "mbed-PortNames_stm32.h"
|
||||
#include "mbed-PeripheralNames_stm32.h"
|
||||
|
|
@ -61,7 +60,6 @@ typedef struct {
|
|||
|
||||
static inline void gpio_write(gpio_t *obj, int value)
|
||||
{
|
||||
MBED_ASSERT(obj->pin != (PinName)NC);
|
||||
if (value) {
|
||||
*obj->reg_set_clr = obj->mask;
|
||||
} else {
|
||||
|
|
@ -71,7 +69,6 @@ static inline void gpio_write(gpio_t *obj, int value)
|
|||
|
||||
static inline int gpio_read(gpio_t *obj)
|
||||
{
|
||||
MBED_ASSERT(obj->pin != (PinName)NC);
|
||||
return ((*obj->reg_in & obj->mask) ? 1 : 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
AVR builds.
|
||||
*/
|
||||
#ifdef __ARM_STM32F411__
|
||||
#include "mbed-mbed_assert.h"
|
||||
#include "mbed-pinmap.h"
|
||||
#include "mbed-PortNames_stm32.h"
|
||||
#include "mbed-mbed_error.h"
|
||||
|
|
@ -141,7 +140,6 @@ uint32_t Set_GPIO_Clock(uint32_t port_idx)
|
|||
*/
|
||||
void pin_function(PinName pin, int data)
|
||||
{
|
||||
MBED_ASSERT(pin != (PinName)NC);
|
||||
// Get the pin informations
|
||||
uint32_t mode = STM_PIN_MODE(data);
|
||||
uint32_t pupd = STM_PIN_PUPD(data);
|
||||
|
|
@ -178,7 +176,6 @@ void pin_function(PinName pin, int data)
|
|||
*/
|
||||
void pin_mode(PinName pin, PinMode mode)
|
||||
{
|
||||
MBED_ASSERT(pin != (PinName)NC);
|
||||
uint32_t port_index = STM_PORT(pin);
|
||||
uint32_t pin_index = STM_PIN(pin);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
- Fixed mbed_uart0_irq() function prototype.
|
||||
*/
|
||||
#ifdef __ARM_STM32F411__
|
||||
#include "mbed-mbed_assert.h"
|
||||
#include "mbed-serial_api.h"
|
||||
|
||||
#if DEVICE_SERIAL
|
||||
|
|
@ -97,7 +96,6 @@ void mbed_serial_init(serial_t *obj, PinName tx, PinName rx)
|
|||
|
||||
// Get the peripheral name (UART_1, UART_2, ...) from the pin and assign it to the object
|
||||
obj->uart = (UARTName)pinmap_merge(uart_tx, uart_rx);
|
||||
MBED_ASSERT(obj->uart != (UARTName)NC);
|
||||
|
||||
// Enable USART clock
|
||||
switch (obj->uart) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue