나는 내 문제에 대한 해결책을 찾고 있지만 헛된 것입니다. 내 문제를 해결할만한 것이 아무것도없는 것처럼 보입니다. 나는 너의 도움에 매우 감사한다. 워치 독을 사용하여 temperatureControl()을 호출해야합니다. 그러나 temperatureControl은 2 개의 인수를 사용하며 wdStart는 1 개의 인수 만 사용하여 함수를 호출 할 수 있습니다. 이 문제가 해결 되었습니까?여러 인수가있는 wdStart
wdStart(watchDog, args.tPeriod , (FUNCPTR)temperatureControl, arg1, arg2);
코드 :
struct arguments{ int tPeriod; /* Time in ticks used inside watchdog to change temperature*/ int room; /* Room targetted */ int temperature; /* Desired temperature*/ }; /* Set the chosen room to the desired temperature after tperiod time*/ void setTemperatureUsingWatchDog(struct arguments args) { watchDog = wdCreate(); wdStart(watchDog, args.tPeriod , (FUNCPTR)temperatureControl, args); logMsg("Room #%d",args.room, "temperature is set to%f", roomTemperature[args.room],0,0,0);
세 개의 인수를 모두'struct'에 추가 한 다음 구조체를 하나의 단일 인수로 전달하려고 시도합니다. –
'watchdog'이 정확히 무엇인지 모르지만 유형이 유연한 경우 항상 여러 객체를 구조체. – nchen24
총상을 줘 보자. 고마워요 – Oliver