mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-11 01:02:38 +00:00
ChibiOS 2.6.8, until I can figure out where to get it from git.
This commit is contained in:
72
firmware/chibios/os/hal/platforms/MSP430/hal_lld.c
Executable file
72
firmware/chibios/os/hal/platforms/MSP430/hal_lld.c
Executable file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file MSP430/hal_lld.c
|
||||
* @brief MSP430 HAL subsystem low level driver source.
|
||||
*
|
||||
* @addtogroup HAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver exported variables. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver local variables and types. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver local functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver interrupt handlers. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver exported functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Low level HAL driver initialization.
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
void hal_lld_init(void) {
|
||||
|
||||
/* RTC initially stopped.*/
|
||||
WDTCTL = 0x5A80;
|
||||
|
||||
/* Clock sources setup.*/
|
||||
DCOCTL = VAL_DCOCTL;
|
||||
BCSCTL1 = VAL_BCSCTL1;
|
||||
#if MSP430_USE_CLOCK == MSP430_CLOCK_SOURCE_XT2CLK
|
||||
do {
|
||||
int i;
|
||||
IFG1 &= ~OFIFG;
|
||||
for (i = 255; i > 0; i--)
|
||||
asm("nop");
|
||||
} while (IFG1 & OFIFG);
|
||||
#endif
|
||||
BCSCTL2 = VAL_BCSCTL2;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
Reference in New Issue
Block a user