> - ;@jallib tags are used in test_ and board_ files to create samples. Yeah, I'll remove that line. I copy / pasted the chip include and config settings from another sample. Just forgot to remove it.
> - I wonder if rtc_read() shouldn't be considered an internal procedure > and thus start with an underscore I was considering this as well, I suppose you are probably right. > - I think it is good to add more comment to the sample file. The use > of pseudo vars makes setup of the clock look so simple, that I had to > look at it twice (or mybe even 4 times ;) before I understood how > powerfull this is. Like: > rtc_hours = 16 -- trigger i2c comms with rtc_bq32000 to set hours to 16. I probably should have put more commenting in. I just didn't want to "over comment" everything. There is nothing more annoying to me than looking at a program that is literally 6 lines of code yet is 50 lines long because of all the unnecessary comments. I agree though, I'll be adding a few extra comments to make it more clear. > Thinking about this: how do you make sure the independent > reading/setting of vars results in a consistent set of date? E.g. at > 13:59, you read the hours (13) and before you can read the minutes, > the clock is incremented to 14:00 so you read 00 with 13:00 as a > result. This is a really good question. I'm hoping some of the more experienced programmers may be able to chime in here. The hours, minutes, and seconds are all retrieved from different read cycles because they are stored in separate registers on the rtc. There really isn't any way to read them all at the _exact_ same time. As for setting the clock, there is a way to stop the rtc oscillator by setting the oscillator stop bit (bit 7 in the SECONDS register). Maybe set the osc stop bit before writing the time and then clearing it when finished would suffice? Thank you for taking a look. I'll have the modified version up here in a bit. -Brian E. On Jan 24, 2:36 pm, Joep Suijs <[email protected]> wrote: > Hi Brian, > > Impressive piece of work! And indeed, well done in the style of > jallib. Only a few (nitpicking) issues: > - ;@jallib tags are used in test_ and board_ files to create samples. > No point in using them in hand-created samples. > - There is something odd on the 'Notes:' tag - the validation program > complaints about it but I am not sure why. But maybe Seb can tell us. > - I wonder if rtc_read() shouldn't be considered an internal procedure > and thus start with an underscore. > - I think it is good to add more comment to the sample file. The use > of pseudo vars makes setup of the clock look so simple, that I had to > look at it twice (or mybe even 4 times ;) before I understood how > powerfull this is. Like: > rtc_hours = 16 -- trigger i2c comms with rtc_bq32000 to set hours to 16. > > Thinking about this: how do you make sure the independent > reading/setting of vars results in a consistent set of date? E.g. at > 13:59, you read the hours (13) and before you can read the minutes, > the clock is incremented to 14:00 so you read 00 with 13:00 as a > result. Not an issue when you continues put it on screen. But when you > use it for logging or - worse - while setting the clock.... > > Having said this, I want to repeat it is an impressive piece of work. Well > done! > > Joep. > > 2011/1/24 Brian Edmonson <[email protected]>: > > > Oh, I almost forgot. Here's a screen shot of the output from the sample > > program. > > > Regards, > > > -Brian E. > > > Attachments: rtc_sample_output.jpg > > > -- > > You received this message because you are subscribed to the Google Groups > > "jallib" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group at > >http://groups.google.com/group/jallib?hl=en. -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
