[ell-i-developers] Re: PWM working for TIM2

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Mon, 27 Jan 2014 23:35:25 +0200

>> Nice but far too complicated fix.  The essential things were changing the 
>> type of a to a 32-bit pointer instead of being a 16-bit pointer, as you had 
>> observed, and fixing the D16 macro to compute the right index.
>> In your current code you actually store 32 bits for each 16 bits value, and 
>> then don't use the upper 16 zeroes at all.

> I already fixed the space issue, with the size of the uint32_t and the 
> indexes. 
> From the part that doesn't need typecast you are right, and changing the 
> pointer address is done.
> Now that this is solved, what would be the next step?

Please test once more tomorrow the cleaned up code, and create a pull request.

After that, you can start testing the Serial code.  You will again learn more, 
as this time you'll enter to the wonders of C++ and C++11.  I haven't even 
checked whether the compiler really optimises the const objects away, so more 
assembler reading.  If there are any non-compile-time C++ constructors left, 
then we need to optimise more the C++ so that the compiler does the right thing 
and optimises those away.


Other related posts: