[ell-i-developers] Re: PWM configuration

  • From: Ivan Raul <supra.material@xxxxxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Fri, 24 Jan 2014 19:19:22 +0200

I suggest the following changes:

@system_init.h

typedef struct {
    const uint16_t           init_data16;
    const uint16_t           init_offset16;
} SystemInitRecordData16NoAddress;

@system_init.c

void SystemInitData16NoAddress(const SystemInitRecordArray *ra) {
...
    for (int i = 0; i < ra->init_record_number; i++) {
        a[r->init_offset16] = r->init_data16;   // Write 16 bits
        r++;

    }
}

@ellduino_timer.c

# define D16(p, r, v) { IF(init_data16) v, IF(init_offset16)  (offsetof(p,
r)/2)}


With Warm Regards, Ivan Raul


On Fri, Jan 24, 2014 at 7:15 PM, Ivan Raul <supra.material@xxxxxxxxx> wrote:

> The problem is that in the example of two 16b registers, that translates
> into a 3 elements 16b array, if we move the pointer by 32b, it will write
> the registers in locations it should not.
>
> With Warm Regards, Ivan Raul
>
>
> On Fri, Jan 24, 2014 at 7:13 PM, Ivan Raul <supra.material@xxxxxxxxx>wrote:
>
>> Hi. I will revise the comments on the pull request.
>>
>> Still, what do you suggest to do with the large array that is generated
>> right now, do you suggest to change to adding the offset to the struct of
>> the SystemInitRecordData16NoAddress, the problem with the current
>> implementation is that if the first two 16b registers are written, as there
>> is one 16b register reserved in between, the array turns to be 3 elements,
>> instead of 2. It just gets worse when the registers are very far from each
>> other.
>>
>> With Warm Regards, Ivan Raul
>>
>>
>> On Fri, Jan 24, 2014 at 7:06 PM, Pekka Nikander <pekka.nikander@xxxxxx>wrote:
>>
>>> I reviewed the commit; it is almost ok but unfortunately you need to be
>>> slightly more careful.  Please fix your commit locally (using git commit
>>> --amend) and push it to github with force (git push -f).  That should
>>> update the pull request.
>>>
>>> --Pekka
>>>
>>> On 2014–01–24, at 17:07 , Ivan Raul <supra.material@xxxxxxxxx> wrote:
>>>
>>> > I made the pull request, has the previous changes. I hope to have
>>> something solid to push later today.
>>> >
>>> > With Warm Regards, Ivan Raul
>>> >
>>> >
>>> > On Fri, Jan 24, 2014 at 4:43 PM, Pekka Nikander <pekka.nikander@xxxxxx>
>>> wrote:
>>> >
>>> > > Pekka: What do you suggest as following step? I was planning first
>>> to make the timer configured from initialization records, and then start
>>> porting the AF default values to the gpio initialization.
>>> >
>>> > Sounds good to me. Also start committing your fixes so that I'll be
>>> able to merge them.
>>> >
>>>
>>>
>>>
>>
>

Other related posts: