Skip to content

Added init for ODIN EVK LEDs to be off by default #5613

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 2 commits into from
Dec 29, 2017
Merged
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
@@ -0,0 +1,45 @@
/*---------------------------------------------------------------------------
* Copyright (c) 2017, u-blox Malmö, All Rights Reserved
* SPDX-License-Identifier: LicenseRef-PBL
*
* This file and the related binary are licensed under the
* Permissive Binary License, Version 1.0 (the "License");
* you may not use these files except in compliance with the License.
*
* You may obtain a copy of the License here:
* LICENSE-permissive-binary-license-1.0.txt and at
* https://www.mbed.com/licenses/PBL-1.0
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Component : HAL
* File : hal_overrides.c
*
* Description : Placeholder for HAL overrides.
*-------------------------------------------------------------------------*/

#include "stm32f4xx_hal.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a license header here ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

#include "stm32f4xx_hal_rcc.h"
#include "stm32f4xx_hal_gpio.h"

void HAL_MspInit(void)
{
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();

GPIO_InitTypeDef GPIO_InitDef;

GPIO_InitDef.Pin = GPIO_PIN_6 | GPIO_PIN_8;
GPIO_InitDef.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitDef.Pull = GPIO_NOPULL;
GPIO_InitDef.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOB, &GPIO_InitDef);

GPIO_InitDef.Pin = GPIO_PIN_0;
HAL_GPIO_Init(GPIOE, &GPIO_InitDef);

HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_8, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_0, GPIO_PIN_SET);
}