recreated repo with new structure to accomodate the bootloader project
This commit is contained in:
50
firmware/src/main.c
Normal file
50
firmware/src/main.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*************************************************************************
|
||||
* Copyright (C) 2019 by Justin Byers
|
||||
*
|
||||
* This file is part of clubdance_v2.
|
||||
*
|
||||
* clubdance_v2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* clubdance_v2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with clubdance_v2. If not, see <https://www.gnu.org/licenses/>.
|
||||
*************************************************************************/
|
||||
/**
|
||||
* @file main.c
|
||||
* @author Justin Byers
|
||||
* @date 6 Aug 2019
|
||||
* @brief USB interface to 6-sensor DDR pads.
|
||||
*/
|
||||
#include "usb.h"
|
||||
#include "padhal.h"
|
||||
#include "dancepad.h"
|
||||
|
||||
const unsigned int VersionWord __at(0x1416) = 0x0100;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
// initialize sensor HAL & the dancepad driver
|
||||
PADHAL_Initialize();
|
||||
DANCEPAD_Initialize();
|
||||
|
||||
// initialize the USB framework
|
||||
USBDeviceInit();
|
||||
USBDeviceAttach();
|
||||
|
||||
while(1)
|
||||
{
|
||||
// do nothing if: not connected to USB host, or the host put us in suspend state
|
||||
if((USBGetDeviceState() < CONFIGURED_STATE) | USBIsDeviceSuspended())
|
||||
continue;
|
||||
|
||||
// run application specific tasks
|
||||
DANCEPAD_Tasks();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user