Search found 5 matches

by jgobuyan
Fri Aug 02, 2013 1:50 am
Forum: General Support
Topic: Consider adding chsprintf
Replies: 6
Views: 4042

Re: Consider adding chsprintf

I would normally avoid using sprintf in embedded code but I'm just porting existing code (cJSON) that expects an sprintf like function. I don't how easy it is to modify it to use the memstreams abstraction.
by jgobuyan
Fri Jun 07, 2013 1:25 am
Forum: General Support
Topic: Consider adding chsprintf
Replies: 6
Views: 4042

Re: Consider adding chsprintf

What I did was simply copy chprintf() and paste to chsprintf() and replace all references to chSequentialStreamPut() to *(buf++). The original chprintf() is there as well. It's just a little inefficient to have the code duplicated, but it was a quick and dirty fix for me. I think rewriting chprintf(...
by jgobuyan
Thu Jun 06, 2013 5:15 pm
Forum: General Support
Topic: Consider adding chsprintf
Replies: 6
Views: 4042

Consider adding chsprintf

Hi, I ported cJSON code to run under ChibiOS and one of the things I needed was a lightweight sprintf() function in order to avoid linking in the standard one. I essentially modified the existing chprintf.c/chprintf.h files to add a chsprintf() function because you already have all the supporting st...
by jgobuyan
Thu Jun 06, 2013 2:54 pm
Forum: STM32 Support
Topic: [DONE] USART control registers should be 32 bits
Replies: 2
Views: 2124

[DONE] USART control registers should be 32 bits

Hi, I needed to access the RS485 feature of the STM32 USART and found out that the CR1, CR2 and CR3 initialization fields in the SerialConfig struct are defined as uint16_t. These should be uint32_t. Jerome @@ -221,15 +221,15 @@ /** * @brief Initialization value for the CR1 register. */ - uint16_t s...
by jgobuyan
Tue May 14, 2013 3:04 am
Forum: User Projects
Topic: STM32F373 SDADC lld
Replies: 8
Views: 7451

Re: STM32F373 SDADC lld

Hi, I am looking at the latest SDADC code in mabl and there seems to be a type conflict with adcsample_t. For regular ADC conversions, uint16_t is appropriate, but for all other conversion types (injected ADC, regular and injected SDADC), the type should really be signed. I realize that you are only...

Go to advanced search