|
02/16/2007, 02:23 PM
#292
Great news
TB_TB_TB over at XDA hooked me up with the added ledup driver for red led blink...Many thnaks for TB taking the time to help us WM treo owners out
------------------------------------------------------------------------
NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);
Main cpp file:
Code:
// LEDUp.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "ledz.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
if((_tcslen(lpCmdLine) < 1) || (_tcslen(lpCmdLine) > 3)){
TCHAR buf[50];
_stprintf(buf, _T("Total LEDs reported by Windows: %d"), GetLedCount());
MessageBox(GetForegroundWindow(), _T("LEDUp: a simple command - line tool for LED/vibe setup.\nUsage:\n\nLEDUp.exe ledno ledstate\n\nWhere ledstate:\n\t0\toff (normal)\n\t1\ton\n\t2\tblink\n\nledno is a LED number (sometimes vibe engine is reported as LED)."), _T("LEDUp info"), MB_OK|MB_ICONINFORMATION);
MessageBox(GetForegroundWindow(), buf, _T("LEDUp info"), MB_OK|MB_ICONINFORMATION);
if(IDYES == MessageBox(GetForegroundWindow(), _T("Test the LEDs now?"), _T("LEDUp Test"), MB_YESNO|MB_ICONQUESTION)){
for(int i = 0; i < GetLedCount(); i++){
for(int j = 0; j < 3; j++){
_stprintf(buf, _T("Testing LED #%d, state %d\ncmd. line: LEDUp %d %d"), i, j, i, j);
SetLedStatus(i, j);
MessageBox(GetForegroundWindow(), buf, _T("LEDUp LED test"), MB_OK|MB_ICONINFORMATION);
}
SetLedStatus(i, 0);
}
}
return 0;
}
_tcsrev(lpCmdLine);
SetLedStatus(_wtoi(_tcsrev(lpCmdLine) + 2), _wtoi(_tcsrev(lpCmdLine) + 2));
return 0;
}
--------------------------------------------------------------------------------
Last edited by _TB_TB_ : Today at 09:58 AM. Reason: (sourcecode added)
|
|
|