mirror of
https://salsa.debian.org/gnuk-team/gnuk/gnuk.git
synced 2024-09-20 02:40:08 +00:00
Clean up board specific functions.
This commit is contained in:
parent
8a88c279bf
commit
e614fad8db
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# generated files by 'configure'
|
||||
src/Makefile
|
||||
src/config.h
|
||||
src/gnuk.ld
|
@ -45,3 +45,21 @@ void hwinit0(void) {
|
||||
void hwinit1(void) {
|
||||
#include "../common/hwinit1.c"
|
||||
}
|
||||
|
||||
void
|
||||
USB_Cable_Config (FunctionalState NewState)
|
||||
{
|
||||
if (NewState != DISABLE)
|
||||
palClearPad (IOPORT3, GPIOC_DISC);
|
||||
else
|
||||
palSetPad (IOPORT3, GPIOC_DISC);
|
||||
}
|
||||
|
||||
void
|
||||
set_led (int value)
|
||||
{
|
||||
if (value)
|
||||
palClearPad (IOPORT3, GPIOC_LED);
|
||||
else
|
||||
palSetPad (IOPORT3, GPIOC_LED);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# List of all the board related files.
|
||||
BOARDSRC = ../boards/OLIMEX_STM32_H103/board.c \
|
||||
../boards/OLIMEX_STM32_H103/hw_config.c
|
||||
../boards/common/hw_config.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = ../boards/OLIMEX_STM32_H103
|
||||
|
@ -51,3 +51,21 @@ void hwinit1(void) {
|
||||
palClearPad (IOPORT5, GPIOE_LED);
|
||||
palClearPad (IOPORT3, GPIOC_SHUTDOWN);
|
||||
}
|
||||
|
||||
void
|
||||
USB_Cable_Config (FunctionalState NewState)
|
||||
{
|
||||
if (NewState != DISABLE)
|
||||
palClearPad (IOPORT4, GPIOD_DISC);
|
||||
else
|
||||
palSetPad (IOPORT4, GPIOD_DISC);
|
||||
}
|
||||
|
||||
void
|
||||
set_led (int value)
|
||||
{
|
||||
if (value)
|
||||
palClearPad (IOPORT5, GPIOE_LEDR);
|
||||
else
|
||||
palSetPad (IOPORT5, GPIOE_LEDR);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# List of all the board related files.
|
||||
BOARDSRC = ../boards/STM32_PRIMER2/board.c \
|
||||
../boards/STM32_PRIMER2/hw_config.c
|
||||
../boards/common/hw_config.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = ../boards/STM32_PRIMER2
|
||||
|
@ -1,56 +0,0 @@
|
||||
/* Hardware specific USB functions */
|
||||
/*
|
||||
* For detail, please see the documentation of
|
||||
* STM32F10x USB Full Speed Device Library (USB-FS-Device_Lib)
|
||||
* by STMicroelectronics' MCD Application Team
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
#include "board.h"
|
||||
#include "usb_lib.h"
|
||||
#include "usb_prop.h"
|
||||
#include "usb_desc.h"
|
||||
#include "hw_config.h"
|
||||
#include "platform_config.h"
|
||||
#include "usb_pwr.h"
|
||||
|
||||
void
|
||||
Enter_LowPowerMode (void)
|
||||
{
|
||||
bDeviceState = SUSPENDED;
|
||||
}
|
||||
|
||||
void
|
||||
Leave_LowPowerMode (void)
|
||||
{
|
||||
DEVICE_INFO *pInfo = &Device_Info;
|
||||
|
||||
if (pInfo->Current_Configuration != 0)
|
||||
bDeviceState = CONFIGURED;
|
||||
else
|
||||
bDeviceState = ATTACHED;
|
||||
}
|
||||
|
||||
void
|
||||
USB_Cable_Config (FunctionalState NewState)
|
||||
{
|
||||
if (NewState != DISABLE)
|
||||
palClearPad (IOPORT4, GPIOD_DISC);
|
||||
else
|
||||
palSetPad (IOPORT4, GPIOD_DISC);
|
||||
}
|
||||
|
||||
void
|
||||
Get_SerialNum (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
set_led (int value)
|
||||
{
|
||||
if (value)
|
||||
palClearPad (IOPORT5, GPIOE_LEDR);
|
||||
else
|
||||
palSetPad (IOPORT5, GPIOE_LEDR);
|
||||
}
|
@ -32,25 +32,7 @@ Leave_LowPowerMode (void)
|
||||
bDeviceState = ATTACHED;
|
||||
}
|
||||
|
||||
void
|
||||
USB_Cable_Config (FunctionalState NewState)
|
||||
{
|
||||
if (NewState != DISABLE)
|
||||
palClearPad (IOPORT3, GPIOC_DISC);
|
||||
else
|
||||
palSetPad (IOPORT3, GPIOC_DISC);
|
||||
}
|
||||
|
||||
void
|
||||
Get_SerialNum (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
set_led (int value)
|
||||
{
|
||||
if (value)
|
||||
palClearPad (IOPORT3, GPIOC_LED);
|
||||
else
|
||||
palSetPad (IOPORT3, GPIOC_LED);
|
||||
}
|
Loading…
Reference in New Issue
Block a user