PWM on AVR ATmega128L
Posted: Mon Sep 19, 2011 8:06 am
Hello,
Im trying implement PWM on ATmega128L. But, it's still got errors and warnings.
when i compile my code i got this :
main.c:55: warning: excess elements in array initializer
main.c:55: warning: (near initialization for 'pwmcfg.pc_channels')
main.c:56: warning: excess elements in array initializer
main.c:56: warning: (near initialization for 'pwmcfg.pc_channels')
main.c:58: warning: excess elements in struct initializer
main.c:58: warning: (near initialization for 'pwmcfg')
main.c:59: warning: implicit declaration of function 'PWM_COMPUTE_FAST'
main.c:59: warning: excess elements in struct initializer
main.c:59: warning: (near initialization for 'pwmcfg')
main.c: In function 'main':
main.c:82: error: 'PWMD1' undeclared (first use in this function)
main.c:82: error: (Each undeclared identifier is reported only once
main.c:82: error: for each function it appears in.)
make: *** [main.o] Error 1
Build failed with 3 errors and 9 warnings...
And my question is :
Why PWMD1 undeclared?
Is it because pwmd1 in here not linked to pwm_lld.h?
i have check that the PWM driver in halconf.h is enabled.
I dont know the cause that invoke those errors and warnings.
Need some advices here.
Thanks.
Regards
Im trying implement PWM on ATmega128L. But, it's still got errors and warnings.
when i compile my code i got this :
main.c:55: warning: excess elements in array initializer
main.c:55: warning: (near initialization for 'pwmcfg.pc_channels')
main.c:56: warning: excess elements in array initializer
main.c:56: warning: (near initialization for 'pwmcfg.pc_channels')
main.c:58: warning: excess elements in struct initializer
main.c:58: warning: (near initialization for 'pwmcfg')
main.c:59: warning: implicit declaration of function 'PWM_COMPUTE_FAST'
main.c:59: warning: excess elements in struct initializer
main.c:59: warning: (near initialization for 'pwmcfg')
main.c: In function 'main':
main.c:82: error: 'PWMD1' undeclared (first use in this function)
main.c:82: error: (Each undeclared identifier is reported only once
main.c:82: error: for each function it appears in.)
make: *** [main.o] Error 1
Build failed with 3 errors and 9 warnings...
And my question is :
Why PWMD1 undeclared?
Is it because pwmd1 in here not linked to pwm_lld.h?
i have check that the PWM driver in halconf.h is enabled.
I dont know the cause that invoke those errors and warnings.
Need some advices here.
Thanks.
Regards