Author Topic: Even If Simple Alarm In Pdaxrom?  (Read 5973 times)

shula

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
Even If Simple Alarm In Pdaxrom?
« Reply #15 on: January 15, 2005, 10:21:11 am »
so do i need to calculate how many seconds left before alarm?

---
#!/bin/bash
secs = alram_due_time - currecnt_time
execute apmsleep  <secs>
xmms filename.wav
---
??
C860, pdaxrom rc8,
with Gnumeric as the perfect PIM :-)

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Even If Simple Alarm In Pdaxrom?
« Reply #16 on: January 15, 2005, 12:04:38 pm »
see the man page here for instance.
SLC-860 cacko / senao wifi

gromituk

  • Full Member
  • ***
  • Posts: 207
    • View Profile
Even If Simple Alarm In Pdaxrom?
« Reply #17 on: January 17, 2005, 12:13:14 pm »
Quote
It all boils down to reading the RTC register, addind the apropriate number of seconds one wants
to sleep , and then writing this back into the Alarm Register prior to going to sleep.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

Sorry to wander off-topic into reminiscence-land, but this reminds me of the old calculator-style [a href=\"http://www.wickidsoftware.freeserve.co.uk/comput/psion1.jpg]Psion II[/url] from the mid-80s.  Its "custom chip" was basically a chain of flip-flops connected to a 32kHz crystal.  This provided an interrupt every second while it was switched on, to keep its clock running (no real time clock chip).  This in itself was tricky to do right, because a second could be lost each time you switched it on if you weren't careful.

But things really got interesting when it was powered down.  Every time you switched it off, it calculated how many seconds to the next alarm.  It then reset the latter part of its counter chain, and
manually clocked it to the right offset
before switching off the machine.  (For example, to pre-load it with 100 seconds, the processor would waggle its clock pin 100 times.)  When the counter overflowed, it woke the machine up again.

Luckily, the counter chain wasn't too long, but the downside of this was that it would overflow in 34 minutes 8 seconds (which is the period of 32kHz divided by 2^the number of flip flops).  The upshot of this was that even when no alarms were set, every 34 minutes and 8 seconds the Psion would be rudely awakened, update its time value by 34 minutes 8 seconds, check whether there was an alarm due in the next 34 minutes and 8 seconds, pre-load the counter if necessary, and then fall asleep again.  And it would both snooze like this for months on a PP3 battery, and switch off a lot more quickly when you wanted it to than the Z running PdaXrom does!

If Psion could get that to work, surely it's not beyond the wit of man to get the Z to wake up when you want it to.

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Even If Simple Alarm In Pdaxrom?
« Reply #18 on: November 23, 2006, 06:20:07 pm »
It looks like this alarm idea was given up on, has anyone out there got pdax to wake up successfully at a given time? Would be a nice feature especially if it could be used with gpe-calendar or something like it...

InSearchOf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
    • http://
Even If Simple Alarm In Pdaxrom?
« Reply #19 on: November 23, 2006, 06:34:31 pm »
Well... since the migration to 2.6 kernel series... apm had to be rebuilt for the most part... so I think once we work out all the bugs in it... we could get that functionally working well... but right now... it could work... but tests to get that working havent been made by me....

Late
Sharp Zaurus SL-C3100 and SL-6000L
pdaXrom Developer
Please visit pdaXrom.org for updates
My Blog
IRC #pdaxrom @ FreeNode

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Even If Simple Alarm In Pdaxrom?
« Reply #20 on: November 23, 2006, 08:47:15 pm »
Quote
It looks like this alarm idea was given up on, has anyone out there got pdax to wake up successfully at a given time? Would be a nice feature especially if it could be used with gpe-calendar or something like it...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147110\"][{POST_SNAPBACK}][/a][/div]
It was fixed with kernel patches from beta1 (I think?) onward. All you need is a program that sets alarms - ko/pi does it directly through apm scripts, and gpe-calendar uses atd (which I prefer and seems more reliable).

The only problem is that gpe-calendar versions for beta1/beta3 have broken alarm functions! Search this forum for another topic somewhere which describes how to fix it if you go this way.
SL6000-L, RC12