Tool/software: Linux
#include "contiki.h" //#include "/os/dev/PWM.h" #include "dev/leds.h" #include "ti-lib.h" #include <stdio.h> #include <arch/cpu/simplelink-cc13xx-cc26xx/lib/coresdk_cc13xx_cc26xx/source/ti/drivers/PWM.h> /*---------------------------------------------------------------------------*/ PROCESS(hello_world_process, "Hello world process"); AUTOSTART_PROCESSES(&hello_world_process); /*---------------------------------------------------------------------------*/ PROCESS_THREAD(hello_world_process, ev, data) { PWM_Handle pwm1; PWM_Params params; uint16_t pwmPeriod = 3000; // Period and duty in microseconds uint16_t duty = 0; uint16_t dutyInc = 100; PWM_Params_init(¶ms); params.dutyUnits = PWM_DUTY_US; params.dutyValue = 0; params.periodUnits = PWM_PERIOD_US; params.periodValue = pwmPeriod; pwm1 = PWM_open(LEDS_RED, ¶ms); PROCESS_BEGIN(); if (pwm1 == NULL) { // PWM_open() failed while (1); } PWM_start(pwm1); /* Loop forever incrementing the PWM duty */ while (1) { PWM_setDuty(pwm1, duty); PWM_start(pwm1); duty = (duty + dutyInc); if (duty == pwmPeriod || (!duty)) { dutyInc = - dutyInc; } } PROCESS_END(); }
got this error---
make TARGET=srf06-cc26xx BOARD=launchpad/cc2650 hello-world.upload
CC ../../arch/cpu/cc26xx-cc13xx/lib/cc26xxware/startup_files/ccfg.c
CC ../../arch/cpu/cc26xx-cc13xx/./ieee-addr.c
CC ../../arch/cpu/cc26xx-cc13xx/./fault-handlers.c
CC ../../arch/cpu/cc26xx-cc13xx/lib/cc26xxware/startup_files/startup_gcc.c
CC hello-world.c
LD hello-world.elf
hello-world.o: In function `process_thread_hello_world_process':
hello-world.c:(.text.process_thread_hello_world_process+0x10): undefined reference to `PWM_Params_init'
hello-world.c:(.text.process_thread_hello_world_process+0x24): undefined reference to `PWM_open'
hello-world.c:(.text.process_thread_hello_world_process+0x38): undefined reference to `PWM_setDuty'
hello-world.c:(.text.process_thread_hello_world_process+0x40): undefined reference to `PWM_start'
collect2: error: ld returned 1 exit status
../../arch/cpu/arm/cortex-m/cm3/Makefile.cm3:27: recipe for target 'hello-world.elf' failed
make: *** [hello-world.elf] Error 1
rm hello-world.o obj_srf06-cc26xx/startup_gcc.o obj_srf06-cc26xx/fault-handlers.o
why it is showing anyone got any idea...