The following bit of code is from the Atmel AtUsbHid example. Can someone please explain the line DYNCALL(writeData)((UCHAR *)"12") which i believe is part of a DLL, maybe....

I know the code turns on and off a LED but i want to know how the code works....

void CUsbHidDemoCodeDlg::OnLed2() 
{
 if(Led2 == false) {
  Led2 = true;
  m_Led2.SetWindowText(_T("LED 2 ON"));  
  DYNCALL(writeData)((UCHAR *)"12");
 }
 else {
  Led2 = false;
  m_Led2.SetWindowText(_T("LED 2 OFF"));  
  DYNCALL(writeData)((UCHAR *)"02");
 }
 
}

Thanks
Don

I don't know the function, but it looks to me like it is calling de uC to writedata (led 2 on = 12, led 2 off = 02). Perhaps the datasheet could clear this up?

Niek

DYNCALL is a macro that is expanded by your compiler. You will have to look in some *.h file where that macro is defined if you want to know exactly what it does.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.