/************************************************************************* * 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 . *************************************************************************/ /** * @file main.c * @author Justin Byers * @date 6 Aug 2019 * @brief USB interface to 6-sensor DDR pads. */ const unsigned int VersionWord __at(0x1C16) = 0x0100; #pragma warning disable 1510 #include "usb.h" #include "padhal.h" #include "dancepad.h" //#ifdef LINK_FOR_BOOTLOADER // only define this if building fw to be used with the bootloader //#endif 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(); } }