Exemplo n.º 1
0
void vDebugTask (void *pvParameters)
{
    int Res;
    char strMsgDebug[64];

#ifdef  DEBUG_OUTPUT_USART
    InitUSART(UART_DBG, DBG_BAUDRATE);
    InitDMA(UART_DBG);
#endif


    while(1)
    {
        LED_TOGGLE;
        Res = HandlerCompass(strMsgDebug);
        strcat(strMsgDebug, "\r\n");

        if(!(Res)) {
#ifdef  DEBUG_OUTPUT_USART
            USART_Write(UART_DBG, strMsgDebug, strlen(strMsgDebug));
#endif

#ifdef DEBUG_OUTPUT_USB
            if(bDeviceState == CONFIGURED) {
                CDC_Send_DATA ((unsigned char *)strMsgDebug, strlen(strMsgDebug));
                NVIC_EnableIRQ(USB_LP_CAN1_RX0_IRQn);
            }
#endif
        }

        _delay_ms(1000);
    }
}
Exemplo n.º 2
0
bool FloppyDrive::initialize()
{
	std::stringstream devstring;
	devstring << "/dayos/dev/fdc" << m_devno;
	int retval = vfs_create_device(devstring.str().c_str(), VFS_MODE_RW, VFS_BLOCK_DEVICE);
	if (retval == SIGNAL_FAIL)
	{
		debug_printf("[ FDC ] Could not create device file!\n");
		return false;
	}

	InitDMA();
	Reset();

	int result = VersionCommand();

	if(result == ERR_NOT_SUPPORTED)
	{
		debug_printf("[ FDC ] Your drive is not supported!\n");
		return false;
	}

	if(ConfigureAndLock() == ERR_TIMEOUT)
	{
		debug_printf("[ FDC ] Timeout while configuring drive!\n");
		return false;
	}

	Calibrate(m_devno);

	// Hard code for 1.44M floppies
	setBlockCount(2880);
	debug_printf("[ FDC ] Initialized drive %d\n", m_devno);
	return true;
}
Exemplo n.º 3
0
void LOGIC_Run(void) {
  TMR_Init();
  InitDMA();
  //TransferDMA();
  for (;;) {
    //WAIT1_Waitms(100);
    Run();
  }
}
Exemplo n.º 4
0
void NEO_Init(void) {
  InitTransmitBuf();
  InitDMA();
}
Exemplo n.º 5
0
void NEO_Init(void) {
  InitTransmitBuf();
  InitTimer();
  InitDMA();
  transferComplete = FALSE;
}