Search found 13 matches

by XXzzz
Thu May 31, 2018 5:08 am
Forum: ChibiOS/HAL
Topic: some question about source code
Replies: 8
Views: 517

Re: some question about source code

this code is in the CHIBIOS182->testex->STM32F4XX->I2C-BMP085
maybe my problem description is not very accurate,
thanks for your help again
by XXzzz
Thu May 31, 2018 5:05 am
Forum: ChibiOS/HAL
Topic: some question about source code
Replies: 8
Views: 517

some question about source code

when i reading the source code ,i have some question about the object oriented in chibios. the struct BMP085Driver have four members,and there have some methods in the vmt. static BMP085Driver BMP085D1; /** * @brief BMP085 driver structure. */ struct BMP085Driver { /** @brief BaseSensor Virtual Meth...
by XXzzz
Mon Jan 08, 2018 4:57 am
Forum: ChibiOS/HAL
Topic: about the pwm callback
Replies: 1
Views: 229

about the pwm callback

i have some question about the pwm driver...i draw a picture to describe this question ,but i don't know how to post it to this ..... :oops: https://drive.google.com/file/d/1r3nk972_LFE7r7QH6eT9CYx8CAUIWMmP/view?usp=sharing i use the stm32f103,maybe i need to change the pwm config to deal this probl...
by XXzzz
Mon Jan 01, 2018 9:00 am
Forum: STM32 Support
Topic: a project with pwm and adc
Replies: 9
Views: 526

Re: a project with pwm and adc

i got that.That's a really good way to do it. I need pay more attention to the doc.thanks again
by XXzzz
Sun Dec 31, 2017 2:24 pm
Forum: STM32 Support
Topic: a project with pwm and adc
Replies: 9
Views: 526

Re: a project with pwm and adc

now my code has another bug.., when i set the depth=8,and the callback return the n =4, depth=16,n=8; this is my test code ,it work like pwmstart->pwmcallback->adcStartConversion->adccallback->Bsem->thread then the thread print the samples buffer and n. #include <stdio.h> #include <string.h> #includ...
by XXzzz
Sun Dec 31, 2017 10:23 am
Forum: STM32 Support
Topic: a project with pwm and adc
Replies: 9
Views: 526

Re: a project with pwm and adc

now i change the thread to this static THD_WORKING_AREA(waThread2, 128); static THD_FUNCTION(Thread2, arg) { (void)arg; chRegSetThreadName("current"); while (true) { msg_t msg = chBSemWaitTimeout(&current_bsem, MS2ST(500)); /* time out*/ if (msg == MSG_TIMEOUT) { chprintf((BaseSequenti...
by XXzzz
Fri Dec 29, 2017 12:17 pm
Forum: STM32 Support
Topic: a project with pwm and adc
Replies: 9
Views: 526

Re: a project with pwm and adc

now i do a new test on stm32f103zet6 #include <stdio.h> #include <string.h> #include "ch.h" #include "hal.h" #include "ch_test.h" #include "usbcfg.h" #include "myshell.h" #define SHELL_WA_SIZE THD_WORKING_AREA_SIZE(2048) binary_semaphore_t bsem; stat...
by XXzzz
Fri Dec 29, 2017 11:10 am
Forum: STM32 Support
Topic: a project with pwm and adc
Replies: 9
Views: 526

Re: a project with pwm and adc

now i change my code to test my callback ,clear the light in callback ,and set the light in thread ,and callback is working, static void pwmc1cb(PWMDriver *pwmp) { (void)pwmp; chSysLockFromISR(); adcStartConversionI(&ADCD1, &adcgrpcfg, samples, ADC_GRP_BUF_DEPTH); chSysUnlockFromISR(); palCl...
by XXzzz
Fri Dec 29, 2017 10:25 am
Forum: STM32 Support
Topic: a project with pwm and adc
Replies: 9
Views: 526

a project with pwm and adc

I use the pwm to control the motor and adc to get Sampling current. 1.in pwm chanel callback static void pwmc1cb(PWMDriver *pwmp) { (void)pwmp; chSysLockFromISR(); adcStartConversionI(&ADCD1, &adcgrpcfg, samples, ADC_GRP_BUF_DEPTH); chSysUnlockFromISR(); } 2. in adc callback static void adcc...
by XXzzz
Wed Dec 20, 2017 8:47 am
Forum: STM32 Support
Topic: qusetion about uart and shell
Replies: 4
Views: 254

Re: qusetion about uart and shell

Thanks again for your help

Go to advanced search