tux-droid-svn Mailing List for Tux Droid CE (Page 218)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Paul_R <c2m...@c2...> - 2007-10-04 15:08:56
|
Author: Paul_R Date: 2007-10-04 17:08:19 +0200 (Thu, 04 Oct 2007) New Revision: 580 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Fix a bug which freeze the gadget. * Add buttons to search light and dark Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-04 15:08:19 UTC (rev 580) @@ -49,7 +49,7 @@ <widget class="GtkExpander" id="expander1"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="expanded">True</property> + <property name="expanded">False</property> <property name="spacing">0</property> <child> @@ -452,6 +452,26 @@ <property name="y">48</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="chkChangeNotified"> + <property name="width_request">168</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">checkbutton1</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">328</property> + <property name="y">24</property> + </packing> + </child> </widget> </child> </widget> @@ -516,7 +536,7 @@ <widget class="GtkExpander" id="expander2"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="expanded">True</property> + <property name="expanded">False</property> <property name="spacing">0</property> <child> @@ -698,6 +718,26 @@ </child> <child> + <widget class="GtkCheckButton" id="chk_ThresholdBehavior"> + <property name="width_request">168</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">checkbutton2</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">328</property> + <property name="y">40</property> + </packing> + </child> + + <child> <widget class="GtkFileChooserButton" id="threshold_behavior_path"> <property name="width_request">168</property> <property name="height_request">32</property> @@ -717,7 +757,7 @@ </child> <child> - <widget class="GtkCheckButton" id="chk_ThresholdBehavior"> + <widget class="GtkCheckButton" id="chkThresholdNotified"> <property name="width_request">168</property> <property name="height_request">24</property> <property name="visible">True</property> @@ -732,7 +772,7 @@ </widget> <packing> <property name="x">328</property> - <property name="y">40</property> + <property name="y">16</property> </packing> </child> </widget> @@ -796,9 +836,136 @@ </child> <child> + <widget class="GtkExpander" id="expander3"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="expanded">True</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed5"> + <property name="height_request">34</property> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="lblBtnDark"> + <property name="width_request">130</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btnDark_clicked" last_modification_time="Wed, 03 Oct 2007 09:23:25 GMT"/> + </widget> + <packing> + <property name="x">208</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="lblBtnLight"> + <property name="width_request">130</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btnLight_clicked" last_modification_time="Wed, 03 Oct 2007 09:23:19 GMT"/> + </widget> + <packing> + <property name="x">48</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="lblTest"> + <property name="visible">True</property> + <property name="label" translatable="yes">Test</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> <widget class="GtkFrame" id="frame3"> <property name="border_width">5</property> - <property name="height_request">89</property> + <property name="height_request">136</property> <property name="visible">True</property> <property name="label_xalign">0</property> <property name="label_yalign">0.5</property> @@ -856,16 +1023,16 @@ </widget> <packing> <property name="x">168</property> - <property name="y">32</property> + <property name="y">40</property> </packing> </child> <child> - <widget class="GtkLabel" id="lblSample"> - <property name="width_request">240</property> + <widget class="GtkLabel" id="lblRate"> + <property name="width_request">224</property> <property name="height_request">24</property> <property name="visible">True</property> - <property name="label" translatable="yes">Sample :</property> + <property name="label" translatable="yes">Rate :</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -882,14 +1049,14 @@ </widget> <packing> <property name="x">0</property> - <property name="y">32</property> + <property name="y">8</property> </packing> </child> <child> <widget class="GtkButton" id="btnApply"> <property name="width_request">144</property> - <property name="height_request">40</property> + <property name="height_request">30</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> @@ -961,17 +1128,17 @@ </child> </widget> <packing> - <property name="x">424</property> - <property name="y">16</property> + <property name="x">0</property> + <property name="y">72</property> </packing> </child> <child> - <widget class="GtkLabel" id="lblRate"> - <property name="width_request">224</property> + <widget class="GtkLabel" id="lblSample"> + <property name="width_request">240</property> <property name="height_request">24</property> <property name="visible">True</property> - <property name="label" translatable="yes">Rate :</property> + <property name="label" translatable="yes">Sample :</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -988,9 +1155,48 @@ </widget> <packing> <property name="x">0</property> - <property name="y">8</property> + <property name="y">40</property> </packing> </child> + + <child> + <widget class="GtkComboBox" id="cbbConfig"> + <property name="width_request">150</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes">1 +2 +3 +4 +5 +6 +7</property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">320</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnSet"> + <property name="width_request">149</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">button1</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="pressed" handler="on_btnSet_pressed" last_modification_time="Thu, 04 Oct 2007 14:52:44 GMT"/> + </widget> + <packing> + <property name="x">320</property> + <property name="y">40</property> + </packing> + </child> </widget> </child> </widget> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-04 15:08:19 UTC (rev 580) @@ -45,7 +45,6 @@ self.get_widget("window1").set_title(_me.string('name_to_read')) #Set the labels - print 'tick' self.get_widget("radBoth").set_label(_me.string('widget_lblBoth')) self.get_widget("lblBtnApply").set_text(_me.string('widget_lblBtnApply')) self.get_widget("lblChange").set_text(_me.string('widget_lblChange')) @@ -63,9 +62,24 @@ self.get_widget("chkThreshold").set_label(_me.string('widget_lblDisplayThreshold')) self.get_widget('chk_ThresholdBehavior').set_label(_me.string('widget_lblBehavior')) self.get_widget('chk_ChangeBehavior').set_label(_me.string('widget_lblBehavior')) + self.get_widget('chkChangeNotified').set_label(_me.string('widget_lblNotified')) + self.get_widget('chkThresholdNotified').set_label(_me.string('widget_lblNotified')) self.get_widget("lblRate").set_text(_me.string('gui_conf_rate_lb')) self.get_widget("lblSample").set_text(_me.string('gui_conf_sample_lb')) - + self.get_widget("lblBtnDark").set_label(_me.string('widget_lblDark')) + self.get_widget("lblBtnLight").set_label(_me.string('widget_lblLight')) + self.get_widget("btnSet").set_label(_me.string('widget_lblSet')) + + for i in range (7): + self.get_widget('cbbConfig').remove_text(0) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblDrop')) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblRaise')) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblChangeD')) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblChangeU')) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblIncrease')) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblDecrease')) + self.get_widget('cbbConfig').append_text(_me.string('conf_lblBoth')) + self.get_widget('cbbConfig').set_active(0) thread.start_new_thread(self.update, ()) ########################################################### @@ -85,7 +99,6 @@ #Drop _me.set_param('drop', self.light_measure.val_drop) self.get_widget("valDrop_percent").set_text(str(_me.get_param('drop'))) - print self.light_measure.val_drop_time _me.set_param('drop_time', self.light_measure.val_drop_time) self.get_widget("valDrop_time").set_text(str(_me.get_param('drop_time'))) @@ -111,8 +124,8 @@ _me.set_param('threshold', self.light_measure.val_threshold) self.get_widget("valThreshold").set_text(str(_me.get_param('threshold'))) + self.light_measure.change_control() - #update the radio button status self.light_measure.drop = _me.get_param('drop_rad') self.light_measure.raising = _me.get_param('raise_rad') @@ -125,11 +138,12 @@ self.light_measure.changetext = _me.string('conf_lblChange') self.light_measure.thresholdtext = _me.string('conf_lblThreshold') # '' the check boxes + self.light_measure.change_notified = _me.get_param('change_notified') + self.light_measure.threshold_notified = _me.get_param('threshold_notified') self.light_measure.threshold_chk = _me.get_param('threshold_chk') - print _me.get_param('chk_ThresholdBehavior') self.light_measure.threshold_behavior_chk = _me.get_param('chk_ThresholdBehavior') self.light_measure.change_behavior_chk = _me.get_param('chk_ChangeBehavior') - self.light_measure.change_control() + @@ -142,7 +156,13 @@ def on_window1_destroy(self, widget, *args): _me.get_param('measure').GUI_on = False self.light_measure.GUI_on = False + + + def on_btnSet_clicked(self, widget, *args): + pass + + def on_btnApply_clicked(self, widget, *args): #Store the new radio buttons status _me.set_param('drop_rad', self.get_widget('radDrop').get_active()) @@ -154,8 +174,9 @@ _me.set_param('both_rad', self.get_widget('radBoth').get_active()) _me.set_param('threshold_chk', self.get_widget('chkThreshold').get_active()) _me.set_param('chk_ThresholdBehavior', self.get_widget('chk_ThresholdBehavior').get_active()) + _me.set_param('threshold_notified', self.get_widget('chkThresholdNotified').get_active()) + _me.set_param('change_notified', self.get_widget('chkChangeNotified').get_active()) _me.set_param('chk_ChangeBehavior', self.get_widget('chk_ChangeBehavior').get_active()) - print _me.get_param('chk_ChangeBehavior') temp_rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) temp_sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) @@ -168,7 +189,7 @@ max_time = self.light_measure.rate * self.light_measure.sample - + self.light_measure.val_drop = self.check_float_value(self.get_widget('valDrop_percent').get_text(), 1, 100) self.light_measure.val_drop_time = self.check_float_value(self.get_widget('valDrop_time').get_text(), self.light_measure.rate, max_time) self.light_measure.val_raise = self.check_float_value(self.get_widget('valRaise_percent').get_text(), 1, 100) @@ -178,22 +199,41 @@ self.light_measure.val_changeU = self.check_float_value(self.get_widget('valChangeU_percent').get_text(), 1, 100) self.light_measure.val_changeU_time = self.check_float_value(self.get_widget('valChangeU_time').get_text(), self.light_measure.rate, max_time) self.light_measure.val_threshold = self.check_float_value(self.get_widget('valThreshold').get_text(), 0, 100) - print self.light_measure.val_changeD_time - + #Update values self.update_value() def on_threshold_selection_changed(self, widget, *args): filename = widget.get_filename() + filename = filename.replace('%20', ' ') _me.set_param('behavior_file_threshold', filename) _me.get_param('measure').threshold_behavior = _me.get_param('behavior_file_threshold') def on_change_selection_changed(self, widget, *args): filename = widget.get_filename() + filename = filename.replace('%20', ' ') _me.set_param('behavior_file_change', filename) _me.get_param('measure').change_behavior = _me.get_param('behavior_file_change') + + def on_btnLight_clicked(self, widget, *args): + self.light_measure.val_table = [0] * int(self.light_measure.sample+1) + self.light_measure.light_search = True + self.light_measure.light_value = 3000 + self.config_light_search() - + def on_btnDark_clicked(self, widget, *args): + self.light_measure.val_table = [1124] * int(self.light_measure.sample+1) + self.light_measure.light_search = False + self.light_measure.light_value = 0 + self.config_light_search() + + def config_light_search(self): + self.light_measure.search_light_flag = True + self.light_measure.light_search_state = 0 + self.light_measure.tick = 2 + self.light_measure.ok_flag = False + self.light_measure.timer = 0 + tux.cmd.spinl_on_free(4, 1) ########################################################### # # Value integrity control @@ -203,14 +243,11 @@ try: value = float(value) except: - print '0' value = float(minimum) if value < float(minimum): - print '1' value = float(minimum) elif value > float(maximum): - print '2' value = float(maximum) return value Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-10-04 15:08:19 UTC (rev 580) @@ -44,5 +44,15 @@ measure.change_behavior = _me.get_param('behavior_file_change') measure.event_tab = _me.get_param('config') -tux.monitoring.insert(0x1B, measure.on_light_level) +monitor_id = tux.monitoring.insert(0x1B, measure.on_light_level) +_me.set_param('monitor_id', monitor_id) +def destroy(): + print ' Remove' + tux.monitoring.remove(_me.get_param('monitor_id')) + +_me.insert_funct('destroy', destroy) + + + + Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-04 15:08:19 UTC (rev 580) @@ -2,6 +2,8 @@ import sys import time import os +import threading +import thread sys.path.append('/opt/tuxdroid/api/python') from tux import * @@ -130,8 +132,16 @@ self.timeout = 0 self.start_flag = True self.wait = 0 + self.temp = 1124 + self.ok_flag = False + self.light_search = True + self.search_light_flag = False + self.search_dark_flag = False + self.__on_light_mutex = threading.Lock() + self.__timeout_mutex = threading.Lock() + ########################################################### # # Events control @@ -140,44 +150,59 @@ def event_control(self): if self.GUI_on == False: for i in range (len(self.event_tab)): - print 'Goto threshold control' + print 'goto threshold control' self.Threshold_control(i) - print 'Goto change control' + print 'goto change control' self.Change_control(i) #Gadget or test notifications else: - print 'Goto test functions' - self.test_func() - #disable gadget notifications - self.notify = False - - #goto test notification every sec. - if self.wait == 0: - self.wait = 10 - self.test_notification() + print 'GUI on' + if self.search_light_flag: + print 'search light' + self.search_light(self.light_search) else: - self.wait -= 1 + print 'goto test function' + self.test_func() + #disable gadget notifications + self.notify = False + #goto test notification every sec. + if self.wait == 0: + self.wait = 10 + print 'goto notifications' + self.test_notification() + else: + self.wait -= 1 + # To prevent notifications at startup if self.start_flag == True: + print 'start flag' self.change_event = False self.threshold_event = False self.start_flag = False for i in range (len(self.event_tab)): - self.event_tab[i][7] = False + self.event_tab[i][7] = False + + def change_control(self): # Determine how many point must be checked for changes events + print 'Enter change control' pts_per_sec = self.sample / (self.rate * self.sample) - self.timeout = 0 + if self.val_drop_time >= 0.1 and self.val_drop > 0: - self.val_drop_time = int(self.val_drop_time * pts_per_sec) + self.drop_point = int(self.val_drop_time * pts_per_sec) + self.set_timeout(self.drop_point) if self.val_raise_time >= 0.1 and self.val_raise > 0: - self.val_raise_time = int(self.val_raise_time * pts_per_sec) + self.raise_point = int(self.val_raise_time * pts_per_sec) + self.set_timeout(self.raise_point) if self.val_changeD_time >= 0.1 and self.val_changeD > 0: - self.val_changeD_time = int(self.val_changeD_time * pts_per_sec) + self.changeD_point = int(self.val_changeD_time * pts_per_sec) + self.set_timeout(self.changeD_point) if self.val_changeU_time >= 0.1 and self.val_changeU > 0: - self.val_changeU_time = int(self.val_changeU_time * pts_per_sec) + self.changeU_point = int(self.val_changeU_time * pts_per_sec) + self.set_timeout(self.changeU_point) + print 'exiting change control' ########################################################### @@ -187,47 +212,47 @@ ########################################################### def Threshold_control(self, index): if self.event_tab[index][1] == 1: - print 'Threshold found' if self.event_tab[index][7] != True: - print 'No event detected' if self.event_tab[index][2] == 0: - print 'Increase' + print 'increase detected' #Increasing threshold control if self.Increase_control(self.event_tab[index][3]) == True: - print 'Increase detected' self.event_tab[index][7] = True elif self.event_tab[index][2] == 1: - print 'Decrease' + print 'decrease detected' #Decreasing threshold control if self.Decrease_control(self.event_tab[index][3]) == True: - print 'Decrease detected' self.event_tab[index][7] = True elif self.event_tab[index][2] == 2: - print 'Both direction' + print 'both detected' #Both direction theshold control if self.Both_control(self.event_tab[index][3]) == True: - print 'Both detected' self.event_tab[index][7] = True - print 'Threshold control done ...' def Increase_control(self, value): + print 'enter increase control' val_act = (self.val_table[len(self.val_table)-1]*100) / 1124.0 val_prev = (self.val_table[len(self.val_table)-2]*100) / 1124.0 if val_prev <= value and val_act > value: return True + print 'leave increase control' def Decrease_control(self, val): + print 'enter decrease control' val_act = (self.val_table[len(self.val_table)-1]*100) / 1124.0 val_prev = (self.val_table[len(self.val_table)-2]*100) / 1124.0 if val_prev >= val and val_act < val: return True + print 'leave decrease control' def Both_control(self, val): + print 'enter both control' val_act = (self.val_table[int(len(self.val_table)-1)]*100) / 1124.0 val_prev = (self.val_table[int(len(self.val_table)-2)]*100) / 1124.0 if val_prev <= val and val_act > val or val_prev >= val and val_act < val: return True + print 'leave both control' ########################################################### @@ -238,76 +263,96 @@ def Change_control(self, i): #Changements control if self.event_tab[i][1] == 0: - print 'Change found' + print 'change detected' pts_per_sec = self.sample / (self.rate * self.sample) - time = float(self.event_tab[i][4] * pts_per_sec) + time = int(self.event_tab[i][4] * pts_per_sec) if self.event_tab[i][7] != True: - print 'no event detected' # Drop change part : if self.event_tab[i][2] == 0: - print 'Drop' + print 'drop detected' if self.Drop_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - print 'Drop detected' self.event_tab[i][7] = True + print 'dropped' # Raise change part if self.event_tab[i][2] == 1: - print 'Raise' + print 'raise detected' if self.Raise_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - print 'Raise detected' self.event_tab[i][7] = True + print 'raised' # Drop and Raise change if self.event_tab[i][2] == 2: - print 'Drop and raise' + print 'drop and raise detected' if self.ChangeD_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - print 'Drop and raise detected' self.event_tab[i][7] = True + print 'drop and raise event !' # Raise and Drop change if self.event_tab[i][2] == 3: - print 'Raise and drop' + print 'raise and drop detected' if self.ChangeU_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - print 'Raise and drop detected' self.event_tab[i][7] = True - print 'Change control done ...' + print 'raise and drop event !' def Drop_control(self, time, val, timeout, index): + print 'enter drop control' #timeout control : to prevent multiple notifications with the same event if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - maximum = max(self.val_table[init_val:len(self.val_table)-1]) + try: + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + except: + init_val = len(self.val_table) - 1 - int(time) + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + if maximum >= self.val_table[len(self.val_table)-1] + ((val/100)*1124): if self.GUI_on == False: self.event_tab[index][8] = int(time) else: - self.timeout = int(time) + self.set_timeout(int(time)) return True else: if self.GUI_on: - self.timeout = timeout + self.set_timeout(timeout) else: self.event_tab[index][8] = timeout + print 'leave drop control' def Raise_control(self, time, val, timeout, index): + print 'enter raise control' if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout + try: + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + except: + init_val = len(self.val_table) - 1 - int(time) + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + minimum = min(self.val_table[init_val:(len(self.val_table)-1)]) if minimum <= self.val_table[len(self.val_table)-1] - ((val/100)*1124): if self.GUI_on == False: self.event_tab[index][8] = int(time) else: - self.timeout = int(time) + self.set_timeout(int(time)) return True else: if self.GUI_on: - self.timeout = timeout + self.set_timeout(timeout) else: self.event_tab[index][8] = timeout + print 'leave raise control' def ChangeD_control(self, time, val, timeout, index): + print 'enter drop and raise control' if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout + try: + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + except: + init_val = len(self.val_table) - 1 - int(time) + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + for i in range(int(time - timeout)): if self.val_table[int(len(self.val_table)-1-i)] <= self.val_table[len(self.val_table) - 1] - ((val/100)*1124): maximum = max(self.val_table[init_val:len(self.val_table) - i]) @@ -315,18 +360,27 @@ if self.GUI_on == False: self.event_tab[index][8] = int(time) else: - self.timeout = int(time) + self.set_timeout(int(time)) return True if self.GUI_on: - self.timeout = timeout + self.set_timeout(timeout) else: self.event_tab[index][8] = timeout + print 'leave drop and raise control' return False + def ChangeU_control(self, time, val, timeout, index): + print 'enter raise and drop control' if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout + try: + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + except: + init_val = len(self.val_table) - 1 - int(time) + maximum = max(self.val_table[init_val:len(self.val_table)-1]) + for i in range(int(time - timeout)): if self.val_table[int(len(self.val_table)-1-i)] >= self.val_table[len(self.val_table) - 1] + ((val/100)*1124): minimum = min(self.val_table[init_val:len(self.val_table)-i]) @@ -334,13 +388,15 @@ if self.GUI_on == False: self.event_tab[index][8] = int(time) else: - self.timeout = int(time) + self.set_timeout(int(time)) return True if self.GUI_on: - self.timeout = timeout + self.set_timeout(timeout) else: self.event_tab[index][8] = timeout + print 'leave raise and drop control' return False + ########################################################### # @@ -349,96 +405,176 @@ ########################################################### def test_func(self): if self.threshold_event != True: - print 'Threshold event found' + print 'test threshold control' #Decrease threshold control if self.decrease: - print 'Goto decrease control' + print 'test decrease' if self.Decrease_control(self.val_threshold) == True: self.threshold_event = True - print 'done ...' + print 'test decrease event' #Increasing threshold control if self.increase: - print 'Goto Increase control' + print 'test increase' if self.Increase_control(self.val_threshold) == True: self.threshold_event = True - print 'done ...' + print 'test increase event' #Both direction theshold control if self.both: - print 'Goto Both control' + print 'test both' if self.Both_control(self.val_threshold) == True: self.threshold_event = True - print 'done ...' + print 'test both event' #Changements control if self.change_event != True: - print 'Change event found' + timeout = self.get_timeout() + print 'test change control' # Drop change part : if self.drop == True and self.val_drop_time > 0.0: - print 'Goto drop control' - if self.Drop_control(self.val_drop_time, self.val_drop, self.timeout, 0) == True: + print 'test drop detected' + if self.Drop_control(self.drop_point, self.val_drop, timeout, 0) == True: self.change_event = True - print 'done ...' + print 'test drop event' # Raise change part if self.raising == True and self.val_raise_time > 0.0: - print 'Goto raise control' - if self.Raise_control(self.val_raise_time, self.val_raise, self.timeout, 0) == True: + print 'test raise detected' + if self.Raise_control(self.raise_point, self.val_raise, timeout, 0) == True: self.change_event = True - print 'done ...' + print 'test raise event' # Drop and Raise change if self.changeD == True and self.val_changeD_time > 0.0: - print 'Goto drop and raise control' - if self.ChangeD_control(self.val_changeD_time, self.val_changeD, self.timeout, 0) == True: + print 'test drop and raise detected' + if self.ChangeD_control(self.changeD_point, self.val_changeD, timeout, 0) == True: self.change_event = True - print 'done ...' + print 'test drop and raise event' # Raise and Drop change if self.changeU == True and self.val_changeU_time > 0.0: - print 'Goto raise and drop control' - if self.ChangeU_control(self.val_changeU_time, self.val_changeU, self.timeout, 0) == True: + print 'test raise and drop detected' + if self.ChangeU_control(self.changeU_point, self.val_changeU, timeout, 0) == True: self.change_event = True - print 'Done' + print 'test raise and drop event' def test_notification(self): + print 'enter test notifications' if self.threshold_event == True: - print 'Theshold event occur' - if self.threshold_behavior_chk and os.path.isfile(self.threshold_behavior) and os.path.exists(self.threshold_behavior) : - print 'Execute behavior script' - self.threshold_event = False - tux.sys.shell_free(self.threshold_behavior) + if self.threshold_notified: + path = self.change_behavior + path = "'%s'" % path + if self.threshold_behavior_chk and os.path.isfile(self.threshold_behavior) and os.path.exists(self.threshold_behavior): + print 'threshold behavior script' + self.threshold_event = False + tux.sys.shell_free(path) + else: + print 'threshold default behavior' + self.threshold_event = False + thread.start_new_thread(self.test_default_behavior, (self.thresholdtext,)) else: - print 'execute deflaut behavior' self.threshold_event = False - tux.cmd.mouth_open() - tux.tts.speak(self.thresholdtext) - tux.cmd.mouth_close() - + elif self.change_event == True: - print 'Change event occur' - if self.change_behavior_chk and os.path.isfile(self.change_behavior) and os.path.exists(self.change_behavior): - print 'Execute behavior script' - self.change_event = False - tux.sys.shell_free(self.change_behavior) + if self.change_notified: + path = self.change_behavior + path = "'%s'" % path + if self.change_behavior_chk and os.path.isfile(self.change_behavior) and os.path.exists(self.change_behavior): + print 'change behavior script' + self.change_event = False + tux.sys.shell_free(path) + else: + print 'change default behavior' + self.change_event = False + thread.start_new_thread(self.test_default_behavior, (self.changetext,)) else: - print 'Default behavior' self.change_event = False - tux.cmd.mouth_open() - tux.tts.speak(self.changetext) - tux.cmd.mouth_close() - print 'End of test notifications' + + def test_default_behavior(self, txt): + tux.cmd.mouth_open() + tux.tts.speak(txt) + tux.cmd.mouth_close() ########################################################### # # Acquire # ########################################################### def on_light_level(self, args): - self.tick -= 1 - if self.tick == 0: - val = (args[0] * 256) + args[1] - self.val_table.append(val) - self.val_table.pop(0) - if self.GUI_on: - self.light_graph_measure.refresh() - self.tick = int(self.rate * 10) - self.event_control() + try: + self.__on_light_mutex.acquire() + self.tick -= 1 + if self.tick == 0: + val = (args[0] * 256) + args[1] + self.val_table.append(val) + self.val_table.pop(0) + if self.GUI_on: + self.light_graph_measure.refresh() + self.tick = int(self.rate * 10) + self.event_control() + self.__on_light_mutex.release() + except: + print sys.exc_info() + sys.exit() + + ########################################################### + # + # Timeout management + # + ########################################################### + def set_timeout(self, val): + self.__timeout_mutex.acquire() + self.timeout = val + self.__timeout_mutex.release() + def get_timeout(self): + self.__timeout_mutex.acquire() + val = self.timeout + self.__timeout_mutex.release() + return val + + ########################################################### + # + # Search functions + # + ########################################################### + def search_light(self, light): + detect = False + if self.light_search_state == 0 and tux.status.spin_counter() == 0: + self.light_search_state = 1 + if light == True: + self.light_value = max(self.val_table) + self.light_value -= 50 + else: + self.light_value = min(self.val_table) + self.light_value += 50 + self.timer = 10 + elif self.light_search_state == 1: + self.timer_control() + + if light: + if self.val_table[len(self.val_table)-1] >= (self.light_value): + thread.start_new_thread(tux.cmd.spinl_off, ()) + detect = True + else: + if self.val_table[len(self.val_table)-1] <= (self.light_value): + thread.start_new_thread(tux.cmd.spinl_off, ()) + detect = True + + if detect: + self.search_light_flag = False + self.light_search_state = 0 + self.threshold_event = False + self.change_event = False + self.change_control() + + + def timer_control(self): + self.timer -= 1 + if self.timer > 2: + return True + + elif self.timer == 2: + tux.cmd.spinl_on_free(1, 1) + + elif self.timer == 0: + thread.start_new_thread(tux.cmd.spinl_off, ()) + self.timer = 7 + Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-04 15:08:19 UTC (rev 580) @@ -39,10 +39,13 @@ if event[i][7]: print 'first notification step' if event[i][5]: + path = event[i][6] + path = path.replace('%20', ' ') print 'notification enable' - if os.path.isfile(event[i][6]) and os.path.exists(event[i][6]): + if os.path.isfile(path) and os.path.exists(path): print 'script found and valid' - tux.sys.shell_free(event[i][6]) + path = "'%s'" % path + tux.sys.shell_free(path) event[i][7] = False else: print 'default behavior' Modified: software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-04 15:08:19 UTC (rev 580) @@ -32,6 +32,7 @@ <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> <conf_btnModify type='str'>Modifier</conf_btnModify> <widget_lblEvent type='str'>Evènement</widget_lblEvent> + <widget_lblNotified type='str'>Notifé</widget_lblNotified> <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> @@ -46,11 +47,13 @@ <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> + <widget_lblLight type='str'>Trouver lumière</widget_lblLight> <name_to_read type='str'>Moniteur de lumière</name_to_read> <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <conf_lblDrop type='str'>Chute</conf_lblDrop> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> + <widget_lblDark type='str'>Trouver ombre</widget_lblDark> + <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <conf_lblValue type='str'>Valeur (%)</conf_lblValue> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> @@ -58,4 +61,5 @@ <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> + <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-04 15:08:19 UTC (rev 580) @@ -1,35 +1,39 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> + <change_notified type='bool'>False</change_notified> <chk_ThresholdBehavior type='bool'>False</chk_ThresholdBehavior> <increase_rad type='bool'>True</increase_rad> <chk_ChangeBehavior type='bool'>False</chk_ChangeBehavior> - <changeU_time type='int'>1</changeU_time> + <changeU_time type='float'>1.0</changeU_time> <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> <behavior_file_threshold type='str'>/home/</behavior_file_threshold> <raise type='float'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> + <threshold_notified type='bool'>False</threshold_notified> <config type='list'>[]</config> <behavior_file_change type='str'>/home/</behavior_file_change> <drop_rad type='bool'>True</drop_rad> <raise_rad type='bool'>False</raise_rad> <changeD type='float'>10.0</changeD> - <drop_time type='int'>1</drop_time> + <drop_time type='float'>1.0</drop_time> <changeU type='float'>10.0</changeU> - <raise_time type='int'>1</raise_time> + <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> - <changeD_time type='int'>1</changeD_time> + <changeD_time type='float'>1.0</changeD_time> <both_rad type='bool'>False</both_rad> </parameters> <general> <gui_state> <widget> - <visible type='bool'>False</visible> + <y type='int'>73</y> + <visible type='bool'>True</visible> + <x type='int'>10</x> </widget> <conf> <y type='int'>131</y> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-03 11:19:59 UTC (rev 579) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-04 15:08:19 UTC (rev 580) @@ -31,6 +31,7 @@ <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblEvent type='str'>Event</widget_lblEvent> + <widget_lblNotified type='str'>Notified</widget_lblNotified> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> <conf_btnAdd type='str'>Add</conf_btnAdd> @@ -46,11 +47,13 @@ <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> + <widget_lblLight type='str'>Search light</widget_lblLight> <name_to_read type='str'>Light monitor</name_to_read> <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <conf_lblDrop type='str'>Drop</conf_lblDrop> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> + <widget_lblDark type='str'>Search darkness</widget_lblDark> + <widget_lblSet type='str'>Add to config</widget_lblSet> <conf_lblValue type='str'>Value (%)</conf_lblValue> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> @@ -58,4 +61,5 @@ <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-10-03 11:21:35
|
Author: jaguarondi Date: 2007-10-03 13:19:59 +0200 (Wed, 03 Oct 2007) New Revision: 579 Modified: firmware/fuxusb/trunk/lib_board/c5131_evab.h firmware/fuxusb/trunk/lib_board/kbd_drv.c firmware/fuxusb/trunk/lib_board/kbd_drv.h firmware/fuxusb/trunk/lib_c/stdint.h firmware/fuxusb/trunk/lib_mcu/5131_drv.h firmware/fuxusb/trunk/lib_mcu/c51_drv.h firmware/fuxusb/trunk/lib_mcu/compiler.h firmware/fuxusb/trunk/lib_mcu/ext_5131.h firmware/fuxusb/trunk/lib_mcu/fa-usb/flash_api.c firmware/fuxusb/trunk/lib_mcu/fa-usb/flash_api.h firmware/fuxusb/trunk/lib_mcu/mcu.h firmware/fuxusb/trunk/lib_mcu/mcu_drv.h firmware/fuxusb/trunk/lib_mcu/reg_5131.h firmware/fuxusb/trunk/lib_mcu/spi/spi_lib.c firmware/fuxusb/trunk/lib_mcu/spi/spi_lib.h firmware/fuxusb/trunk/lib_mcu/twi/twi.h firmware/fuxusb/trunk/lib_mcu/uart/tools/c51_bdr.c firmware/fuxusb/trunk/lib_mcu/uart/uart_bdr.h firmware/fuxusb/trunk/lib_mcu/uart/uart_lib.c firmware/fuxusb/trunk/lib_mcu/uart/uart_lib.h firmware/fuxusb/trunk/lib_mcu/usb/uart_usb_lib.c firmware/fuxusb/trunk/lib_mcu/usb/uart_usb_lib.h firmware/fuxusb/trunk/lib_mcu/usb/usb_drv.c firmware/fuxusb/trunk/lib_mcu/usb/usb_drv.h firmware/fuxusb/trunk/modules/fifo/fifo.c firmware/fuxusb/trunk/modules/fifo/fifo.h firmware/fuxusb/trunk/modules/fifo/fifo_mic.c firmware/fuxusb/trunk/modules/fifo/fifo_mic.h firmware/fuxusb/trunk/modules/fifo/fifo_spk.c firmware/fuxusb/trunk/modules/fifo/fifo_spk.h firmware/fuxusb/trunk/modules/fifo_stt/fifo_stt.c firmware/fuxusb/trunk/modules/fifo_stt/fifo_stt.h firmware/fuxusb/trunk/modules/scheduler/scheduler.c firmware/fuxusb/trunk/modules/scheduler/scheduler.h firmware/fuxusb/trunk/modules/spi/spi_task.c firmware/fuxusb/trunk/modules/spi/spi_task.h firmware/fuxusb/trunk/modules/timer_soft/timer_soft.c firmware/fuxusb/trunk/modules/timer_soft/timer_soft.h firmware/fuxusb/trunk/modules/usb/usb_task.c firmware/fuxusb/trunk/modules/usb/usb_task.h firmware/fuxusb/trunk/modules/usb_enum/USB_ENUM.H firmware/fuxusb/trunk/modules/usb_enum/usb_enum.c Log: * Indentation was only performed on /, now done on subdirectories. Tabs and spaces have been cleaned. Indent command: indent $(find . -name '*.[ch]') -nut -i4 -bad -bap -bbb -sob -sc -bl -bli0 -cli0 -cbi4 -nce -ncdw -ss -bls -npsl -ncs -npcs -nprs -saf -sai -saw -nbfda -nhnl -l80 Modified: firmware/fuxusb/trunk/lib_board/c5131_evab.h =================================================================== --- firmware/fuxusb/trunk/lib_board/c5131_evab.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_board/c5131_evab.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,51 +1,48 @@ + /*H************************************************************************** -* NAME: c5131_evab.h +* NAME: c5131_evab.h *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-cdc-1_0_2 -* REVISION: 1.8 +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.8 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * Configuration file. Selection of the device. *****************************************************************************/ #ifndef _C5131_EVAB_H #define _C5131_EVAB_H /*_____ D E F I N I T I O N S ______________________________________________*/ -#define GENEB_BUZZER P1_5 // CPU I/O Port connected to GENEB Buzzer Pin or mute -#define GENEB_BP1 P3_2 // CPU I/O Port connected to GENEB BP1 +#define GENEB_BUZZER P1_5 // CPU I/O Port connected to GENEB Buzzer Pin or mute +#define GENEB_BP1 P3_2 // CPU I/O Port connected to GENEB BP1 -#define GENEB_TWI_IT P3_2 // Port I/O IT pin of CPU connected to GENEB TWI_IT Pin -#define GENEB_SDA P1_1 -#define GENEB_SCL P1_0 +#define GENEB_TWI_IT P3_2 // Port I/O IT pin of CPU connected to GENEB TWI_IT Pin +#define GENEB_SDA P1_1 +#define GENEB_SCL P1_0 -#define GENEB_A16 P3_4 // CPU I/O Port connected to GENEB A16 -#define GENEB_CS_RAM P1_2 -#define GENEB_CS_FLASH P1_3 -#define GENEB_ISP_FLASH P1_4 +#define GENEB_A16 P3_4 // CPU I/O Port connected to GENEB A16 +#define GENEB_CS_RAM P1_2 +#define GENEB_CS_FLASH P1_3 +#define GENEB_ISP_FLASH P1_4 -#define RST_ETH P1_5 -#define CS_ETH P3_5 +#define RST_ETH P1_5 +#define CS_ETH P3_5 -#define CPUb_enable_all_leds() (AUXR&=~1,P3_0=0,P3_1=0,P4_0=0,P4_1=0,P1_5=0) +#define CPUb_enable_all_leds() (AUXR&=~1,P3_0=0,P3_1=0,P4_0=0,P4_1=0,P1_5=0) #define CPUb_disable_all_leds() (AUXR|=1,P3_0=1,P3_1=1,P4_0=1,P4_1=1,P1_5=1) -#define Geneb_enable_ram() (GENEB_ISP_FLASH=1,CS_ETH=1,GENEB_CS_RAM=0) -#define Geneb_disable_ram() (GENEB_CS_RAM=1) -#define Geneb_enable_isp() (GENEB_ISP_FLASH=0,GENEB_CS_FLASH=1) -#define Geneb_disable_isp() (GENEB_ISP_FLASH=1) +#define Geneb_enable_ram() (GENEB_ISP_FLASH=1,CS_ETH=1,GENEB_CS_RAM=0) +#define Geneb_disable_ram() (GENEB_CS_RAM=1) +#define Geneb_enable_isp() (GENEB_ISP_FLASH=0,GENEB_CS_FLASH=1) +#define Geneb_disable_isp() (GENEB_ISP_FLASH=1) /*_____ I N C L U D E S ____________________________________________________*/ #ifdef GENEB_VERSION #include "lib_board/geneb.h" #endif - /*_____ M A C R O S ________________________________________________________*/ /*_____ D E C L A R A T I O N S ____________________________________________*/ -#endif /* _C5131_EVAB_H */ - - - +#endif /* _C5131_EVAB_H */ Modified: firmware/fuxusb/trunk/lib_board/kbd_drv.c =================================================================== --- firmware/fuxusb/trunk/lib_board/kbd_drv.c 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_board/kbd_drv.c 2007-10-03 11:19:59 UTC (rev 579) @@ -1,12 +1,13 @@ + /*C************************************************************************** -* NAME: kbd_drv.c +* NAME: kbd_drv.c *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-cdc-1_0_2 -* REVISION: 1.1 +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.1 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This file contains C functions to control: * SWITCHES *****************************************************************************/ @@ -18,51 +19,44 @@ /*_____ M A C R O S ________________________________________________________*/ /*_____ D E F I N I T I O N S ______________________________________________*/ -#define KBD_COL_MASK 0x0F -#define KBD_COL0 0x08 -#define KBD_COL1 0x04 -#define KBD_COL2 0x02 -#define KBD_COL3 0x01 -#define KBD_ROW_MASK 0xF0 -#define KBD_ROW0 0x10 -#define KBD_ROW1 0x20 -#define KBD_ROW2 0x40 -#define KBD_ROW3 0x80 +#define KBD_COL_MASK 0x0F +#define KBD_COL0 0x08 +#define KBD_COL1 0x04 +#define KBD_COL2 0x02 +#define KBD_COL3 0x01 +#define KBD_ROW_MASK 0xF0 +#define KBD_ROW0 0x10 +#define KBD_ROW1 0x20 +#define KBD_ROW2 0x40 +#define KBD_ROW3 0x80 -#define DEFAULT_SWITCHES_VALUE 0xFF -#define DEFAULT_SCAN_KEY_VALUE 0 +#define DEFAULT_SWITCHES_VALUE 0xFF +#define DEFAULT_SCAN_KEY_VALUE 0 + /*_____ D E C L A R A T I O N S ____________________________________________*/ - /*V************************************************************************** * NAME: scan_key *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * scan_key is a structure allowing easy byte/word access (Union16). * 16 keys on keypad in a 16-bit variable => all cases supported * Ex. for geneb: -* MSb LSb +* MSb LSb * 9 5 1 < * 6 2 > 0 7 3 V # 8 4 C *****************************************************************************/ -volatile Union16 idata scan_key; -Byte code geneb_keys[]= { 'C', '4', '8', '#', - 'V', '3', '7', '0', - '>', '2', '6', '*', - '<', '1', '5', '9' }; -void kbd_test_hit (void) +volatile Union16 idata scan_key; +Byte code geneb_keys[] = { 'C', '4', '8', '#', + 'V', '3', '7', '0', + '>', '2', '6', '*', + '<', '1', '5', '9' +}; +void kbd_test_hit(void) { - } - -bit kbd_init (void) +bit kbd_init(void) { - return 0; + return 0; } - - - - - - Modified: firmware/fuxusb/trunk/lib_board/kbd_drv.h =================================================================== --- firmware/fuxusb/trunk/lib_board/kbd_drv.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_board/kbd_drv.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,12 +1,13 @@ + /*H************************************************************************** -* NAME: kbd_drv.h +* NAME: kbd_drv.h *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-cdc-1_0_2 -* REVISION: 1.1 +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.1 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * Include file of twi_common.c file *****************************************************************************/ #ifndef _KBD_DRV_H @@ -21,29 +22,27 @@ /*F************************************************************************** * NAME: get_switches *---------------------------------------------------------------------------- -* PARAMS: none -* return: Uchar: switches value +* PARAMS: none +* return: Uchar: switches value *---------------------------------------------------------------------------- * PURPOSE: * 0=SWITCH ON, 1= SWITCH OFF, MSB =SWITCH 8, LSB = SWITCH 1 *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- -* NOTE: +* NOTE: *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ - /*_____ D E C L A R A T I O N S ____________________________________________*/ -#define ROW_PORT KBF -#define ROW_ALL ((KBF & 0xF0)>>4) +#define ROW_PORT KBF +#define ROW_ALL ((KBF & 0xF0)>>4) -#define SELECT_COLUMN 0 /*the active level is 0*/ -#define FREE_COLUMN 1 +#define SELECT_COLUMN 0 /*the active level is 0 */ +#define FREE_COLUMN 1 /*FUNCTION PROTOTYPES*/ -#endif /* _KBD_DRV_H */ - +#endif /* _KBD_DRV_H */ Modified: firmware/fuxusb/trunk/lib_c/stdint.h =================================================================== --- firmware/fuxusb/trunk/lib_c/stdint.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_c/stdint.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,5 +1,6 @@ + /* - * ISO/IEC 9899:1999 7.18 Integer types <stdint.h> + * ISO/IEC 9899:1999 7.18 Integer types <stdint.h> */ #ifndef __STDINT_H_ @@ -11,7 +12,7 @@ Use [u]intN_t if you need exactly N bits. Since these typedefs are mandated by the C99 standard, they are preferred - over rolling your own typedefs. */ + over rolling your own typedefs. */ /* Integer types */ @@ -87,17 +88,17 @@ /** \ingroup avr_stdint signed int with at least 8 bits. */ -typedef int8_t int_least8_t; +typedef int8_t int_least8_t; /** \ingroup avr_stdint unsigned int with at least 8 bits. */ -typedef uint8_t uint_least8_t; +typedef uint8_t uint_least8_t; /** \ingroup avr_stdint signed int with at least 16 bits. */ -typedef int16_t int_least16_t; +typedef int16_t int_least16_t; /** \ingroup avr_stdint unsigned int with at least 16 bits. */ @@ -107,7 +108,7 @@ /** \ingroup avr_stdint signed int with at least 32 bits. */ -typedef int32_t int_least32_t; +typedef int32_t int_least32_t; /** \ingroup avr_stdint unsigned int with at least 32 bits. */ @@ -117,7 +118,7 @@ /** \ingroup avr_stdint signed int with at least 64 bits. */ -// typedef int64_t int_least64_t; +// typedef int64_t int_least64_t; /** \ingroup avr_stdint unsigned int with at least 64 bits. */ @@ -126,7 +127,6 @@ /*@}*/ - /** \name Fastest minimum-width integer types Integer types being usually fastest having at least the specified width */ @@ -174,7 +174,6 @@ /*@}*/ - /** \name Greatest-width integer types Types designating integer data capable of representing any value of any integer type in the corresponding signed or unsigned category */ @@ -270,6 +269,7 @@ /*@}*/ /** \name Limits of minimum-width integer types */ + /*@{*/ /** \ingroup avr_stdint @@ -458,8 +458,8 @@ #define PTRDIFF_MIN INT16_MIN +/* Limits of sig_atomic_t */ -/* Limits of sig_atomic_t */ /* signal.h is currently not implemented (not avr/signal.h) */ /** \ingroup avr_stdint @@ -472,25 +472,27 @@ #define SIG_ATOMIC_MIN INT8_MIN - /** \ingroup avr_stdint largest value a size_t can hold. */ #define SIZE_MAX (__CONCAT(INT16_MAX, U)) +/* Limits of wchar_t */ -/* Limits of wchar_t */ /* wchar.h is currently not implemented */ + /* #define WCHAR_MAX */ + /* #define WCHAR_MIN */ +/* Limits of wint_t */ -/* Limits of wint_t */ /* wchar.h is currently not implemented */ + /* #define WINT_MAX */ + /* #define WINT_MIN */ - #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) @@ -556,5 +558,4 @@ #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ - #endif /* _STDINT_H_ */ Modified: firmware/fuxusb/trunk/lib_mcu/5131_drv.h =================================================================== --- firmware/fuxusb/trunk/lib_mcu/5131_drv.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_mcu/5131_drv.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,10 +1,11 @@ + /*H************************************************************************** -* NAME: 5131_drv.h +* NAME: 5131_drv.h *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-cdc-1_0_2 -* REVISION: 1.7 +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.7 *---------------------------------------------------------------------------- * PURPOSE: * This file contains the C51 driver definition @@ -13,236 +14,230 @@ #ifndef _5131_DRV_H_ #define _5131_DRV_H_ -/*_____ I N C L U D E S ____________________________________________________*/ +/* INCLUDES */ +/* MACROS */ -/*_____ M A C R O S ________________________________________________________*/ +/* DEFINITION */ - -/*_____ D E F I N I T I O N ________________________________________________*/ /* SYSTEM MANAGEMENT */ -#define MSK_SMOD1 0x80 /* PCON */ -#define MSK_SMOD0 0x40 -#define MSK_GF1 0x08 -#define MSK_GF0 0x04 -#define MSK_PD 0x02 -#define MSK_IDL 0x01 +#define MSK_SMOD1 0x80 /* PCON */ +#define MSK_SMOD0 0x40 +#define MSK_GF1 0x08 +#define MSK_GF0 0x04 +#define MSK_PD 0x02 +#define MSK_IDL 0x01 -#define MSK_EXT16 0x40 /* AUXR */ -#define MSK_M0 0x20 -#define MSK_DPHDIS 0x10 -#define MSK_XRS 0x0C -#define MSK_EXTRAM 0x02 -#define MSK_AO 0x01 -#define ERAM_256 0x00 -#define ERAM_512 0x04 -#define ERAM_1024 0x08 -#define ERAM_2048 0x0C +#define MSK_EXT16 0x40 /* AUXR */ +#define MSK_M0 0x20 +#define MSK_DPHDIS 0x10 +#define MSK_XRS 0x0C +#define MSK_EXTRAM 0x02 +#define MSK_AO 0x01 +#define ERAM_256 0x00 +#define ERAM_512 0x04 +#define ERAM_1024 0x08 +#define ERAM_2048 0x0C - /* PLL & CLOCK */ -#define MSK_X2 0x01 /* CKCON */ -#define MSK_T0X2 0x02 -#define MSK_T1X2 0x04 -#define MSK_WDX2 0x40 +#define MSK_X2 0x01 /* CKCON */ +#define MSK_T0X2 0x02 +#define MSK_T1X2 0x04 +#define MSK_WDX2 0x40 - /* TIMERS */ -#define MSK_GATE1 0x80 /* TMOD */ -#define MSK_C_T1 0x40 -#define MSK_MO1 0x30 -#define MSK_GATE0 0x08 -#define MSK_C_T0 0x04 -#define MSK_MO0 0x03 +#define MSK_GATE1 0x80 /* TMOD */ +#define MSK_C_T1 0x40 +#define MSK_MO1 0x30 +#define MSK_GATE0 0x08 +#define MSK_C_T0 0x04 +#define MSK_MO0 0x03 - /* WATCHDOG */ -#define MSK_WTO 0x07 /* WDTPRG*/ +#define MSK_WTO 0x07 /* WDTPRG */ -/*_____ D E C L A R A T I O N ______________________________________________*/ +/* DECLARATION */ -#define Set_x2_mode() (CKCON0 |= MSK_X2) -#define Set_x1_mode() (CKCON0 &= ~MSK_X2) -#define Mode_x2() ((CKCON0 & MSK_X2) == MSK_X2) +#define Set_x2_mode() (CKCON0 |= MSK_X2) +#define Set_x1_mode() (CKCON0 &= ~MSK_X2) +#define Mode_x2() ((CKCON0 & MSK_X2) == MSK_X2) -#define Set_timer0_x1_mode() (CKCON0 |= MSK_T0X2) -#define Set_timer0_x2_mode() (CKCON0 &=~MSK_T0X2) -#define Set_timer1_x1_mode() (CKCON0 |= MSK_T1X2) -#define Set_timer1_x2_mode() (CKCON0 &=~MSK_T1X2) -#define Set_timer2_x1_mode() (CKCON0 |= MSK_T2X2) -#define Set_timer2_x2_mode() (CKCON0 &=~MSK_T2X2) -#define Set_uart_x1_mode() (CKCON0 |= MSK_UARTX2) -#define Set_uart_x2_mode() (CKCON0 &=~MSK_UARTX2) -#define Set_pca_x1_mode() (CKCON0 |= MSK_PCAX2) -#define Set_pca_x2_mode() (CKCON0 &=~MSK_PCAX2) +#define Set_timer0_x1_mode() (CKCON0 |= MSK_T0X2) +#define Set_timer0_x2_mode() (CKCON0 &=~MSK_T0X2) +#define Set_timer1_x1_mode() (CKCON0 |= MSK_T1X2) +#define Set_timer1_x2_mode() (CKCON0 &=~MSK_T1X2) +#define Set_timer2_x1_mode() (CKCON0 |= MSK_T2X2) +#define Set_timer2_x2_mode() (CKCON0 &=~MSK_T2X2) +#define Set_uart_x1_mode() (CKCON0 |= MSK_UARTX2) +#define Set_uart_x2_mode() (CKCON0 &=~MSK_UARTX2) +#define Set_pca_x1_mode() (CKCON0 |= MSK_PCAX2) +#define Set_pca_x2_mode() (CKCON0 &=~MSK_PCAX2) -#define Set_spi_x1_mode() (CKCON1 |= MSK_SPIX2) -#define Set_spi_x2_mode() (CKCON1 &=~MSK_SPIX2) +#define Set_spi_x1_mode() (CKCON1 |= MSK_SPIX2) +#define Set_spi_x2_mode() (CKCON1 &=~MSK_SPIX2) -#define Set_idle_mode() (PCON |= MSK_IDLE) -#define Set_power_down_mode() (PCON |= MSK_PD) +#define Set_idle_mode() (PCON |= MSK_IDLE) +#define Set_power_down_mode() (PCON |= MSK_PD) -#define Enable_eram() (AUXR &= ~MSK_EXTRAM) -#define Disable_eram() (AUXR |= MSK_EXTRAM) -#define Set_eram_size(s) ((AUXR &= ~MSK_XRS),(AUXR |= s)) +#define Enable_eram() (AUXR &= ~MSK_EXTRAM) +#define Disable_eram() (AUXR |= MSK_EXTRAM) +#define Set_eram_size(s) ((AUXR &= ~MSK_XRS),(AUXR |= s)) -#define Enable_interrupt() (EA = 1) -#define Disable_interrupt() (EA = 0) +#define Enable_interrupt() (EA = 1) +#define Disable_interrupt() (EA = 0) -#define Enable_twi_interrupt() (IEN1 |= 0x02) +#define Enable_twi_interrupt() (IEN1 |= 0x02) #define Disable_twi_interrupt() (IEN1 &= 0xFD) -#define Enable_spi_interrupt() (IEN1 |= 0x04) +#define Enable_spi_interrupt() (IEN1 |= 0x04) #define Disable_spi_interrupt() (IEN1 &= ~0x04) -#define Disable_ale() (AUXR |= MSK_AO) -#define Enable_ale() (AUXR &= ~MSK_AO) -#define Switch_ale() (AUXR ^= MSK_AO) +#define Disable_ale() (AUXR |= MSK_AO) +#define Enable_ale() (AUXR &= ~MSK_AO) +#define Switch_ale() (AUXR ^= MSK_AO) -#define STANDARD_PORT 0 -#define LED_PORT_2MA 1 -#define LED_PORT_4MA 2 -#define LED_PORT_10MA 3 +#define STANDARD_PORT 0 +#define LED_PORT_2MA 1 +#define LED_PORT_4MA 2 +#define LED_PORT_10MA 3 #define Configure_led(num,type) {LEDCON &= (0xFF & ~(0x03 << (num*2))); \ LEDCON |= (type << (num*2));} -#define Led_0_on() (P3_3 = 0) -#define Led_0_off() (P3_3 = 1) -#define Led_0_toggle() (P3_3 = ~P3_3) -#define Led_0_status() (P3_3) -#define Led_0_write(x) (P3_3 = x) -#define Led_1_on() (P3_5 = 0) -#define Led_1_off() (P3_5 = 1) -#define Led_1_toggle() (P3_5 = ~P3_5) -#define Led_1_status() (P3_5) -#define Led_1_write(x) (P3_5 = x) -#define Led_2_on() (P3_6 = 0) -#define Led_2_off() (P3_6 = 1) -#define Led_2_toggle() (P3_6 = ~P3_6) -#define Led_2_status() (P3_6) -#define Led_2_write(x) (P3_6 = x) -#define Led_3_on() (P3_7 = 0) -#define Led_3_off() (P3_7 = 1) -#define Led_3_toggle() (P3_7 = ~P3_7) -#define Led_3_status() (P3_7) -#define Led_3_write(x) (P3_7 = x) +#define Led_0_on() (P3_3 = 0) +#define Led_0_off() (P3_3 = 1) +#define Led_0_toggle() (P3_3 = ~P3_3) +#define Led_0_status() (P3_3) +#define Led_0_write(x) (P3_3 = x) +#define Led_1_on() (P3_5 = 0) +#define Led_1_off() (P3_5 = 1) +#define Led_1_toggle() (P3_5 = ~P3_5) +#define Led_1_status() (P3_5) +#define Led_1_write(x) (P3_5 = x) +#define Led_2_on() (P3_6 = 0) +#define Led_2_off() (P3_6 = 1) +#define Led_2_toggle() (P3_6 = ~P3_6) +#define Led_2_status() (P3_6) +#define Led_2_write(x) (P3_6 = x) +#define Led_3_on() (P3_7 = 0) +#define Led_3_off() (P3_7 = 1) +#define Led_3_toggle() (P3_7 = ~P3_7) +#define Led_3_status() (P3_7) +#define Led_3_write(x) (P3_7 = x) +#define Led_all_on() (P3 &= 0x17) +#define Led_all_off() (P3 |= ~0x17) -#define Led_all_on() (P3 &= 0x17) -#define Led_all_off() (P3 |= ~0x17) - /*C************************************************************************** * NAME: PLL_3MHz *---------------------------------------------------------------------------- * PURPOSE: -* PLLDIV value for an oscillator frequency of 3MHz +* PLLDIV value for an oscillator frequency of 3MHz *****************************************************************************/ -#define PLL_3MHz 0xF0 +#define PLL_3MHz 0xF0 /*C************************************************************************** * NAME: PLL_4MHz *---------------------------------------------------------------------------- * PURPOSE: -* PLLDIV value for an oscillator frequency of 4MHz +* PLLDIV value for an oscillator frequency of 4MHz *****************************************************************************/ -#define PLL_4MHz 0xC0 +#define PLL_4MHz 0xC0 /*C************************************************************************** * NAME: PLL_6MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 6MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 6MHz *****************************************************************************/ -#define PLL_6MHz 0x70 +#define PLL_6MHz 0x70 /*C************************************************************************** * NAME: PLL_8MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 8MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 8MHz *****************************************************************************/ -#define PLL_8MHz 0x50 +#define PLL_8MHz 0x50 /*C************************************************************************** * NAME: PLL_12MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 12MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 12MHz *****************************************************************************/ -#define PLL_12MHz 0x30 +#define PLL_12MHz 0x30 /*C************************************************************************** * NAME: PLL_16MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 16MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 16MHz *****************************************************************************/ -#define PLL_16MHz 0x20 +#define PLL_16MHz 0x20 /*C************************************************************************** * NAME: PLL_18MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 18MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 18MHz *****************************************************************************/ -#define PLL_18MHz 0x72 +#define PLL_18MHz 0x72 /*C************************************************************************** * NAME: PLL_20MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 20MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 20MHz *****************************************************************************/ -#define PLL_20MHz 0xB4 +#define PLL_20MHz 0xB4 /*C************************************************************************** * NAME: PLL_24MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 24MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 24MHz *****************************************************************************/ -#define PLL_24MHz 0x10 +#define PLL_24MHz 0x10 /*C************************************************************************** * NAME: PLL_32MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 32MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 32MHz *****************************************************************************/ -#define PLL_32MHz 0x21 +#define PLL_32MHz 0x21 /*C************************************************************************** * NAME: PLL_40MHz *---------------------------------------------------------------------------- -* PURPOSE: -* PLLDIV value for an oscillator frequency of 40MHz +* PURPOSE: +* PLLDIV value for an oscillator frequency of 40MHz *****************************************************************************/ -#define PLL_40MHz 0xB9 +#define PLL_40MHz 0xB9 /* UART */ -#define MSK_UART_MODE0 0x00 /* SCON */ -#define MSK_UART_8BIT 0x40 -#define MSK_UART_MODE1 0x40 -#define MSK_UART_MODE2 0x80 -#define MSK_UART_MODE3 0xC0 -#define MSK_UART_9BIT 0xC0 -#define MSK_UART_MULTIPROC 0x20 -#define MSK_UART_ENABLE_RX 0x10 -#define MSK_UART_TX_BIT9 0x08 -#define MSK_UART_RX_BIT9 0x04 -#define MSK_UART_TX_READY 0x02 -#define MSK_UART_RX_DONE 0x01 +#define MSK_UART_MODE0 0x00 /* SCON */ +#define MSK_UART_8BIT 0x40 +#define MSK_UART_MODE1 0x40 +#define MSK_UART_MODE2 0x80 +#define MSK_UART_MODE3 0xC0 +#define MSK_UART_9BIT 0xC0 +#define MSK_UART_MULTIPROC 0x20 +#define MSK_UART_ENABLE_RX 0x10 +#define MSK_UART_TX_BIT9 0x08 +#define MSK_UART_RX_BIT9 0x04 +#define MSK_UART_TX_READY 0x02 +#define MSK_UART_RX_DONE 0x01 -#define Uart_hw_init(config) (SCON=(config)) +#define Uart_hw_init(config) (SCON=(config)) //#define Uart_set_baudrate(bdr) defined in /lib_mcu/uart/uart_bdr.h -#define Uart_enable() (SCON|=MSK_UART_ENABLE_RX|MSK_UART_TX_READY) -#define Uart_tx_ready() ((const bit)TI) -#define Uart_set_tx_busy() (TI=0) -#define Uart_send_byte(ch) (SBUF=ch) -#define Uart_rx_ready() ((const bit)RI) -#define Uart_get_byte() ((const char)SBUF) -#define Uart_ack_rx_byte() (RI=0) +#define Uart_enable() (SCON|=MSK_UART_ENABLE_RX|MSK_UART_TX_READY) +#define Uart_tx_ready() ((const bit)TI) +#define Uart_set_tx_busy() (TI=0) +#define Uart_send_byte(ch) (SBUF=ch) +#define Uart_rx_ready() ((const bit)RI) +#define Uart_get_byte() ((const char)SBUF) +#define Uart_ack_rx_byte() (RI=0) -#endif /* _5131_DRV_H_ */ - +#endif /* _5131_DRV_H_ */ Modified: firmware/fuxusb/trunk/lib_mcu/c51_drv.h =================================================================== --- firmware/fuxusb/trunk/lib_mcu/c51_drv.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_mcu/c51_drv.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,10 +1,11 @@ + /*H************************************************************************** -* NAME: c51_drv.h +* NAME: c51_drv.h *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-cdc-1_0_2 -* REVISION: 1.1 +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.1 *---------------------------------------------------------------------------- * PURPOSE: * This file contains the C51 driver definition @@ -15,29 +16,24 @@ /*_____ I N C L U D E S ____________________________________________________*/ - /*_____ M A C R O S ________________________________________________________*/ - /*_____ D E F I N I T I O N ________________________________________________*/ - /*_____ D E C L A R A T I O N ______________________________________________*/ -#define Set_x2_mode() (CKCON |= MSK_X2) -#define Set_x1_mode() (CKCON &= ~MSK_X2) -#define Mode_x2() ((CKCON & MSK_X2) == MSK_X2) +#define Set_x2_mode() (CKCON |= MSK_X2) +#define Set_x1_mode() (CKCON &= ~MSK_X2) +#define Mode_x2() ((CKCON & MSK_X2) == MSK_X2) -#define Set_idle_mode() (PCON |= MSK_IDLE) -#define Set_power_down_mode() (PCON |= MSK_PD) +#define Set_idle_mode() (PCON |= MSK_IDLE) +#define Set_power_down_mode() (PCON |= MSK_PD) -#define Enable_eram() (AUXR &= ~MSK_EXTRAM) -#define Disable_eram() (AUXR |= MSK_EXTRAM) -#define Set_eram_size(s) (AUXR &= ~MSK_XRS); (AUXR |= s) +#define Enable_eram() (AUXR &= ~MSK_EXTRAM) +#define Disable_eram() (AUXR |= MSK_EXTRAM) +#define Set_eram_size(s) (AUXR &= ~MSK_XRS); (AUXR |= s) -#define Enable_interrupt() (EA = 1) -#define Disable_interrupt() (EA = 0) +#define Enable_interrupt() (EA = 1) +#define Disable_interrupt() (EA = 0) - -#endif /* _C51_DRV_H_ */ - +#endif /* _C51_DRV_H_ */ Modified: firmware/fuxusb/trunk/lib_mcu/compiler.h =================================================================== --- firmware/fuxusb/trunk/lib_mcu/compiler.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_mcu/compiler.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,10 +1,11 @@ + /*H************************************************************************** -* NAME: compiler.h +* NAME: compiler.h *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-cdc-1_0_2 -* FILE_REV: 1.2 +* RELEASE: c5131-usb-cdc-1_0_2 +* FILE_REV: 1.2 *---------------------------------------------------------------------------- * PURPOSE: * This file redefines dedicated KEIL, RAISONANCE and TASKINKG C51/C251 @@ -17,61 +18,60 @@ /*_____ I N C L U D E S ____________________________________________________*/ - /*_____ D E C L A R A T I O N S ____________________________________________*/ -typedef unsigned char Uchar; -typedef float Float16; +typedef unsigned char Uchar; +typedef float Float16; -typedef unsigned char Uint8; -typedef unsigned int Uint16; -typedef unsigned long int Uint32; +typedef unsigned char Uint8; +typedef unsigned int Uint16; +typedef unsigned long int Uint32; -typedef char Int8; -typedef int Int16; -typedef long int Int32; +typedef char Int8; +typedef int Int16; +typedef long int Int32; -typedef unsigned char Bool; -typedef unsigned char Byte; -typedef unsigned int Word; -typedef unsigned long int DWord; +typedef unsigned char Bool; +typedef unsigned char Byte; +typedef unsigned int Word; +typedef unsigned long int DWord; -typedef union +typedef union { - Uint32 l; - Uint16 w[2]; - Uint8 b[4]; + Uint32 l; + Uint16 w[2]; + Uint8 b[4]; } Union32; -typedef union +typedef union { - Uint16 w; - Uint8 b[2]; + Uint16 w; + Uint8 b[2]; } Union16; - /*_____ M A C R O S ________________________________________________________*/ /* General purpose defines */ -#define _ConstType_ code +#define _ConstType_ code + /* Constants */ -#define FALSE 0 -#define TRUE 1 -#define KO 0 -#define OK 1 -#define OFF 0 -#define ON 1 -#define CLR 0 -#define SET 1 +#define FALSE 0 +#define TRUE 1 +#define KO 0 +#define OK 1 +#define OFF 0 +#define ON 1 +#define CLR 0 +#define SET 1 /* Bit and bytes manipulations */ -#define LOW(U16) ((Uchar)U16) -#define HIGH(U16) ((Uchar)(U16>>8)) -#define TST_BIT_X(addrx,mask) (*addrx & mask) -#define SET_BIT_X(addrx,mask) (*addrx = (*addrx | mask)) -#define CLR_BIT_X(addrx,mask) (*addrx = (*addrx & ~mask)) -#define OUT_X(addrx,value) (*addrx = value) -#define IN_X(addrx) (*addrx) +#define LOW(U16) ((Uchar)U16) +#define HIGH(U16) ((Uchar)(U16>>8)) +#define TST_BIT_X(addrx,mask) (*addrx & mask) +#define SET_BIT_X(addrx,mask) (*addrx = (*addrx | mask)) +#define CLR_BIT_X(addrx,mask) (*addrx = (*addrx & ~mask)) +#define OUT_X(addrx,value) (*addrx = value) +#define IN_X(addrx) (*addrx) /* little endian conversion */ #define LE16(b) (((b & 0xFF) << 8) | ((b & 0xFF00) >> 8)) @@ -79,67 +79,63 @@ ((b & 0xFF0000) >> 8) | ((b & 0xFF000000) >> 24)) /*********************************************************** - SET_SFR_BIT macro - parameters - sfr_reg : defined value in include file for sfr register + SET_SFR_BIT macro + parameters + sfr_reg : defined value in include file for sfr register bit_pos : defined value B_XX in include file for particular - bit of sfr register - bit_val : CLR / SET + bit of sfr register + bit_val : CLR / SET ************************************************************/ #define SET_SFR_BIT(sfr_reg, bit_pos, bit_val) { sfr_reg &= ~(1<<(bit_pos)); sfr_reg |= ((bit_val)<<(bit_pos));} /*********************************************************** - TST_SFR_BIT macro - parameters - sfr_reg : defined value in include file for sfr register + TST_SFR_BIT macro + parameters + sfr_reg : defined value in include file for sfr register bit_pos : defined value B_XX in include file for particular - bit of sfr register + bit of sfr register ************************************************************/ #define TST_SFR_BIT(sfr_reg, bit_pos) ((sfr_reg & (1<<(bit_pos)))>>(bit_pos)) -#ifdef KEIL /* KEIL compiler */ +#ifdef KEIL /* KEIL compiler */ -#define Reentrant(x) x reentrant -#define Sfr(x,y) sfr x = y -#define Sfr16(x,y) sfr16 x = y -#define Sbit(x,y,z) sbit x = y ^ z -#define Interrupt(x,y) x interrupt y -#define At(x) _at_ x +#define Reentrant(x) x reentrant +#define Sfr(x,y) sfr x = y +#define Sfr16(x,y) sfr16 x = y +#define Sbit(x,y,z) sbit x = y ^ z +#define Interrupt(x,y) x interrupt y +#define At(x) _at_ x -#ifdef __C51__ /* C51 Compiler */ -#define far xdata /* far is for C251 only */ +#ifdef __C51__ /* C51 Compiler */ +#define far xdata /* far is for C251 only */ #endif -#endif /* End of KEIL */ +#endif /* End of KEIL */ +#ifdef RAISONANCE /* RAISONANCE compiler */ -#ifdef RAISONANCE /* RAISONANCE compiler */ +#define Reentrant(x) x reentrant +#define Sfr(x,y) sfr x = y +#define Sbit(x,y,z) sbit x = y ^ z +#define Interrupt(x,y) x interrupt y +#define At(x) _at_ x -#define Reentrant(x) x reentrant -#define Sfr(x,y) sfr x = y -#define Sbit(x,y,z) sbit x = y ^ z -#define Interrupt(x,y) x interrupt y -#define At(x) _at_ x - -#ifdef __C51__ /* C51 Compiler */ -#define far xdata /* far is for 251 only */ +#ifdef __C51__ /* C51 Compiler */ +#define far xdata /* far is for 251 only */ #endif -#endif /* End of RAISONANCE */ +#endif /* End of RAISONANCE */ +#ifdef TASKING /* TASKING compiler */ -#ifdef TASKING /* TASKING compiler */ +#include <keil.h> /* Include Tasking / Keil compatibility header file */ -#include <keil.h> /* Include Tasking / Keil compatibility header file */ +#define far _far +#define Reentrant(x) _reentrant x +#define Sfr(x,y) _sfrbyte x _at(y) +#define Sbit(x,y,z) _sfrbit x _atbit(y,z) +#define Interrupt(x,y) _interrupt(y) x -#define far _far -#define Reentrant(x) _reentrant x -#define Sfr(x,y) _sfrbyte x _at(y) -#define Sbit(x,y,z) _sfrbit x _atbit(y,z) -#define Interrupt(x,y) _interrupt(y) x +#endif /* End of TASKING */ -#endif /* End of TASKING */ - - #endif /* _COMPILER_H_ */ - Modified: firmware/fuxusb/trunk/lib_mcu/ext_5131.h =================================================================== --- firmware/fuxusb/trunk/lib_mcu/ext_5131.h 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_mcu/ext_5131.h 2007-10-03 11:19:59 UTC (rev 579) @@ -1,12 +1,13 @@ + /*H*************************************************************************** -* NAME: ext_5131.h +* NAME: ext_5131.h *----------------------------------------------------------------------------- -* $AUTHOR: $ -* $REVISION: 1.0 $ -* $DATE: $ +* $AUTHOR: $ +* $REVISION: 1.0 $ +* $DATE: $ *----------------------------------------------------------------------------- -* PURPOSE: This file is an extension to the reg_5131.h file. -* It defines mask for registers. +* PURPOSE: This file is an extension to the reg_5131.h file. +* It defines mask for registers. *----------------------------------------------------------------------------- * CHANGES: * @@ -17,185 +18,176 @@ /*_____ I N C L U D E S ____________________________________________________*/ - /*_____ M A C R O S ________________________________________________________*/ /* INTERRUPT NUMBER */ -#define IRQ_INT0 0 -#define IRQ_T0 1 -#define IRQ_INT1 2 -#define IRQ_T1 3 -#define IRQ_UART 4 -#define IRQ_T2 5 -#define IRQ_PCA 6 -#define IRQ_KBD 7 -#define IRQ_TWI 8 -#define IRQ_SPI 9 -#define IRQ_USB 13 +#define IRQ_INT0 0 +#define IRQ_T0 1 +#define IRQ_INT1 2 +#define IRQ_T1 3 +#define IRQ_UART 4 +#define IRQ_T2 5 +#define IRQ_PCA 6 +#define IRQ_KBD 7 +#define IRQ_TWI 8 +#define IRQ_SPI 9 +#define IRQ_USB 13 /* USB */ -#define MSK_TXCMPL 0x01 /* UEPSTAX */ -#define MSK_RXOUTB0 0x02 -#define MSK_RXOUT 0x02 -#define MSK_RXSETUP 0x04 -#define MSK_STALLED 0x08 -#define MSK_TXRDY 0x10 -#define MSK_STALLRQ 0x20 -#define MSK_RXOUTB1 0x40 -#define MSK_DIR 0x80 +#define MSK_TXCMPL 0x01 /* UEPSTAX */ +#define MSK_RXOUTB0 0x02 +#define MSK_RXOUT 0x02 +#define MSK_RXSETUP 0x04 +#define MSK_STALLED 0x08 +#define MSK_TXRDY 0x10 +#define MSK_STALLRQ 0x20 +#define MSK_RXOUTB1 0x40 +#define MSK_DIR 0x80 #define MSK_RXOUTB0B1 0x42 -#define MSK_EP_DIR 0x7F +#define MSK_EP_DIR 0x7F -#define MSK_SPINT 0x01 /* USBINT */ -#define MSK_SOFINT 0x08 -#define MSK_EORINT 0x10 -#define MSK_WUPCPU 0x20 +#define MSK_SPINT 0x01 /* USBINT */ +#define MSK_SOFINT 0x08 +#define MSK_EORINT 0x10 +#define MSK_WUPCPU 0x20 -#define MSK_ESPINT 0x01 /* USBIEN */ -#define MSK_ESOFINT 0x08 -#define MSK_EEORINT 0x10 -#define MSK_EWUPCPU 0x20 +#define MSK_ESPINT 0x01 /* USBIEN */ +#define MSK_ESOFINT 0x08 +#define MSK_EEORINT 0x10 +#define MSK_EWUPCPU 0x20 -#define MSK_USBE 0x80 /* USBCON */ -#define MSK_SUSPCLK 0x40 -#define MSK_SDRMWUP 0x20 -#define MSK_DETACH 0x10 -#define MSK_UPRSM 0x08 -#define MSK_RMWUPE 0x04 -#define MSK_CONFG 0x02 -#define MSK_FADDEN 0x01 +#define MSK_USBE 0x80 /* USBCON */ +#define MSK_SUSPCLK 0x40 +#define MSK_SDRMWUP 0x20 +#define MSK_DETACH 0x10 +#define MSK_UPRSM 0x08 +#define MSK_RMWUPE 0x04 +#define MSK_CONFG 0x02 +#define MSK_FADDEN 0x01 -#define MSK_FEN 0x80 /* USBADDR */ +#define MSK_FEN 0x80 /* USBADDR */ -#define MSK_EPEN 0x80 /* UEPCONX */ -#define MSK_DTGL 0x08 -#define MSK_EPDIR 0x04 -#define MSK_EPTYPE1 0x02 -#define MSK_EPTYPE0 0x01 +#define MSK_EPEN 0x80 /* UEPCONX */ +#define MSK_DTGL 0x08 +#define MSK_EPDIR 0x04 +#define MSK_EPTYPE1 0x02 +#define MSK_EPTYPE0 0x01 -#define MSK_EP6RST 0x40 /* UEPRST */ -#define MSK_EP5RST 0x20 -#define MSK_EP4RST 0x10 -#define MSK_EP3RST 0x08 -#define MSK_EP2RST 0x04 -#define MSK_EP1RST 0x02 -#define MSK_EP0RST 0x01 +#define MSK_EP6RST 0x40 /* UEPRST */ +#define MSK_EP5RST 0x20 +#define MSK_EP4RST 0x10 +#define MSK_EP3RST 0x08 +#define MSK_EP2RST 0x04 +#define MSK_EP1RST 0x02 +#define MSK_EP0RST 0x01 -#define MSK_EP6INTE 0x40 /* UEPIEN */ -#define MSK_EP5INTE 0x20 -#define MSK_EP4INTE 0x10 -#define MSK_EP3INTE 0x08 -#define MSK_EP2INTE 0x04 -#define MSK_EP1INTE 0x02 -#define MSK_EP0INTE 0x01 +#define MSK_EP6INTE 0x40 /* UEPIEN */ +#define MSK_EP5INTE 0x20 +#define MSK_EP4INTE 0x10 +#define MSK_EP3INTE 0x08 +#define MSK_EP2INTE 0x04 +#define MSK_EP1INTE 0x02 +#define MSK_EP0INTE 0x01 -#define MSK_CRCOK 0x20 /* UFNUMH */ -#define MSK_CRCERR 0x10 +#define MSK_CRCOK 0x20 /* UFNUMH */ +#define MSK_CRCERR 0x10 /* SYSTEM MANAGEMENT */ -#define MSK_SMOD1 0x80 /* PCON */ -#define MSK_SMOD0 0x40 -#define MSK_POF 0x10 -#define MSK_GF1 0x08 -#define MSK_GF0 0x04 -#define MSK_PD 0x02 -#define MSK_IDLE 0x01 +#define MSK_SMOD1 0x80 /* PCON */ +#define MSK_SMOD0 0x40 +#define MSK_POF 0x10 +#define MSK_GF1 0x08 +#define MSK_GF0 0x04 +#define MSK_PD 0x02 +#define MSK_IDLE 0x01 -#define MSK_DPU 0x80 /* AUXR0 */ -#define MSK_M0 0x20 -#define MSK_DPHDIS 0x10 -#define MSK_XRS 0x0C -#define MSK_EXTRAM 0x02 -#define MSK_AO 0x01 +#define MSK_DPU 0x80 /* AUXR0 */ +#define MSK_M0 0x20 +#define MSK_DPHDIS 0x10 +#define MSK_XRS 0x0C +#define MSK_EXTRAM 0x02 +#define MSK_AO 0x01 -#define MSK_ENBOOT 0x20 /* AUXR1 */ -#define MSK_GF3 0x08 -#define MSK_DPS 0x01 +#define MSK_ENBOOT 0x20 /* AUXR1 */ +#define MSK_GF3 0x08 +#define MSK_DPS 0x01 - /* PLL & CLOCK */ -#define MSK_TWIX2 0x80 /* CKCON0 */ -#define MSK_WDX2 0x40 -#define MSK_PCAX2 0x20 -#define MSK_SIX2 0x10 -#define MSK_T2X2 0x08 -#define MSK_T1X2 0x04 -#define MSK_T0X2 0x02 -#define MSK_X2 0x01 +#define MSK_TWIX2 0x80 /* CKCON0 */ +#define MSK_WDX2 0x40 +#define MSK_PCAX2 0x20 +#define MSK_SIX2 0x10 +#define MSK_T2X2 0x08 +#define MSK_T1X2 0x04 +#define MSK_T0X2 0x02 +#define MSK_X2 0x01 -#define MSK_SPIX2 0x01 /* CKCON1 */ +#define MSK_SPIX2 0x01 /* CKCON1 */ -#define MSK_PLOCK 0x01 /* PLLCON */ -#define MSK_PLLEN 0x02 -#define MSK_EXT48 0x04 +#define MSK_PLOCK 0x01 /* PLLCON */ +#define MSK_PLLEN 0x02 +#define MSK_EXT48 0x04 -#define MSK_R 0xF0 /* PLLDIV */ -#define MSK_N 0x0F +#define MSK_R 0xF0 /* PLLDIV */ +#define MSK_N 0x0F - /* INTERRUPT */ -#define MSK_EC 0x40 /* IEN0 */ -#define MSK_ET2 0x20 -#define MSK_ES 0x10 -#define MSK_ET1 0x08 -#define MSK_EX1 0x04 -#define MSK_ET0 0x02 -#define MSK_EX0 0x01 +#define MSK_EC 0x40 /* IEN0 */ +#define MSK_ET2 0x20 +#define MSK_ES 0x10 +#define MSK_ET1 0x08 +#define MSK_EX1 0x04 +#define MSK_ET0 0x02 +#define MSK_EX0 0x01 -#define MSK_EUSB 0x40 /* IEN1 */ -#define MSK_ESPI 0x04 -#define MSK_ETWI 0x02 -#define MSK_EKB 0x01 +#define MSK_EUSB 0x40 /* IEN1 */ +#define MSK_ESPI 0x04 +#define MSK_ETWI 0x02 +#define MSK_EKB 0x01 - /* TIMERS */ -#define MSK_GATE1 0x80 /* TMOD */ -#define MSK_C_T1 0x40 -#define MSK_MO1 0x30 -#define MSK_GATE0 0x08 -#define MSK_C_T0 0x04 -#define MSK_MO0 0x03 +#define MSK_GATE1 0x80 /* TMOD */ +#define MSK_C_T1 0x40 +#define MSK_MO1 0x30 +#define MSK_GATE0 0x08 +#define MSK_C_T0 0x04 +#define MSK_MO0 0x03 - /* WATCHDOG */ -#define MSK_WTO 0x07 /* WDTPRG*/ +#define MSK_WTO 0x07 /* WDTPRG */ /* SPI CONTROLLER */ -#define MSK_SPR 0x83 /* SPCON */ -#define MSK_SPEN 0x40 -#define MSK_SSDIS 0x20 -#define MSK_MSTR 0x10 -#define MSK_MODE 0x0C -#define MSK_CPOL 0x08 -#define MSK_CPHA 0x04 +#define MSK_SPR 0x83 /* SPCON */ +#define MSK_SPEN 0x40 +#define MSK_SSDIS 0x20 +#define MSK_MSTR 0x10 +#define MSK_MODE 0x0C +#define MSK_CPOL 0x08 +#define MSK_CPHA 0x04 -#define MSK_SPIF 0x80 /* SPSTA */ -#define MSK_WCOL 0x40 -#define MSK_MODF 0x10 +#define MSK_SPIF 0x80 /* SPSTA */ +#define MSK_WCOL 0x40 +#define MSK_MODF 0x10 - /* TWI CONTROLLER */ -#define MSK_SSCR 0x83 /* SSCON */ -#define MSK_SSPE 0x40 -#define MSK_SSSTA 0x20 -#define MSK_SSSTO 0x10 -#define MSK_SSSI 0x08 -#define MSK_SSAA 0x04 +#define MSK_SSCR 0x83 /* SSCON */ +#define MSK_SSPE 0x40 +#define MSK_SSSTA 0x20 +#define MSK_SSSTO 0x10 +#define MSK_SSSI 0x08 +#define MSK_SSAA 0x04 - /* FLASH */ -#define MSK_FCON_FBUSY 0x01 +#define MSK_FCON_FBUSY 0x01 - - -#endif /* _EXT5131_H_ */ +#endif /* _EXT5131_H_ */ Modified: firmware/fuxusb/trunk/lib_mcu/fa-usb/flash_api.c =================================================================== --- firmware/fuxusb/trunk/lib_mcu/fa-usb/flash_api.c 2007-10-03 08:28:04 UTC (rev 578) +++ firmware/fuxusb/trunk/lib_mcu/fa-usb/flash_api.c 2007-10-03 11:19:59 UTC (rev 579) @@ -1,12 +1,13 @@ + /*C************************************************************************** -* NAME: flash_api.c +* NAME: flash_api.c *---------------------------------------------------------------------------- * Copyright (c) 2003 Atmel. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-flash-api-1_0_5 -* REVISION: 1.3 +* RELEASE: c5131-usb-flash-api-1_0_5 +* REVISION: 1.3 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This file contains whole of functions to access AT89C5131 Flash and EEPROM. *****************************************************************************/ @@ -19,325 +20,322 @@ /*_____ D E F I N I T I O N ________________________________________________*/ -Uchar data api_command _at_ 0x1C; -Uchar data api_value _at_ 0x1D; -Uchar data api_dpl _at_ 0x1F; -Uchar data api_dph _at_ 0x1E; +Uchar data api_command _at_ 0x1C; +Uchar data api_value _at_ 0x1D; +Uchar data api_dpl _at_ 0x1F; +Uchar data api_dph _at_ 0x1E; - -#define MSK_AUXR1_ENBOOT 0x20 -#define MAP_BOOT AUXR1 |= MSK_AUXR1_ENBOOT; -#define UNMAP_BOOT AUXR1 &= ~MSK_AUXR1_ENBOOT; +#define MSK_AUXR1_ENBOOT 0x20 +#define MAP_BOOT AUXR1 |= MSK_AUXR1_ENBOOT; +#define UNMAP_BOOT AUXR1 &= ~MSK_AUXR1_ENBOOT; -#define __API_FLASH_ENTRY_POINT (*((const void(code*)(void)) 0xFFC0 )) +#define __API_FLASH_ENTRY_POINT (*((const void(code*)(void)) 0xFFC0 )) #define __API_FLASH_ENTRY_POINT_PE (*((const void(code*)(void)) 0xFFF3 )) -#define __API_JMP_ISP_START (*((const void(code*)(void)) 0xFF00 )) -#define __API_JMP_BOOTLOADER (*((const void(code*)(void)) 0xF400 )) +#define __API_JMP_ISP_START (*((const void(code*)(void)) 0xFF00 )) +#define __API_JMP_BOOTLOADER (*((const void(code*)(void)) 0xF400 )) /*_____ D E C L A R A T I O N ______________________________________________*/ - /*F************************************************************************** -* NAME: __api_rd_generic +* NAME: __api_rd_generic *---------------------------------------------------------------------------- * PARAMS: -* Uchar command: api_command to call -* Uchar dpl : api_dpl -* return: +* Uchar command: api_command to call +* Uchar dpl : api_dpl +* return: * Uchar : read value *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This function allows to read xaf and special area *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- -* NOTE: +* NOTE: *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ -Uchar __api_rd_generic (Uchar command, Uchar dpl) +Uchar __api_rd_generic(Uchar command, Uchar dpl) { - api_command = command; - api_dpl = dpl; - MAP_BOOT; - __API_FLASH_ENTRY_POINT(); - UNMAP_BOOT; + api_command = command; + api_dpl = dpl; + MAP_BOOT; + __API_FLASH_ENTRY_POINT(); + UNMAP_BOOT; - return(api_value); + return (api_value); } /*F************************************************************************** -* NAME: __api_wr_generic +* NAME: __api_wr_generic *---------------------------------------------------------------------------- * PARAMS: -* Uchar command: api_command to call -* Uchar value : api_value -* Uchar dpl : api_dpl -* return: +* Uchar command: api_command to call +* Uchar value : api_value +* Uchar dpl : api_dpl +* return: * Uchar return: command status (1 - ok) *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This function allows to write in xaf *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- -* NOTE: +* NOTE: *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ -Uchar __api_wr_generic (Uchar command, Uchar value, Uchar dpl) +Uchar __api_wr_generic(Uchar command, Uchar value, Uchar dpl) { - bit ea_save; + bit ea_save; - ea_save = EA; - EA = 0; - api_command = command; - api_dpl = dpl; - api_value = value; - MAP_BOOT; - __API_FLASH_ENTRY_POINT(); - UNMAP_BOOT; - EA = ea_save; // restore interrupt state - return(1); + ea_save = EA; + EA = 0; + api_command = command; + api_dpl = dpl; + api_value = value; + MAP_BOOT; + __API_FLASH_ENTRY_POINT(); + UNMAP_BOOT; + EA = ea_save; // restore interrupt state + return (1); } /*F************************************************************************** -* NAME: __api_rd_code_byte +* NAME: __api_rd_code_byte *---------------------------------------------------------------------------- * PARAMS: -* Uint16 address : address in flash memory to read -* return: +* Uint16 address : address in flash memory to read +* return: * Uchar device : read value *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This function allows to read a flash memory byte. *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- * NOTE: -* To use this function the constante __API_RD_CODE_BYTE must be define in +* To use this function the constante __API_RD_CODE_BYTE must be define in * C header file flash_api.h. *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ #ifdef __API_RD_CODE_BYTE -Uchar __api_rd_code_byte (Uchar code * pt_address) +Uchar __api_rd_code_byte(Uchar code * pt_address) { - return(*pt_address); + return (*pt_address); } #endif /*F************************************************************************** -* NAME: __api_wr_code_byte +* NAME: __api_wr_code_byte *---------------------------------------------------------------------------- * PARAMS: * Uint16 address : address to program -* Uchar value : data to write -* return: -* Uchar return : -* return = 0x00 -> pass -* return != 0x00 -> fail +* Uchar value : data to write +* return: +* Uchar return : +* return = 0x00 -> pass +* return != 0x00 -> fail *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This function allows to program data byte in Flash memory. *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- * NOTE: -* To use this function the constante __API_WR_CODE_BYTE must be define in +* To use this function the constante __API_WR_CODE_BYTE must be define in * C header file flash_api.h. *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ #ifdef __API_WR_CODE_BYTE -Uchar __api_wr_code_byte (Uchar xdata * pt_address, Uchar value) +Uchar __api_wr_code_byte(Uchar xdata * pt_address, Uchar value) { - bit ea_save; + bit ea_save; - ea_save = EA; - EA = 0; - api_command = _COMMAND_WR_CODE_BYTE; - FCON = 0x08; + ea_save = EA; + EA = 0; + api_command = _COMMAND_WR_CODE_BYTE; + FCON = 0x08; - *pt_address = value; + *pt_address = value; - MAP_BOOT; - __API_FLASH_ENTRY_POINT_PE(); - UNMAP_BOOT; - EA = ea_save; // restore interrupt state + MAP_BOOT; + __API_FLASH_ENTRY_POINT_PE(); + UNMAP_BOOT; + EA = ea_save; // restore interrupt state - return(api_value); + return (api_value); } #endif - /*F************************************************************************** -* NAME: __api_wr_code_page +* NAME: __api_wr_code_page *---------------------------------------------------------------------------- * PARAMS: * Uint16 add_flash : address of the first byte to program in the Flash -* Uint16 add_xram : address in XRAM of the first data to program +* Uint16 add_xram : address in XRAM of the first data to program * Uchar nb_data : number of bytes to program -* return: -* Uchar return : -* return = 0x00 -> pass -* return != 0x00 -> fail +* return: +* Uchar return : +* return = 0x00 -> pass +* return != 0x00 -> fail *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This function allows to program until 128 Datas in Flash memory. * Number of bytes to program is limited such as the Flash write remains in a -* single 128 bytes page. +* single 128 bytes page. *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- * NOTE: -* To use this function the constante __API_WR_CODE_PAGE must be define in +* To use this function the constante __API_WR_CODE_PAGE must be define in * C header file flash_api.h. -* This function used Dual Data Pointer DPTR0&1. At the end of this function +* This function used Dual Data Pointer DPTR0&1. At the end of this function * DPTR = DPTR0. *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ #ifdef __API_WR_CODE_PAGE -Uchar __api_wr_code_page (Uchar xdata * pt_code, Uchar xdata * pt_xram, Uchar nb_data) +Uchar __api_wr_code_page(Uchar xdata *pt_code, Uchar xdata *pt_xram, + Uchar nb_data) { - Uchar data i, temp, temp_nb_data; - bit ea_save; - Uint16 data add_pt_code, add_pt_xram; + Uchar data i, temp, temp_nb_data; + bit ea_save; + Uint16 data add_pt_code, add_pt_xram; - add_pt_xram = pt_xram; - add_pt_code = pt_code; - temp_nb_data = nb_data; - ea_save = EA; - EA = 0; - api_command = _COMMAND_WR_CODE_BYTE; - for (i=0 ; i< temp_nb_data; i++,add_pt_xram++,add_pt_code++) - { - temp = *(Uchar xdata *)add_pt_xram; + add_pt_xram = pt_xram; + add_pt_code = pt_code; + temp_nb_data = nb_data; + ea_save = EA; + EA = 0; + api_command = _COMMAND_WR_CODE_BYTE; + for (i = 0; i < temp_nb_data; i++, add_pt_xram++, add_pt_code++) + { + temp = *(Uchar xdata *) add_pt_xram; FCON = 0x08; - *(Uchar xdata *)add_pt_code = temp; + *(Uchar xdata *) add_pt_code = temp; FCON = 0x00; - } + } - MAP_BOOT; - __API_FLASH_ENTRY_POINT_PE(); - UNMAP_BOOT; - EA = ea_save; // restore interrupt state - - return(api_value); + MAP_BOOT; + __API_FLASH_ENTRY_POINT_PE(); + UNMAP_BOOT; + EA = ea_save; // restore interrupt state + + return (api_value); } #endif /*F************************************************************************** -* NAME: __api_wr_code_page_fix +* NAME: __api_wr_code_page_fix *---------------------------------------------------------------------------- * PARAMS: * Uint16 add_flash : address of the first byte to program in the Flash -* Uint16 add_xram : address in XRAM of the first data to program +* Uint16 add_xram : address in XRAM of the first data to program * Uchar nb_data : number of bytes to program -* return: -* Uchar return : -* return = 0x00 -> pass -* return != 0x00 -> fail +* return: +* Uchar return : +* return = 0x00 -> pass +* return != 0x00 -> fail *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * This function allows to program until 128 Datas in Flash memory. * Number of bytes to program is limited such as the Flash write remains in a -* single 128 bytes page. +* single 128 bytes page. *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- * NOTE: -* To use this function the constante __API_WR_CODE_PAGE must be define in +* To use this function the constante __API_WR_CODE_PAGE must be define in * C header file flash_api.h. -* This function used Dual Data Pointer DPTR0&1. At the end of this function +* This function used Dual Data Pointer DPTR0&1. At the end of this function * DPTR = DPTR0. *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ #ifdef __API_WR_CODE_PAGE_FIX -Uchar __api_wr_code_page_fix (Uchar xdata * pt_code, Uchar xdata * pt_xram, Uchar nb_data) +Uchar __api_wr_code_page_fix(Uchar xdata *pt_code, Uchar xdata *pt_xram, + Uchar nb_data) { - bit ea_save; - Uint16 add_xram; - data Uint16 add_code; + bit ea_save; + Uint16 add_xram; + data Uint16 add_code; + add_xram = DPTR; // save the DPTR + add_code = pt_code; + ea_save = EA; + EA = 0; + add_xram = pt_xram; + api_command = 0x01; + api_value = nb_data; + api_dpl = LOW(add_xram); + api_dph = ((Uchar) ((add_xram) >> 8)); + AUXR1++; +// add_xram = DPTR; // save the DPTR +// DPTR = pt_code; + DPTR = add_code; + AUXR1++; + MAP_BOOT; + __API_FLASH_ENTRY_POINT(); + UNMAP_BOOT; - add_xram = DPTR; // save the DPTR - add_code = pt_code; - ea_save = EA; - EA = 0; - add_xram = pt_xram; - api_command =0x01; - api_value = nb_data; - api_dpl = LOW(add_xram); - api_dph = ((Uchar)((add_xram)>>8)); - AUXR1++; -// add_xram = DPTR; // save the DPTR -// DPTR = pt_code; - DPTR = add_code; - AUXR1++; - MAP_BOOT; - __API_FLASH_ENTRY_POINT(); - UNMAP_BOOT; + AUXR1++; + DPTR = add_xram; // restore the DPTR + AUXR1++; + EA = ea_save; // restore interrupt state - AUXR1++; - DPTR = add_xram; // restore the D... [truncated message content] |
From: Paul_R <c2m...@c2...> - 2007-10-03 08:29:10
|
Author: Paul_R Date: 2007-10-03 10:28:04 +0200 (Wed, 03 Oct 2007) New Revision: 578 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml Log: * Fix some bug when the widget window was displayed Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-02 21:18:59 UTC (rev 577) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-03 08:28:04 UTC (rev 578) @@ -370,9 +370,9 @@ def on_btnBehavior_clicked(self, widget, *args): self.get_widget('conf_behavior').set_filename('None') index = self.value_list.get_value(self.iter, 0) - print self.measure.event_tab[index][6] + print self.measure.event_tab[index-1][6] self.measure.event_tab[index-1][6] = None - print self.measure.event_tab[index][6] + print self.measure.event_tab[index-1][6] self.value_list.clear() for i in range(len(self.measure.event_tab)): Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 21:18:59 UTC (rev 577) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-03 08:28:04 UTC (rev 578) @@ -53,6 +53,7 @@ context.set_source_rgb(0, 0, 0) context.set_line_width(0.6) context.line_to(0, y) + context.set_source_rgb(0.2, 0.2, 0.2) context.show_text(str((10-(i/2))*10)+"%") context.stroke() @@ -137,12 +138,16 @@ # ########################################################### def event_control(self): - for i in range (len(self.event_tab)): - self.Threshold_control(i) - self.Change_control(i) + if self.GUI_on == False: + for i in range (len(self.event_tab)): + print 'Goto threshold control' + self.Threshold_control(i) + print 'Goto change control' + self.Change_control(i) #Gadget or test notifications - if self.GUI_on: + else: + print 'Goto test functions' self.test_func() #disable gadget notifications self.notify = False @@ -159,9 +164,8 @@ self.change_event = False self.threshold_event = False self.start_flag = False - - - + for i in range (len(self.event_tab)): + self.event_tab[i][7] = False def change_control(self): # Determine how many point must be checked for changes events pts_per_sec = self.sample / (self.rate * self.sample) @@ -183,19 +187,28 @@ ########################################################### def Threshold_control(self, index): if self.event_tab[index][1] == 1: + print 'Threshold found' if self.event_tab[index][7] != True: + print 'No event detected' if self.event_tab[index][2] == 0: + print 'Increase' #Increasing threshold control if self.Increase_control(self.event_tab[index][3]) == True: + print 'Increase detected' self.event_tab[index][7] = True elif self.event_tab[index][2] == 1: + print 'Decrease' #Decreasing threshold control if self.Decrease_control(self.event_tab[index][3]) == True: + print 'Decrease detected' self.event_tab[index][7] = True elif self.event_tab[index][2] == 2: + print 'Both direction' #Both direction theshold control if self.Both_control(self.event_tab[index][3]) == True: + print 'Both detected' self.event_tab[index][7] = True + print 'Threshold control done ...' def Increase_control(self, value): val_act = (self.val_table[len(self.val_table)-1]*100) / 1124.0 @@ -224,27 +237,38 @@ ########################################################### def Change_control(self, i): #Changements control - if self.event_tab[i][1] == 0: + if self.event_tab[i][1] == 0: + print 'Change found' pts_per_sec = self.sample / (self.rate * self.sample) time = float(self.event_tab[i][4] * pts_per_sec) if self.event_tab[i][7] != True: + print 'no event detected' # Drop change part : if self.event_tab[i][2] == 0: + print 'Drop' if self.Drop_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + print 'Drop detected' self.event_tab[i][7] = True # Raise change part if self.event_tab[i][2] == 1: + print 'Raise' if self.Raise_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + print 'Raise detected' self.event_tab[i][7] = True # Drop and Raise change if self.event_tab[i][2] == 2: + print 'Drop and raise' if self.ChangeD_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + print 'Drop and raise detected' self.event_tab[i][7] = True # Raise and Drop change if self.event_tab[i][2] == 3: + print 'Raise and drop' if self.ChangeU_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + print 'Raise and drop detected' self.event_tab[i][7] = True - + print 'Change control done ...' + def Drop_control(self, time, val, timeout, index): #timeout control : to prevent multiple notifications with the same event if timeout != 0: @@ -257,8 +281,11 @@ else: self.timeout = int(time) return True - elif self.GUI_on: - self.timeout = timeout + else: + if self.GUI_on: + self.timeout = timeout + else: + self.event_tab[index][8] = timeout def Raise_control(self, time, val, timeout, index): if timeout != 0: @@ -271,8 +298,11 @@ else: self.timeout = int(time) return True - elif self.GUI_on: - self.timeout = timeout + else: + if self.GUI_on: + self.timeout = timeout + else: + self.event_tab[index][8] = timeout def ChangeD_control(self, time, val, timeout, index): if timeout != 0: @@ -319,57 +349,82 @@ ########################################################### def test_func(self): if self.threshold_event != True: + print 'Threshold event found' #Decrease threshold control if self.decrease: - self.threshold_event = self.Decrease_control(self.val_threshold) + print 'Goto decrease control' + if self.Decrease_control(self.val_threshold) == True: + self.threshold_event = True + print 'done ...' #Increasing threshold control if self.increase: - self.threshold_event = self.Increase_control(self.val_threshold) + print 'Goto Increase control' + if self.Increase_control(self.val_threshold) == True: + self.threshold_event = True + print 'done ...' #Both direction theshold control if self.both: - self.threshold_event = self.Both_control(self.val_threshold) + print 'Goto Both control' + if self.Both_control(self.val_threshold) == True: + self.threshold_event = True + print 'done ...' #Changements control if self.change_event != True: + print 'Change event found' # Drop change part : if self.drop == True and self.val_drop_time > 0.0: - self.change_event = self.Drop_control(self.val_drop_time, self.val_drop, self.timeout, 0) + print 'Goto drop control' + if self.Drop_control(self.val_drop_time, self.val_drop, self.timeout, 0) == True: + self.change_event = True + print 'done ...' # Raise change part if self.raising == True and self.val_raise_time > 0.0: - self.change_event = self.Raise_control(self.val_raise_time, self.val_raise, self.timeout, 0) + print 'Goto raise control' + if self.Raise_control(self.val_raise_time, self.val_raise, self.timeout, 0) == True: + self.change_event = True + print 'done ...' # Drop and Raise change if self.changeD == True and self.val_changeD_time > 0.0: - self.change_event = self.ChangeD_control(self.val_changeD_time, self.val_changeD, self.timeout, 0) + print 'Goto drop and raise control' + if self.ChangeD_control(self.val_changeD_time, self.val_changeD, self.timeout, 0) == True: + self.change_event = True + print 'done ...' # Raise and Drop change if self.changeU == True and self.val_changeU_time > 0.0: - self.change_event = self.ChangeU_control(self.val_changeU_time, self.val_changeU, self.timeout, 0) + print 'Goto raise and drop control' + if self.ChangeU_control(self.val_changeU_time, self.val_changeU, self.timeout, 0) == True: + self.change_event = True + print 'Done' def test_notification(self): if self.threshold_event == True: - if self.threshold_behavior_chk and os.path.isfile(self.threshold_behavior): + print 'Theshold event occur' + if self.threshold_behavior_chk and os.path.isfile(self.threshold_behavior) and os.path.exists(self.threshold_behavior) : + print 'Execute behavior script' self.threshold_event = False tux.sys.shell_free(self.threshold_behavior) else: + print 'execute deflaut behavior' self.threshold_event = False tux.cmd.mouth_open() tux.tts.speak(self.thresholdtext) tux.cmd.mouth_close() elif self.change_event == True: - print self.change_behavior - print os.path.isfile(self.change_behavior) - if self.change_behavior_chk: - if os.path.isfile(self.change_behavior): - print 'test' - self.change_event = False - tux.sys.shell_free(self.change_behavior) + print 'Change event occur' + if self.change_behavior_chk and os.path.isfile(self.change_behavior) and os.path.exists(self.change_behavior): + print 'Execute behavior script' + self.change_event = False + tux.sys.shell_free(self.change_behavior) else: + print 'Default behavior' self.change_event = False tux.cmd.mouth_open() tux.tts.speak(self.changetext) tux.cmd.mouth_close() - + print 'End of test notifications' ########################################################### # # Acquire Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 21:18:59 UTC (rev 577) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-03 08:28:04 UTC (rev 578) @@ -26,23 +26,32 @@ text = _me.string('conf_lblChangeU') else: if event[i][2] == 0: + print 'Increase text' text = _me.string('conf_lblIncrease') elif event[i][2] == 1: + print 'Decrease text' text = _me.string('conf_lblDecrease') elif event[i][2] == 2: + print 'Both text' text = _me.string('conf_lblBoth') + print 'End threshold text' if event[i][7]: + print 'first notification step' if event[i][5]: - if os.path.isfile(str(event[i][6])): + print 'notification enable' + if os.path.isfile(event[i][6]) and os.path.exists(event[i][6]): + print 'script found and valid' tux.sys.shell_free(event[i][6]) event[i][7] = False else: + print 'default behavior' tux.cmd.mouth_open() tux.tts.speak(text) tux.cmd.mouth_close() event[i][7] = False else: + print 'notification disabled' event[i][7] = False print 'notification done' break Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 21:18:59 UTC (rev 577) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-03 08:28:04 UTC (rev 578) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>light_monitor</gadget_name> + <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_description type='str'>Light monitor for tux droid</gadget_description> - <gadget_author type='str'>Paul Rathgeb</gadget_author> - <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-10-02 21:19:04
|
Author: jaguarondi Date: 2007-10-02 23:18:59 +0200 (Tue, 02 Oct 2007) New Revision: 577 Modified: firmware/fuxusb/trunk/bootloading.c firmware/fuxusb/trunk/bootloading.h firmware/fuxusb/trunk/config.h firmware/fuxusb/trunk/global.c firmware/fuxusb/trunk/global.h firmware/fuxusb/trunk/i2c.c firmware/fuxusb/trunk/i2c.h firmware/fuxusb/trunk/main.c firmware/fuxusb/trunk/version.h Log: * Cleanup of the USB code, removed extra whitespaces and tabs. Modified: firmware/fuxusb/trunk/bootloading.c =================================================================== --- firmware/fuxusb/trunk/bootloading.c 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/bootloading.c 2007-10-02 21:18:59 UTC (rev 577) @@ -1,8 +1,7 @@ - /* KySoH iTux agent * * Behavioural source code - * created on 2005/10/19 David Bourgeois + * created on 2005/10/19 David Bourgeois * -------------------------------------------------------- * $Id$ */ @@ -18,15 +17,15 @@ uint8_t address_idx; uint8_t packet_idx; -blHeader_t blHeader; /* header for bootloading */ +blHeader_t blHeader; /* header for bootloading */ /* * Initialize i2c interface */ void blInit(void) { - i2cSetBitrate(); /* set TWI bitrate */ - i2cInit(); /* initialize TWI interface */ + i2cSetBitrate(); /* set TWI bitrate */ + i2cInit(); /* initialize TWI interface */ blHeader.blData = &i2cSendData[2]; } @@ -43,7 +42,7 @@ { i2cFlags.s_val = 0; i2cDeviceAddrRW = blHeader.slave_address; - i2cSendData[0] = blHeader.page_address >> 8; /* the first 2 bytes of the i2c frame are the page address */ + i2cSendData[0] = blHeader.page_address >> 8; /* the first 2 bytes of the i2c frame are the page address */ i2cSendData[1] = blHeader.page_address; i2cSendDataLength = dataLength + 2; i2cMasterStart(); Modified: firmware/fuxusb/trunk/bootloading.h =================================================================== --- firmware/fuxusb/trunk/bootloading.h 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/bootloading.h 2007-10-02 21:18:59 UTC (rev 577) @@ -14,11 +14,11 @@ #include "config.h" /** USB bootloader commands */ -#define BOOT_INIT 1 +#define BOOT_INIT 1 #define BOOT_FILLPAGE 2 #define BOOT_EXIT 3 -#define BOOTLOADER_CMD (uint8_t)0xF0 /* Bootloader status command */ +#define BOOTLOADER_CMD (uint8_t)0xF0 /* Bootloader status command */ /** * \brief Bootloading header structure which holds all information to initiate Modified: firmware/fuxusb/trunk/config.h =================================================================== --- firmware/fuxusb/trunk/config.h 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/config.h 2007-10-02 21:18:59 UTC (rev 577) @@ -1,10 +1,10 @@ /*H************************************************************************** -* NAME: config.h +* NAME: config.h *---------------------------------------------------------------------------- * Copyright (c) 2004 Atmel. *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * Describes the system dependant software configuration. * This file is included by all source files in order to access to system wide * configuration. @@ -35,89 +35,89 @@ //#define BOOTLOAD_DEBUG //#define USB_CMD_DEBUG #define VERBOSE 0 -#define DEBUG_1 P3_6 -#define DEBUG_2 P4_0 +#define DEBUG_1 P3_6 +#define DEBUG_2 P4_0 /*_____ D E F I N I T I O N ________________________________________________*/ // Board config -#define FOSC 24000 -#define CPUB_VERSION //#define FILE_BOARD_H "lib_board/c5131_evab.h" 0x0102 -#define X2_MODE // Allow use of c51 x2 mode feature +#define FOSC 24000 +#define CPUB_VERSION //#define FILE_BOARD_H "lib_board/c5131_evab.h" 0x0102 +#define X2_MODE // Allow use of c51 x2 mode feature #define SPI_Clock_Div8 -#define BAUDRATE 115200 // in bps -#define BDR_GENERATOR BRG_TIMER2 // Available value: BRG_INTERNAL, BRG_TIMER1, BRG_TIMER2 +#define BAUDRATE 115200 // in bps +#define BDR_GENERATOR BRG_TIMER2 // Available value: BRG_INTERNAL, BRG_TIMER1, BRG_TIMER2 /*_____ D E F I N I T I O N ________________________________________________*/ /* USB Configuration */ /* DEVICE DESCRIPTOR */ -#define EP_AUDIO_IN 1 -#define EP_AUDIO_OUT 2 -#define EP_AUDIO_OUT_TTS 3 -#define EP_CMD_IN 4 -#define EP_CMD_OUT 5 +#define EP_AUDIO_IN 1 +#define EP_AUDIO_OUT 2 +#define EP_AUDIO_OUT_TTS 3 +#define EP_CMD_IN 4 +#define EP_CMD_OUT 5 -#define USB_SPECIFICATION 0x1001 -#define DEVICE_CLASS 0x00 -#define DEVICE_SUB_CLASS 0 -#define DEVICE_PROTOCOL 0 -#define EP_CONTROL_LENGTH 32 +#define USB_SPECIFICATION 0x1001 +#define DEVICE_CLASS 0x00 +#define DEVICE_SUB_CLASS 0 +#define DEVICE_PROTOCOL 0 +#define EP_CONTROL_LENGTH 32 -#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ -#define PRODUCT_ID 0x07FF /* Product ID: FF07h */ -#define RELEASE_NUMBER (0x0100*VER_UPDATE)+(0x1000*VER_MINOR)+(0x0001*VER_MAJOR) // 0x2021 //(VER_MAJOR)//((0x0000)|(VER_MAJOR<<24)|(VER_MINOR<<8)|(VER_UPDATE)) -#define NB_CONFIGURATION 1 +#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ +#define PRODUCT_ID 0x07FF /* Product ID: FF07h */ +#define RELEASE_NUMBER (0x0100*VER_UPDATE)+(0x1000*VER_MINOR)+(0x0001*VER_MAJOR) // 0x2021 //(VER_MAJOR)//((0x0000)|(VER_MAJOR<<24)|(VER_MINOR<<8)|(VER_UPDATE)) +#define NB_CONFIGURATION 1 /* CONFIGURATION DESCRIPTOR */ -#define CONF_LENGTH 0xE800 // 232 -#define NB_INTERFACE 6 -#define CONF_NB 1 -#define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED -#define MAX_POWER 50 /* 100 mA */ +#define CONF_LENGTH 0xE800 // 232 +#define NB_INTERFACE 6 +#define CONF_NB 1 +#define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED +#define MAX_POWER 50 /* 100 mA */ -#define LANG_ID 0x00 -#define LANGUAGE_ID 0x0904 +#define LANG_ID 0x00 +#define LANGUAGE_ID 0x0904 -#define EP_CONTROL 0x00 -#define EP_IN 0x01 -#define EP_KBD_IN EP_IN -#define EP_IN_LENGTH 64 -#define ENDPOINT_0 0x00 -#define ENDPOINT_1 0x81 +#define EP_CONTROL 0x00 +#define EP_IN 0x01 +#define EP_KBD_IN EP_IN +#define EP_IN_LENGTH 64 +#define ENDPOINT_0 0x00 +#define ENDPOINT_1 0x81 -#define RX_EP 2 -#define TX_EP 1 -#define TX_EP_SIZE 32 +#define RX_EP 2 +#define TX_EP 1 +#define TX_EP_SIZE 32 /* STRING INDEX */ /*******************************************/ -#define MAN_STRING_INDEX 1 -#define PROD_STRING_INDEX 2 -#define SN_STRING_INDEX 3 -#define CONFIG_STRING_INDEX 4 +#define MAN_STRING_INDEX 1 +#define PROD_STRING_INDEX 2 +#define SN_STRING_INDEX 3 +#define CONFIG_STRING_INDEX 4 #define USB_MANUFACTURER_NAME {'K'<<8, 'y'<<8, 's'<<8, 'o'<<8, 'h'<<8} -#define USB_MN_LENGTH 5 +#define USB_MN_LENGTH 5 -#define USB_PRODUCT_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ +#define USB_PRODUCT_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} -#define USB_PN_LENGTH 9 +#define USB_PN_LENGTH 9 -#define USB_SERIAL_NUMBER {'1'<<8, '0'<<8, '0'<<8, '0'<<8, '1'<<8} -#define USB_SN_LENGTH 5 +#define USB_SERIAL_NUMBER {'1'<<8, '0'<<8, '0'<<8, '0'<<8, '1'<<8} +#define USB_SN_LENGTH 5 -#define USB_CONFIG_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ +#define USB_CONFIG_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} -#define USB_CONFIG_LENGTH 9 +#define USB_CONFIG_LENGTH 9 -#define LANG_ID 0x00 -#define LANGUAGE_ID 0x0904 +#define LANG_ID 0x00 +#define LANGUAGE_ID 0x0904 /*_____ D E C L A R A T I O N ______________________________________________*/ Modified: firmware/fuxusb/trunk/global.c =================================================================== --- firmware/fuxusb/trunk/global.c 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/global.c 2007-10-02 21:18:59 UTC (rev 577) @@ -1,13 +1,13 @@ /*C************************************************************************** -* NAME: global.c +* NAME: global.c *---------------------------------------------------------------------------- * Copyright (c) 2006 C2me. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-RF Dongle -* REVISION: 1.3 +* RELEASE: c5131-usb-RF Dongle +* REVISION: 1.3 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: *---------------------------------------------------------------------------- * $Id$ *****************************************************************************/ @@ -23,41 +23,41 @@ /*_____ D E C L A R A T I O N ______________________________________________*/ //------------------------------------------------------- -// SPI Controler +// SPI Controler //------------------------------------------------------- -bit spi_task_on_Flag; // = 1; // to turn ON the RF Task +bit spi_task_on_Flag; // = 1; // to turn ON the RF Task - // = 0; // to turn OFF the RF Task + // = 0; // to turn OFF the RF Task //------------------------------------------------------- -// USB Controler +// USB Controler //------------------------------------------------------- unsigned int usb_sof_counter; unsigned char usb_configuration_nb; bit usb_connected_Flag; -bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint +bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint char CMD_IN_Bank_Nb; bit USB_ParserProcess_Permit_Flag; //------------------------------------------------------- -// I2C Controler +// I2C Controler //------------------------------------------------------- unsigned char i2c_wait_counter = 0; bit i2c_task_on_Flag; //------------------------------------------------------- -// RF Controler +// RF Controler //------------------------------------------------------- //------------------------------------------------------- -// RF Header +// RF Header //------------------------------------------------------- -#define RF_2FRAMES_HDR 0x80 -#define RF_AUDIO_HDR 0x02 -#define RF_CMD_HDR 0x08 +#define RF_2FRAMES_HDR 0x80 +#define RF_AUDIO_HDR 0x02 +#define RF_CMD_HDR 0x08 //------------------------------------------------------- @@ -71,7 +71,7 @@ unsigned int spi_watchdog_ctr; //------------------------------------------------------- -// Tux Command and Status +// Tux Command and Status //------------------------------------------------------- unsigned char Tux_ID[2]; @@ -79,16 +79,16 @@ bit Tux_RequestingID_Flag; bit Tux_ChangingID_Flag; - // From USB + // From USB //------------------------------------------------------- -unsigned char USBCommand_ForDongle[65]; // For Dongle -unsigned char USBCommand_ForRF[65]; // For RF -unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB +unsigned char USBCommand_ForDongle[65]; // For Dongle +unsigned char USBCommand_ForRF[65]; // For RF +unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB bit USBCommand_NewRequest_Flag; -unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C +unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C //------------------------------------------------------- -// Dongle Info +// Dongle Info //------------------------------------------------------- code version_t info_version = { VERSION_CMD, VER_MAJOR, VER_MINOR, VER_UPDATE }; Modified: firmware/fuxusb/trunk/global.h =================================================================== --- firmware/fuxusb/trunk/global.h 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/global.h 2007-10-02 21:18:59 UTC (rev 577) @@ -1,13 +1,13 @@ /*C************************************************************************** -* NAME: global.h +* NAME: global.h *---------------------------------------------------------------------------- * Copyright (c) 2006 C2me. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-RF Dongle -* REVISION: 1.3 +* RELEASE: c5131-usb-RF Dongle +* REVISION: 1.3 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: * *****************************************************************************/ @@ -21,52 +21,52 @@ /*_____ D E F I N I T I O N ________________________________________________*/ // Hardware -#define rf_reset_signal P0_1 -#define RF_OFFLINE P2_3 +#define rf_reset_signal P0_1 +#define RF_OFFLINE P2_3 /*_____ D E C L A R A T I O N ______________________________________________*/ extern unsigned int Sleep_Ctr; //------------------------------------------------------- -// SPI Controler +// SPI Controler //------------------------------------------------------- -extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task +extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task - // = 0; // to turn OFF the RF Task + // = 0; // to turn OFF the RF Task extern unsigned int spi_watchdog_ctr; #define SPI_WATCHDOG_MAX (6000) //------------------------------------------------------- -// USB Controler +// USB Controler //------------------------------------------------------- extern unsigned int usb_sof_counter; extern unsigned char usb_configuration_nb; extern bit usb_connected_Flag; -extern bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint +extern bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint extern char CMD_IN_Bank_Nb; extern bit USB_ParserProcess_Permit_Flag; //------------------------------------------------------- -// I2C Controler +// I2C Controler //------------------------------------------------------- extern unsigned char i2c_wait_counter; extern bit i2c_task_on_Flag; //------------------------------------------------------- -// RF Controler +// RF Controler //------------------------------------------------------- -// RF Header +// RF Header //------------------------------------------------------- -#define RF_2FRAMES_HDR 0x80 -#define RF_AUDIO_HDR 0x02 -#define RF_CMD_HDR 0x08 -#define RF_INIT_FRAME 0x40 +#define RF_2FRAMES_HDR 0x80 +#define RF_AUDIO_HDR 0x02 +#define RF_CMD_HDR 0x08 +#define RF_INIT_FRAME 0x40 //------------------------------------------------------- @@ -77,35 +77,35 @@ extern unsigned char RF_InitFrame[]; extern unsigned char RF_Connection_Status; -#define RF_DISCONNECTED 0 -#define RF_TO_CONNECT 1 -#define RF_REQUEST_ID 2 -#define RF_CHANGE_ID 3 -#define RF_CONNECTED 4 +#define RF_DISCONNECTED 0 +#define RF_TO_CONNECT 1 +#define RF_REQUEST_ID 2 +#define RF_CHANGE_ID 3 +#define RF_CONNECTED 4 //------------------------------------------------------- -// Tux Command and Status +// Tux Command and Status //------------------------------------------------------- extern unsigned char Tux_ID[]; extern unsigned char Tux_NewID[]; extern bit Tux_RequestingID_Flag; extern bit Tux_ChangingID_Flag; - // From USB + // From USB //------------------------------------------------------- -extern unsigned char USBCommand_ForRF[]; // Store the USB Command -extern unsigned char USBCommand_ForDongle[]; // For Dongle -extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB +extern unsigned char USBCommand_ForRF[]; // Store the USB Command +extern unsigned char USBCommand_ForDongle[]; // For Dongle +extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB extern bit USBCommand_NewRequest_Flag; extern unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C -#define LIBUSB_TUX_CMD_HDR 0 -#define LIBUSB_DONGLE_CMD_HDR 1 -#define LIBUSB_BOOTLOADER_CMD_HDR 2 +#define LIBUSB_TUX_CMD_HDR 0 +#define LIBUSB_DONGLE_CMD_HDR 1 +#define LIBUSB_BOOTLOADER_CMD_HDR 2 //------------------------------------------------------- -// Dongle Info +// Dongle Info //------------------------------------------------------- extern code version_t info_version; Modified: firmware/fuxusb/trunk/i2c.c =================================================================== --- firmware/fuxusb/trunk/i2c.c 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/i2c.c 2007-10-02 21:18:59 UTC (rev 577) @@ -42,7 +42,7 @@ void i2cSetBitrate(void) { /* Setting SSCON based on TWI_SCAL defined in i2c.h */ - SSCON = TWI_SCAL_VALUE; /* twi intialisation */ + SSCON = TWI_SCAL_VALUE; /* twi intialisation */ } /* @@ -55,18 +55,18 @@ void i2cInit(void) { /* Set up twi */ - SSCON = TWI_SSIE | TWI_SCAL_VALUE; /* enable TWI */ + SSCON = TWI_SSIE | TWI_SCAL_VALUE; /* enable TWI */ #ifdef TWI_INT_ENABLED Enable_twi_interrupt(); #endif -#ifdef TWI_SLA_ENABLED /* If Slave mode: */ +#ifdef TWI_SLA_ENABLED /* If Slave mode: */ /* Set local device address (used in slave mode only) */ SSADR = I2C_SLA_ADD; /* Enabling Slave mode */ - TWI_SET_AA(); /* enable TWI ACK */ - i2cSlaveReceive = 0; /* XXX do we need those 2 lines? clear SlaveReceive and SlaveTransmit handler to null */ + TWI_SET_AA(); /* enable TWI ACK */ + i2cSlaveReceive = 0; /* XXX do we need those 2 lines? clear SlaveReceive and SlaveTransmit handler to null */ i2cSlaveTransmit = 0; #endif @@ -97,7 +97,7 @@ void i2cMasterStart(void) { i2cFlags.i2c_busy = 1; - i2cSendDataIndex = 0; /* don't forget to reset the index */ + i2cSendDataIndex = 0; /* don't forget to reset the index */ i2cSendStart(); } @@ -127,7 +127,7 @@ TWI_CLEAR_AA(); } -#define TW_DATA SSDAT +#define TW_DATA SSDAT uint8_t i2cGetReceivedByte(void) { return SSDAT; @@ -139,7 +139,7 @@ } #ifdef __debug__ -uint8_t i2cStatus[20]; /* debug only */ +uint8_t i2cStatus[20]; /* debug only */ uint8_t i2cStatusIdx = 0; #endif @@ -157,8 +157,8 @@ switch (TW_STATUS) { /* * * Master General * * */ - case TW_START: // 0x08: Sent start condition - case TW_REP_START: // 0x10: Sent repeated start condition + case TW_START: // 0x08: Sent start condition + case TW_REP_START: // 0x10: Sent repeated start condition #if I2C_DEBUG #endif // send device address @@ -168,14 +168,14 @@ /* * * Master Transmitter & Receiver status codes * * */ - case TW_MT_SLA_ACK: // 0x18: Slave address acknowledged - case TW_MT_DATA_ACK: // 0x28: Data acknowledged + case TW_MT_SLA_ACK: // 0x18: Slave address acknowledged + case TW_MT_DATA_ACK: // 0x28: Data acknowledged #if I2C_DEBUG #endif if (i2cSendDataIndex < i2cSendDataLength) { - i2cSendByte(i2cSendData[i2cSendDataIndex++]); /* send data */ + i2cSendByte(i2cSendData[i2cSendDataIndex++]); /* send data */ } else { @@ -186,89 +186,89 @@ case TW_MR_DATA_NACK: // 0x58: Data received, NACK reply issued #if I2C_DEBUG #endif - i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; // store final received data byte + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; // store final received data byte /* no break, continue to transmit STOP condition */ - case TW_MR_SLA_NACK: // 0x48: Slave address not acknowledged - case TW_MT_SLA_NACK: // 0x20: Slave address not acknowledged + case TW_MR_SLA_NACK: // 0x48: Slave address not acknowledged + case TW_MT_SLA_NACK: // 0x20: Slave address not acknowledged case TW_MT_DATA_NACK: // 0x30: Data not acknowledged #if I2C_DEBUG #endif i2cFlags.mt_nack = 1; i2cSendStop(); break; - case TW_MT_ARB_LOST: // 0x38: Bus arbitration lost - //case TW_MR_ARB_LOST: // 0x38: Bus arbitration lost + case TW_MT_ARB_LOST: // 0x38: Bus arbitration lost + //case TW_MR_ARB_LOST: // 0x38: Bus arbitration lost #if I2C_DEBUG #endif i2cInit(); break; - case TW_MR_DATA_ACK: // 0x50: Data acknowledged + case TW_MR_DATA_ACK: // 0x50: Data acknowledged #if I2C_DEBUG #endif // store received data byte i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; // fall-through to see if more bytes will be received - case TW_MR_SLA_ACK: // 0x40: Slave address acknowledged + case TW_MR_SLA_ACK: // 0x40: Slave address acknowledged #if I2C_DEBUG #endif if (i2cReceiveDataIndex < (i2cReceiveDataLength - 1)) - i2cAckReceiveByte(); /* receive more bytes */ + i2cAckReceiveByte(); /* receive more bytes */ else - i2cNackReceiveByte(); /* receive the last byte */ + i2cNackReceiveByte(); /* receive the last byte */ break; /* * * Slave Receiver status codes * * */ - case TW_SR_SLA_ACK: // 0x60: own SLA+W has been received, ACK has been returned - case TW_SR_ARB_LOST_SLA_ACK: // 0x68: own SLA+W has been received, ACK has been returned - case TW_SR_GCALL_ACK: // 0x70: GCA+W has been received, ACK has been returned - case TW_SR_ARB_LOST_GCALL_ACK: // 0x78: GCA+W has been received, ACK has been returned + case TW_SR_SLA_ACK: // 0x60: own SLA+W has been received, ACK has been returned + case TW_SR_ARB_LOST_SLA_ACK: // 0x68: own SLA+W has been received, ACK has been returned + case TW_SR_GCALL_ACK: // 0x70: GCA+W has been received, ACK has been returned + case TW_SR_ARB_LOST_GCALL_ACK: // 0x78: GCA+W has been received, ACK has been returned #if I2C_DEBUG #endif /* we are being addressed as slave for writing (data will be received from master) */ i2cFlags.i2c_busy = 1; i2cReceiveDataIndex = 0; - i2cFlags.s_nack = 0; /* reset nack flag here, not in user app */ - i2cAckReceiveByte(); /* accept data */ + i2cFlags.s_nack = 0; /* reset nack flag here, not in user app */ + i2cAckReceiveByte(); /* accept data */ break; - case TW_SR_DATA_ACK: // 0x80: data byte has been received, ACK has been returned - case TW_SR_GCALL_DATA_ACK: // 0x90: data byte has been received, ACK has been returned + case TW_SR_DATA_ACK: // 0x80: data byte has been received, ACK has been returned + case TW_SR_GCALL_DATA_ACK: // 0x90: data byte has been received, ACK has been returned #if I2C_DEBUG #endif - i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* get received data byte */ + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* get received data byte */ /* check receive buffer status */ if (i2cReceiveDataIndex < I2C_RECEIVE_DATA_BUFFER_SIZE) { - i2cAckReceiveByte(); /* accept more data */ + i2cAckReceiveByte(); /* accept more data */ } else { - i2cNackReceiveByte(); /* refuse more data */ + i2cNackReceiveByte(); /* refuse more data */ } break; case TW_SR_DATA_NACK: // 0x88: data byte has been received, NACK has been returned - case TW_SR_GCALL_DATA_NACK: // 0x98: data byte has been received, NACK has been returned + case TW_SR_GCALL_DATA_NACK: // 0x98: data byte has been received, NACK has been returned #if I2C_DEBUG #endif //i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* receive last byte XXX check if this is right */ //i2cNackReceiveByte(); //XXX bug here? // receive data byte and return NACK //i2cAckReceiveByte(); [> I should clear the interrupt and enable acknoledge for slave mode (disabled during previous nack) <] - i2cFlags.s_nack = 1; /* XXX check if this flag is reset in all possible conditions */ + i2cFlags.s_nack = 1; /* XXX check if this flag is reset in all possible conditions */ //break; /* pass along to restart slave mode */ - case TW_SR_STOP: // 0xA0: STOP or REPEATED START has been received while addressed as slave + case TW_SR_STOP: // 0xA0: STOP or REPEATED START has been received while addressed as slave #if I2C_DEBUG #endif - i2cInit(); /* enable TWI ACK */ + i2cInit(); /* enable TWI ACK */ if (i2cSlaveReceive) - i2cSlaveReceive(i2cReceiveDataIndex, i2cReceiveData); /* i2c receive is complete, call i2cSlaveReceive */ - i2cFlags.i2c_busy = 0; /* XXX check if this flag is reset in all possible conditions */ + i2cSlaveReceive(i2cReceiveDataIndex, i2cReceiveData); /* i2c receive is complete, call i2cSlaveReceive */ + i2cFlags.i2c_busy = 0; /* XXX check if this flag is reset in all possible conditions */ break; /* * * Slave Transmitter * * */ - case TW_ST_SLA_ACK: // 0xA8: own SLA+R has been received, ACK has been returned - case TW_ST_ARB_LOST_SLA_ACK: // 0xB0: GCA+R has been received, ACK has been returned + case TW_ST_SLA_ACK: // 0xA8: own SLA+R has been received, ACK has been returned + case TW_ST_ARB_LOST_SLA_ACK: // 0xB0: GCA+R has been received, ACK has been returned #if I2C_DEBUG #endif // we are being addressed as slave for reading (data must be transmitted back to master) @@ -276,36 +276,36 @@ if (i2cSlaveTransmit) i2cSendDataLength = i2cSlaveTransmit(I2C_SEND_DATA_BUFFER_SIZE, i2cSendData); - i2cSendDataIndex = 0; /* reset data index */ + i2cSendDataIndex = 0; /* reset data index */ /* fall-through to transmit first data byte */ - case TW_ST_DATA_ACK: // 0xB8: data byte has been transmitted, ACK has been received + case TW_ST_DATA_ACK: // 0xB8: data byte has been transmitted, ACK has been received #if I2C_DEBUG #endif TW_DATA = i2cSendData[i2cSendDataIndex++]; /* transmit data byte */ if (i2cSendDataIndex < i2cSendDataLength) - i2cAckReceiveByte(); /* expect ACK to data byte */ + i2cAckReceiveByte(); /* expect ACK to data byte */ else - i2cNackReceiveByte(); /* expect NACK to data byte */ + i2cNackReceiveByte(); /* expect NACK to data byte */ break; case TW_ST_DATA_NACK: // 0xC0: data byte has been transmitted, NACK has been received case TW_ST_LAST_DATA: // 0xC8: last data byte transmitted, ACK received #if I2C_DEBUG #endif /* all done, switch to open slave */ - i2cInit(); /* enable TWI ACK */ + i2cInit(); /* enable TWI ACK */ break; /* * * Misc * * */ - case TW_NO_INFO: // 0xF8: No relevant state information + case TW_NO_INFO: // 0xF8: No relevant state information /* do nothing */ #if I2C_DEBUG #endif break; - case TW_BUS_ERROR: // 0x00: Bus error due to illegal start or stop condition + case TW_BUS_ERROR: // 0x00: Bus error due to illegal start or stop condition #if I2C_DEBUG #endif - i2cSendStop(); /* reset internal hardware and release bus */ + i2cSendStop(); /* reset internal hardware and release bus */ break; } TWI_CLEAR_SI(); Modified: firmware/fuxusb/trunk/i2c.h =================================================================== --- firmware/fuxusb/trunk/i2c.h 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/i2c.h 2007-10-02 21:18:59 UTC (rev 577) @@ -14,27 +14,27 @@ #include "config.h" #ifdef __debug__ -extern uint8_t i2cStatus[20]; /* XXX debug only */ +extern uint8_t i2cStatus[20]; /* XXX debug only */ extern uint8_t i2cStatusIdx; #endif /* * * include custom configuration here * * */ -#define I2C_SEND_DATA_BUFFER_SIZE 130 -#define I2C_RECEIVE_DATA_BUFFER_SIZE 8 +#define I2C_SEND_DATA_BUFFER_SIZE 130 +#define I2C_RECEIVE_DATA_BUFFER_SIZE 8 /* * Choose operation mode, comment/uncomment lines * For Slave only operation, choose Master and Slave */ -#define TWI_INT_ENABLED /* comment if you don't want twi interrupts */ -#define TWI_M_ENABLED /* comment if you don't want twi master mode */ +#define TWI_INT_ENABLED /* comment if you don't want twi interrupts */ +#define TWI_M_ENABLED /* comment if you don't want twi master mode */ //#define TWI_SLA_ENABLED /* comment if you don't want twi slave mode */ /* SSADR: TWI (Slave) Address Register * Bits 7..1 : TWI (Slave) Address Register * Bit 0 : TWI General Call Recognition Enable Bit */ -#define I2C_SLA_ADD ((0X55<<1) | 0x01) /* Only necessary in slave mode */ +#define I2C_SLA_ADD ((0X55<<1) | 0x01) /* Only necessary in slave mode */ /* * Initialise TWI clock @@ -46,31 +46,31 @@ */ //#define TWI_SCAL 160 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ -#define TWI_SCAL 960 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ +#define TWI_SCAL 960 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ /* * * END of code customisation * * */ #if TWI_SCAL == 256 -#define TWI_SCAL_VALUE TWI_RATIO_256 +#define TWI_SCAL_VALUE TWI_RATIO_256 #elif TWI_SCAL == 224 -#define TWI_SCAL_VALUE TWI_RATIO_224 +#define TWI_SCAL_VALUE TWI_RATIO_224 #elif TWI_SCAL == 192 -#define TWI_SCAL_VALUE TWI_RATIO_192 +#define TWI_SCAL_VALUE TWI_RATIO_192 #elif TWI_SCAL == 160 -#define TWI_SCAL_VALUE TWI_RATIO_160 +#define TWI_SCAL_VALUE TWI_RATIO_160 #elif TWI_SCAL == 960 -#define TWI_SCAL_VALUE TWI_RATIO_960 +#define TWI_SCAL_VALUE TWI_RATIO_960 #elif TWI_SCAL == 120 -#define TWI_SCAL_VALUE TWI_RATIO_120 +#define TWI_SCAL_VALUE TWI_RATIO_120 #elif TWI_SCAL == 60 -#define TWI_SCAL_VALUE TWI_RATIO_60 +#define TWI_SCAL_VALUE TWI_RATIO_60 #else #error Incorrect TWI_SCAL value, should be: 256 224 192 160 960 120 60 #define TWI_SCAL_VALUE #endif /*! defines and constants */ -#define TWCR_CMD_MASK 0x0F +#define TWCR_CMD_MASK 0x0F /* * Bits that are set inside interrupt routines, and watched outside in @@ -78,13 +78,13 @@ */ typedef struct { - uint8_t i2c_busy:1; /* set when twi hardware is busy, cleared after an i2c stop */ - uint8_t mt_nack:1; /* error due to a nack received by the master transmitter */ - uint8_t s_nack:1; /* error due to a nack replied by the slave */ - uint8_t sr_end:1; /* set at the end of a receiver slave transmission if i2cSlaveReceive has not been defined */ - uint8_t st_end:1; /* set at the end of a transmitter slave transmission if i2cSlaveTransmit has not been defined */ - uint8_t i2c_idx:1; /* application side - can be used for data indexes status */ - uint8_t s_val:1; /* application side - can be used for data validation */ + uint8_t i2c_busy:1; /* set when twi hardware is busy, cleared after an i2c stop */ + uint8_t mt_nack:1; /* error due to a nack received by the master transmitter */ + uint8_t s_nack:1; /* error due to a nack replied by the slave */ + uint8_t sr_end:1; /* set at the end of a receiver slave transmission if i2cSlaveReceive has not been defined */ + uint8_t st_end:1; /* set at the end of a transmitter slave transmission if i2cSlaveTransmit has not been defined */ + uint8_t i2c_idx:1; /* application side - can be used for data indexes status */ + uint8_t s_val:1; /* application side - can be used for data validation */ } I2C_FLAGS; extern volatile I2C_FLAGS i2cFlags; Modified: firmware/fuxusb/trunk/main.c =================================================================== --- firmware/fuxusb/trunk/main.c 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/main.c 2007-10-02 21:18:59 UTC (rev 577) @@ -1,13 +1,13 @@ /*C************************************************************************** -* NAME: main.c +* NAME: main.c *---------------------------------------------------------------------------- * Copyright (c) 2006 C2me. *---------------------------------------------------------------------------- -* RELEASE: c5131-usb-RF Dongle -* REVISION: 1.3 +* RELEASE: c5131-usb-RF Dongle +* REVISION: 1.3 *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: *---------------------------------------------------------------------------- * $Id$ *****************************************************************************/ @@ -35,18 +35,18 @@ /*_____ D E C L A R A T I O N S ____________________________________________*/ /*F************************************************************************** -* NAME: main +* NAME: main *---------------------------------------------------------------------------- -* PARAMS: none -* return: none +* PARAMS: none +* return: none *---------------------------------------------------------------------------- -* PURPOSE: +* PURPOSE: *---------------------------------------------------------------------------- * EXAMPLE: *---------------------------------------------------------------------------- -* NOTE: +* NOTE: *---------------------------------------------------------------------------- -* REQUIREMENTS: +* REQUIREMENTS: *****************************************************************************/ void main(void) { @@ -55,10 +55,10 @@ * * It is set when USB receives SET_CONGIGURATION command during * enumeration. RF is also disabled during bootload. */ - rf_reset_signal = 0; // Maintains the RF in RESET STATE until the USB has received the Command to connect RF + rf_reset_signal = 0; // Maintains the RF in RESET STATE until the USB has received the Command to connect RF // Go to 0 in usb_set_configuration() - // Stay Low During the I2C communication - RF_OFFLINE = 1; // Set Port to able to Read the Input Signal + // Stay Low During the I2C communication + RF_OFFLINE = 1; // Set Port to able to Read the Input Signal Set_x2_mode(); Modified: firmware/fuxusb/trunk/version.h =================================================================== --- firmware/fuxusb/trunk/version.h 2007-10-02 21:03:04 UTC (rev 576) +++ firmware/fuxusb/trunk/version.h 2007-10-02 21:18:59 UTC (rev 577) @@ -2,7 +2,7 @@ /* KySoH iTux agent * * Behavioural source code - * created on 2005/10/20 David Bourgeois + * created on 2005/10/20 David Bourgeois * -------------------------------------------------------- * */ @@ -14,11 +14,11 @@ * Version number */ -#define VER_MAJOR 1 -#define VER_MINOR 2 -#define VER_UPDATE 0 +#define VER_MAJOR 1 +#define VER_MINOR 2 +#define VER_UPDATE 0 -#define AUTHOR_ID 0 /* official release */ -#define REVISION_NUMBER 0xFFEE /* XXX find a way to define this automatically in the Makefile from SVN */ +#define AUTHOR_ID 0 /* official release */ +#define REVISION_NUMBER 0xFFEE /* XXX find a way to define this automatically in the Makefile from SVN */ #endif /* _VERSION_H_ */ |
From: jaguarondi <c2m...@c2...> - 2007-10-02 21:03:15
|
Author: jaguarondi Date: 2007-10-02 23:03:04 +0200 (Tue, 02 Oct 2007) New Revision: 576 Modified: firmware/fuxusb/trunk/bootloading.c firmware/fuxusb/trunk/bootloading.h firmware/fuxusb/trunk/config.h firmware/fuxusb/trunk/global.c firmware/fuxusb/trunk/global.h firmware/fuxusb/trunk/i2c.c firmware/fuxusb/trunk/i2c.h firmware/fuxusb/trunk/main.c firmware/fuxusb/trunk/version.h Log: * Indented on all source files with: indent *.[ch] -nut -i4 -bad -bap -bbb -sob -sc -bl -bli0 -cli0 -cbi4 -nce -ncdw -ss -bls -npsl -ncs -npcs -nprs -saf -sai -saw -nbfda -nhnl -l80 Modified: firmware/fuxusb/trunk/bootloading.c =================================================================== --- firmware/fuxusb/trunk/bootloading.c 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/bootloading.c 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /* KySoH iTux agent * * Behavioural source code @@ -17,15 +18,15 @@ uint8_t address_idx; uint8_t packet_idx; -blHeader_t blHeader; /* header for bootloading */ +blHeader_t blHeader; /* header for bootloading */ /* * Initialize i2c interface */ void blInit(void) { - i2cSetBitrate(); /* set TWI bitrate */ - i2cInit(); /* initialize TWI interface */ + i2cSetBitrate(); /* set TWI bitrate */ + i2cInit(); /* initialize TWI interface */ blHeader.blData = &i2cSendData[2]; } @@ -42,7 +43,7 @@ { i2cFlags.s_val = 0; i2cDeviceAddrRW = blHeader.slave_address; - i2cSendData[0] = blHeader.page_address >> 8; /* the first 2 bytes of the i2c frame are the page address */ + i2cSendData[0] = blHeader.page_address >> 8; /* the first 2 bytes of the i2c frame are the page address */ i2cSendData[1] = blHeader.page_address; i2cSendDataLength = dataLength + 2; i2cMasterStart(); Modified: firmware/fuxusb/trunk/bootloading.h =================================================================== --- firmware/fuxusb/trunk/bootloading.h 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/bootloading.h 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /* * Copyright (c) 2006, C2ME S.A. * All rights reserved. @@ -2,3 +3,3 @@ * - * $Id:$ + * $Id$ */ @@ -17,13 +18,14 @@ #define BOOT_FILLPAGE 2 #define BOOT_EXIT 3 -#define BOOTLOADER_CMD (uint8_t)0xF0 /* Bootloader status command */ +#define BOOTLOADER_CMD (uint8_t)0xF0 /* Bootloader status command */ /** * \brief Bootloading header structure which holds all information to initiate * a bootloading communication */ -typedef struct blHeader_s { +typedef struct blHeader_s +{ /* 7 bits slave address aligned left + rw bit */ uint8_t slave_address; /* 16 bits address of the first byte of the page to write */ Modified: firmware/fuxusb/trunk/config.h =================================================================== --- firmware/fuxusb/trunk/config.h 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/config.h 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /*H************************************************************************** * NAME: config.h *---------------------------------------------------------------------------- @@ -21,11 +22,10 @@ #include "lib_mcu/reg_5131.h" #include "lib_mcu/ext_5131.h" #include "lib_mcu/5131_drv.h" -#include <stdio.h> +#include <stdio.h> /*_____ M A C R O S ________________________________________________________*/ - /* * Debugging configuration */ @@ -42,49 +42,42 @@ // Board config #define FOSC 24000 -#define CPUB_VERSION //#define FILE_BOARD_H "lib_board/c5131_evab.h" 0x0102 -#define X2_MODE // Allow use of c51 x2 mode feature +#define CPUB_VERSION //#define FILE_BOARD_H "lib_board/c5131_evab.h" 0x0102 +#define X2_MODE // Allow use of c51 x2 mode feature #define SPI_Clock_Div8 +#define BAUDRATE 115200 // in bps +#define BDR_GENERATOR BRG_TIMER2 // Available value: BRG_INTERNAL, BRG_TIMER1, BRG_TIMER2 -#define BAUDRATE 115200 // in bps -#define BDR_GENERATOR BRG_TIMER2 // Available value: BRG_INTERNAL, BRG_TIMER1, BRG_TIMER2 - - - /*_____ D E F I N I T I O N ________________________________________________*/ /* USB Configuration */ /* DEVICE DESCRIPTOR */ - #define EP_AUDIO_IN 1 #define EP_AUDIO_OUT 2 #define EP_AUDIO_OUT_TTS 3 #define EP_CMD_IN 4 #define EP_CMD_OUT 5 - - #define USB_SPECIFICATION 0x1001 #define DEVICE_CLASS 0x00 #define DEVICE_SUB_CLASS 0 #define DEVICE_PROTOCOL 0 #define EP_CONTROL_LENGTH 32 -#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ -#define PRODUCT_ID 0x07FF /* Product ID: FF07h*/ +#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ +#define PRODUCT_ID 0x07FF /* Product ID: FF07h */ #define RELEASE_NUMBER (0x0100*VER_UPDATE)+(0x1000*VER_MINOR)+(0x0001*VER_MAJOR) // 0x2021 //(VER_MAJOR)//((0x0000)|(VER_MAJOR<<24)|(VER_MINOR<<8)|(VER_UPDATE)) #define NB_CONFIGURATION 1 - /* CONFIGURATION DESCRIPTOR */ -#define CONF_LENGTH 0xE800 // 232 +#define CONF_LENGTH 0xE800 // 232 #define NB_INTERFACE 6 #define CONF_NB 1 #define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED -#define MAX_POWER 50 /* 100 mA */ +#define MAX_POWER 50 /* 100 mA */ #define LANG_ID 0x00 #define LANGUAGE_ID 0x0904 @@ -100,8 +93,8 @@ #define TX_EP 1 #define TX_EP_SIZE 32 +/* STRING INDEX */ -/* STRING INDEX */ /*******************************************/ #define MAN_STRING_INDEX 1 @@ -109,7 +102,6 @@ #define SN_STRING_INDEX 3 #define CONFIG_STRING_INDEX 4 - #define USB_MANUFACTURER_NAME {'K'<<8, 'y'<<8, 's'<<8, 'o'<<8, 'h'<<8} #define USB_MN_LENGTH 5 @@ -120,7 +112,6 @@ #define USB_SERIAL_NUMBER {'1'<<8, '0'<<8, '0'<<8, '0'<<8, '1'<<8} #define USB_SN_LENGTH 5 - #define USB_CONFIG_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} #define USB_CONFIG_LENGTH 9 @@ -130,5 +121,4 @@ /*_____ D E C L A R A T I O N ______________________________________________*/ - #endif /* _CONFIG_H_ */ Modified: firmware/fuxusb/trunk/global.c =================================================================== --- firmware/fuxusb/trunk/global.c 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/global.c 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /*C************************************************************************** * NAME: global.c *---------------------------------------------------------------------------- @@ -11,7 +12,7 @@ * $Id$ *****************************************************************************/ -#include "global.h" +#include "global.h" #include "version.h" @@ -21,31 +22,31 @@ /*_____ D E C L A R A T I O N ______________________________________________*/ - //------------------------------------------------------- // SPI Controler //------------------------------------------------------- -bit spi_task_on_Flag; // = 1; // to turn ON the RF Task - // = 0; // to turn OFF the RF Task +bit spi_task_on_Flag; // = 1; // to turn ON the RF Task + // = 0; // to turn OFF the RF Task + //------------------------------------------------------- // USB Controler //------------------------------------------------------- -unsigned int usb_sof_counter; -unsigned char usb_configuration_nb; -bit usb_connected_Flag; +unsigned int usb_sof_counter; +unsigned char usb_configuration_nb; +bit usb_connected_Flag; -bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint -char CMD_IN_Bank_Nb; +bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint +char CMD_IN_Bank_Nb; -bit USB_ParserProcess_Permit_Flag; +bit USB_ParserProcess_Permit_Flag; //------------------------------------------------------- // I2C Controler //------------------------------------------------------- -unsigned char i2c_wait_counter = 0; -bit i2c_task_on_Flag; +unsigned char i2c_wait_counter = 0; +bit i2c_task_on_Flag; //------------------------------------------------------- // RF Controler @@ -60,14 +61,14 @@ //------------------------------------------------------- -bit RF_OFFLine_Back; +bit RF_OFFLine_Back; unsigned char RF_Status; -unsigned char RF_Status_Temp; +unsigned char RF_Status_Temp; -bit RF_ToConnect_Flag; -unsigned char RF_Connection_Status; -unsigned char RF_InitFrame[22]; -unsigned int spi_watchdog_ctr; +bit RF_ToConnect_Flag; +unsigned char RF_Connection_Status; +unsigned char RF_InitFrame[22]; +unsigned int spi_watchdog_ctr; //------------------------------------------------------- // Tux Command and Status @@ -75,25 +76,21 @@ unsigned char Tux_ID[2]; unsigned char Tux_NewID[2]; -bit Tux_RequestingID_Flag; -bit Tux_ChangingID_Flag; +bit Tux_RequestingID_Flag; +bit Tux_ChangingID_Flag; + // From USB + //------------------------------------------------------- +unsigned char USBCommand_ForDongle[65]; // For Dongle +unsigned char USBCommand_ForRF[65]; // For RF +unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB +bit USBCommand_NewRequest_Flag; +unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C - - // From USB - //------------------------------------------------------- -unsigned char USBCommand_ForDongle[65]; // For Dongle -unsigned char USBCommand_ForRF[65]; // For RF -unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB -bit USBCommand_NewRequest_Flag; -unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C - - //------------------------------------------------------- // Dongle Info //------------------------------------------------------- -code version_t info_version ={VERSION_CMD,VER_MAJOR,VER_MINOR,VER_UPDATE}; -code revision_t info_revision={REVISION_CMD,REVISION_NUMBER,0}; -code author_t info_author={AUTHOR_CMD,AUTHOR_ID,0}; - +code version_t info_version = { VERSION_CMD, VER_MAJOR, VER_MINOR, VER_UPDATE }; +code revision_t info_revision = { REVISION_CMD, REVISION_NUMBER, 0 }; +code author_t info_author = { AUTHOR_CMD, AUTHOR_ID, 0 }; Modified: firmware/fuxusb/trunk/global.h =================================================================== --- firmware/fuxusb/trunk/global.h 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/global.h 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /*C************************************************************************** * NAME: global.h *---------------------------------------------------------------------------- @@ -10,8 +11,6 @@ * *****************************************************************************/ - - #ifndef _GLOBAL_H_ #define _GLOBAL_H_ @@ -25,37 +24,38 @@ #define rf_reset_signal P0_1 #define RF_OFFLINE P2_3 - /*_____ D E C L A R A T I O N ______________________________________________*/ -extern unsigned int Sleep_Ctr; +extern unsigned int Sleep_Ctr; + //------------------------------------------------------- // SPI Controler //------------------------------------------------------- -extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task - // = 0; // to turn OFF the RF Task -extern unsigned int spi_watchdog_ctr; -#define SPI_WATCHDOG_MAX (6000) +extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task + // = 0; // to turn OFF the RF Task +extern unsigned int spi_watchdog_ctr; +#define SPI_WATCHDOG_MAX (6000) + //------------------------------------------------------- // USB Controler //------------------------------------------------------- -extern unsigned int usb_sof_counter; -extern unsigned char usb_configuration_nb; -extern bit usb_connected_Flag; +extern unsigned int usb_sof_counter; +extern unsigned char usb_configuration_nb; +extern bit usb_connected_Flag; -extern bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint -extern char CMD_IN_Bank_Nb; +extern bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint +extern char CMD_IN_Bank_Nb; -extern bit USB_ParserProcess_Permit_Flag; +extern bit USB_ParserProcess_Permit_Flag; //------------------------------------------------------- // I2C Controler //------------------------------------------------------- extern unsigned char i2c_wait_counter; -extern bit i2c_task_on_Flag; +extern bit i2c_task_on_Flag; //------------------------------------------------------- // RF Controler @@ -70,50 +70,46 @@ //------------------------------------------------------- -extern bit RF_OFFLine_Back; +extern bit RF_OFFLine_Back; extern unsigned char RF_Status; -extern unsigned char RF_Status_Temp; -extern bit RF_ToConnect_Flag; -extern unsigned char RF_InitFrame[]; -extern unsigned char RF_Connection_Status; +extern unsigned char RF_Status_Temp; +extern bit RF_ToConnect_Flag; +extern unsigned char RF_InitFrame[]; +extern unsigned char RF_Connection_Status; - #define RF_DISCONNECTED 0 - #define RF_TO_CONNECT 1 - #define RF_REQUEST_ID 2 - #define RF_CHANGE_ID 3 - #define RF_CONNECTED 4 +#define RF_DISCONNECTED 0 +#define RF_TO_CONNECT 1 +#define RF_REQUEST_ID 2 +#define RF_CHANGE_ID 3 +#define RF_CONNECTED 4 //------------------------------------------------------- // Tux Command and Status //------------------------------------------------------- extern unsigned char Tux_ID[]; extern unsigned char Tux_NewID[]; -extern bit Tux_RequestingID_Flag; -extern bit Tux_ChangingID_Flag; +extern bit Tux_RequestingID_Flag; +extern bit Tux_ChangingID_Flag; - - // From USB - //------------------------------------------------------- -extern unsigned char USBCommand_ForRF[]; // Store the USB Command -extern unsigned char USBCommand_ForDongle[]; // For Dongle -extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB + // From USB + //------------------------------------------------------- +extern unsigned char USBCommand_ForRF[]; // Store the USB Command +extern unsigned char USBCommand_ForDongle[]; // For Dongle +extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB -extern bit USBCommand_NewRequest_Flag; -extern unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C +extern bit USBCommand_NewRequest_Flag; +extern unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C - - #define LIBUSB_TUX_CMD_HDR 0 - #define LIBUSB_DONGLE_CMD_HDR 1 - #define LIBUSB_BOOTLOADER_CMD_HDR 2 +#define LIBUSB_TUX_CMD_HDR 0 +#define LIBUSB_DONGLE_CMD_HDR 1 +#define LIBUSB_BOOTLOADER_CMD_HDR 2 - - //------------------------------------------------------- // Dongle Info //------------------------------------------------------- -extern code version_t info_version; -extern code revision_t info_revision; -extern code author_t info_author; +extern code version_t info_version; +extern code revision_t info_revision; +extern code author_t info_author; #endif /* _GLOBAL_H_ */ Modified: firmware/fuxusb/trunk/i2c.c =================================================================== --- firmware/fuxusb/trunk/i2c.c 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/i2c.c 2007-10-02 21:03:04 UTC (rev 576) @@ -10,23 +10,29 @@ /* I2C status and address variables */ uint8_t i2cDeviceAddrRW; volatile I2C_FLAGS i2cFlags; + /* send/transmit buffer (outgoing data) */ uint8_t xdata i2cSendData[I2C_SEND_DATA_BUFFER_SIZE]; uint8_t *i2cDataToSend; uint8_t i2cSendDataIndex; uint8_t i2cSendDataLength; + /* receive buffer (incoming data) */ uint8_t xdata i2cReceiveData[I2C_RECEIVE_DATA_BUFFER_SIZE]; uint8_t i2cReceiveDataIndex; uint8_t i2cReceiveDataLength; /* function pointer to i2c receive routine */ + /* I2cSlaveReceive is called when this processor is addressed as a slave for * writing */ -static void (*i2cSlaveReceive)(uint8_t receiveDataLength, uint8_t* recieveData); +static void (*i2cSlaveReceive) (uint8_t receiveDataLength, + uint8_t * recieveData); + /* I2cSlaveTransmit is called when this processor is addressed as a slave for * reading */ -static uint8_t (*i2cSlaveTransmit)(uint8_t transmitDataLengthMax, uint8_t* transmitData); +static uint8_t(*i2cSlaveTransmit) (uint8_t transmitDataLengthMax, + uint8_t * transmitData); /* functions */ @@ -36,7 +42,7 @@ void i2cSetBitrate(void) { /* Setting SSCON based on TWI_SCAL defined in i2c.h */ - SSCON = TWI_SCAL_VALUE; /* twi intialisation */ + SSCON = TWI_SCAL_VALUE; /* twi intialisation */ } /* @@ -49,18 +55,18 @@ void i2cInit(void) { /* Set up twi */ - SSCON = TWI_SSIE | TWI_SCAL_VALUE; /* enable TWI */ + SSCON = TWI_SSIE | TWI_SCAL_VALUE; /* enable TWI */ #ifdef TWI_INT_ENABLED Enable_twi_interrupt(); #endif -#ifdef TWI_SLA_ENABLED /* If Slave mode: */ +#ifdef TWI_SLA_ENABLED /* If Slave mode: */ /* Set local device address (used in slave mode only) */ SSADR = I2C_SLA_ADD; /* Enabling Slave mode */ - TWI_SET_AA(); /* enable TWI ACK */ - i2cSlaveReceive = 0; /* XXX do we need those 2 lines? clear SlaveReceive and SlaveTransmit handler to null */ + TWI_SET_AA(); /* enable TWI ACK */ + i2cSlaveReceive = 0; /* XXX do we need those 2 lines? clear SlaveReceive and SlaveTransmit handler to null */ i2cSlaveTransmit = 0; #endif @@ -69,23 +75,29 @@ } /* Set the user function which handles receiving (incoming) data as a slave */ -void i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func)(uint8_t receiveDataLength, uint8_t* recieveData)) +void +i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func) + (uint8_t receiveDataLength, uint8_t * recieveData)) { i2cSlaveReceive = i2cSlaveRx_func; } /* Set the user function which handles transmitting (outgoing) data as a slave */ -void i2cSetSlaveTransmitHandler(uint8_t (*i2cSlaveTx_func)(uint8_t transmitDataLengthMax, uint8_t* transmitData)) +void +i2cSetSlaveTransmitHandler(uint8_t(*i2cSlaveTx_func) + (uint8_t transmitDataLengthMax, + uint8_t * transmitData)) { i2cSlaveTransmit = i2cSlaveTx_func; } void i2cSendStart(void); + /* Start a Master transmission, i2cSendDataIndex is reset automatically here */ void i2cMasterStart(void) { i2cFlags.i2c_busy = 1; - i2cSendDataIndex = 0; /* don't forget to reset the index */ + i2cSendDataIndex = 0; /* don't forget to reset the index */ i2cSendStart(); } @@ -127,175 +139,175 @@ } #ifdef __debug__ -uint8_t i2cStatus[20]; /* debug only */ +uint8_t i2cStatus[20]; /* debug only */ uint8_t i2cStatusIdx = 0; #endif /* TWI interrupt service routine */ #ifdef TWI_INT_ENABLED -void it_TWI(void) interrupt IRQ_TWI using 1 -{ +void it_TWI(void) + interrupt IRQ_TWI using 1 + { #ifdef __debug__ - i2cStatus[i2cStatusIdx++] = TW_STATUS; - if (i2cStatusIdx == 20) i2cStatusIdx = 0; + i2cStatus[i2cStatusIdx++] = TW_STATUS; + if (i2cStatusIdx == 20) + i2cStatusIdx = 0; #endif - - switch (TW_STATUS) - { - /* * * Master General * * */ - case TW_START: // 0x08: Sent start condition - case TW_REP_START: // 0x10: Sent repeated start condition + switch (TW_STATUS) + { + /* * * Master General * * */ + case TW_START: // 0x08: Sent start condition + case TW_REP_START: // 0x10: Sent repeated start condition #if I2C_DEBUG #endif - // send device address - TWI_CLEAR_START(); /* clear start condition */ - i2cSendByte(i2cDeviceAddrRW); - break; + // send device address + TWI_CLEAR_START(); /* clear start condition */ + i2cSendByte(i2cDeviceAddrRW); + break; + /* * * Master Transmitter & Receiver status codes * * */ - /* * * Master Transmitter & Receiver status codes * * */ - - case TW_MT_SLA_ACK: // 0x18: Slave address acknowledged - case TW_MT_DATA_ACK: // 0x28: Data acknowledged + case TW_MT_SLA_ACK: // 0x18: Slave address acknowledged + case TW_MT_DATA_ACK: // 0x28: Data acknowledged #if I2C_DEBUG #endif - if(i2cSendDataIndex < i2cSendDataLength) - { + if (i2cSendDataIndex < i2cSendDataLength) + { - i2cSendByte( i2cSendData[i2cSendDataIndex++] ); /* send data */ - } - else - { - i2cSendStop(); /* End of data stream */ - i2cFlags.s_val = 1; - } - break; - case TW_MR_DATA_NACK: // 0x58: Data received, NACK reply issued + i2cSendByte(i2cSendData[i2cSendDataIndex++]); /* send data */ + } + else + { + i2cSendStop(); /* End of data stream */ + i2cFlags.s_val = 1; + } + break; + case TW_MR_DATA_NACK: // 0x58: Data received, NACK reply issued #if I2C_DEBUG #endif - i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; // store final received data byte - /* no break, continue to transmit STOP condition */ - case TW_MR_SLA_NACK: // 0x48: Slave address not acknowledged - case TW_MT_SLA_NACK: // 0x20: Slave address not acknowledged - case TW_MT_DATA_NACK: // 0x30: Data not acknowledged + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; // store final received data byte + /* no break, continue to transmit STOP condition */ + case TW_MR_SLA_NACK: // 0x48: Slave address not acknowledged + case TW_MT_SLA_NACK: // 0x20: Slave address not acknowledged + case TW_MT_DATA_NACK: // 0x30: Data not acknowledged #if I2C_DEBUG #endif - i2cFlags.mt_nack = 1; - i2cSendStop(); - break; - case TW_MT_ARB_LOST: // 0x38: Bus arbitration lost - //case TW_MR_ARB_LOST: // 0x38: Bus arbitration lost + i2cFlags.mt_nack = 1; + i2cSendStop(); + break; + case TW_MT_ARB_LOST: // 0x38: Bus arbitration lost + //case TW_MR_ARB_LOST: // 0x38: Bus arbitration lost #if I2C_DEBUG #endif - i2cInit(); - break; - case TW_MR_DATA_ACK: // 0x50: Data acknowledged + i2cInit(); + break; + case TW_MR_DATA_ACK: // 0x50: Data acknowledged #if I2C_DEBUG #endif - // store received data byte - i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; - // fall-through to see if more bytes will be received - case TW_MR_SLA_ACK: // 0x40: Slave address acknowledged + // store received data byte + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; + // fall-through to see if more bytes will be received + case TW_MR_SLA_ACK: // 0x40: Slave address acknowledged #if I2C_DEBUG #endif - if(i2cReceiveDataIndex < (i2cReceiveDataLength-1)) - i2cAckReceiveByte(); /* receive more bytes */ - else - i2cNackReceiveByte(); /* receive the last byte */ - break; + if (i2cReceiveDataIndex < (i2cReceiveDataLength - 1)) + i2cAckReceiveByte(); /* receive more bytes */ + else + i2cNackReceiveByte(); /* receive the last byte */ + break; + /* * * Slave Receiver status codes * * */ - /* * * Slave Receiver status codes * * */ - - case TW_SR_SLA_ACK: // 0x60: own SLA+W has been received, ACK has been returned - case TW_SR_ARB_LOST_SLA_ACK: // 0x68: own SLA+W has been received, ACK has been returned - case TW_SR_GCALL_ACK: // 0x70: GCA+W has been received, ACK has been returned - case TW_SR_ARB_LOST_GCALL_ACK: // 0x78: GCA+W has been received, ACK has been returned + case TW_SR_SLA_ACK: // 0x60: own SLA+W has been received, ACK has been returned + case TW_SR_ARB_LOST_SLA_ACK: // 0x68: own SLA+W has been received, ACK has been returned + case TW_SR_GCALL_ACK: // 0x70: GCA+W has been received, ACK has been returned + case TW_SR_ARB_LOST_GCALL_ACK: // 0x78: GCA+W has been received, ACK has been returned #if I2C_DEBUG #endif - /* we are being addressed as slave for writing (data will be received from master) */ - i2cFlags.i2c_busy = 1; - i2cReceiveDataIndex = 0; - i2cFlags.s_nack = 0; /* reset nack flag here, not in user app */ - i2cAckReceiveByte(); /* accept data */ - break; - case TW_SR_DATA_ACK: // 0x80: data byte has been received, ACK has been returned - case TW_SR_GCALL_DATA_ACK: // 0x90: data byte has been received, ACK has been returned + /* we are being addressed as slave for writing (data will be received from master) */ + i2cFlags.i2c_busy = 1; + i2cReceiveDataIndex = 0; + i2cFlags.s_nack = 0; /* reset nack flag here, not in user app */ + i2cAckReceiveByte(); /* accept data */ + break; + case TW_SR_DATA_ACK: // 0x80: data byte has been received, ACK has been returned + case TW_SR_GCALL_DATA_ACK: // 0x90: data byte has been received, ACK has been returned #if I2C_DEBUG #endif - i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* get received data byte */ - /* check receive buffer status */ - if(i2cReceiveDataIndex < I2C_RECEIVE_DATA_BUFFER_SIZE) - { - i2cAckReceiveByte(); /* accept more data */ - } - else - { - i2cNackReceiveByte(); /* refuse more data */ - } - break; - case TW_SR_DATA_NACK: // 0x88: data byte has been received, NACK has been returned - case TW_SR_GCALL_DATA_NACK: // 0x98: data byte has been received, NACK has been returned + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* get received data byte */ + /* check receive buffer status */ + if (i2cReceiveDataIndex < I2C_RECEIVE_DATA_BUFFER_SIZE) + { + i2cAckReceiveByte(); /* accept more data */ + } + else + { + i2cNackReceiveByte(); /* refuse more data */ + } + break; + case TW_SR_DATA_NACK: // 0x88: data byte has been received, NACK has been returned + case TW_SR_GCALL_DATA_NACK: // 0x98: data byte has been received, NACK has been returned #if I2C_DEBUG #endif - //i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* receive last byte XXX check if this is right */ - //i2cNackReceiveByte(); //XXX bug here? // receive data byte and return NACK - //i2cAckReceiveByte(); [> I should clear the interrupt and enable acknoledge for slave mode (disabled during previous nack) <] - i2cFlags.s_nack = 1; /* XXX check if this flag is reset in all possible conditions */ - //break; - /* pass along to restart slave mode */ - case TW_SR_STOP: // 0xA0: STOP or REPEATED START has been received while addressed as slave + //i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* receive last byte XXX check if this is right */ + //i2cNackReceiveByte(); //XXX bug here? // receive data byte and return NACK + //i2cAckReceiveByte(); [> I should clear the interrupt and enable acknoledge for slave mode (disabled during previous nack) <] + i2cFlags.s_nack = 1; /* XXX check if this flag is reset in all possible conditions */ + //break; + /* pass along to restart slave mode */ + case TW_SR_STOP: // 0xA0: STOP or REPEATED START has been received while addressed as slave #if I2C_DEBUG #endif - i2cInit(); /* enable TWI ACK */ - if(i2cSlaveReceive) i2cSlaveReceive(i2cReceiveDataIndex, i2cReceiveData); /* i2c receive is complete, call i2cSlaveReceive */ - i2cFlags.i2c_busy = 0; /* XXX check if this flag is reset in all possible conditions */ - break; + i2cInit(); /* enable TWI ACK */ + if (i2cSlaveReceive) + i2cSlaveReceive(i2cReceiveDataIndex, i2cReceiveData); /* i2c receive is complete, call i2cSlaveReceive */ + i2cFlags.i2c_busy = 0; /* XXX check if this flag is reset in all possible conditions */ + break; + /* * * Slave Transmitter * * */ - /* * * Slave Transmitter * * */ - - case TW_ST_SLA_ACK: // 0xA8: own SLA+R has been received, ACK has been returned - case TW_ST_ARB_LOST_SLA_ACK: // 0xB0: GCA+R has been received, ACK has been returned + case TW_ST_SLA_ACK: // 0xA8: own SLA+R has been received, ACK has been returned + case TW_ST_ARB_LOST_SLA_ACK: // 0xB0: GCA+R has been received, ACK has been returned #if I2C_DEBUG #endif - // we are being addressed as slave for reading (data must be transmitted back to master) - // request data from application - if(i2cSlaveTransmit) i2cSendDataLength = i2cSlaveTransmit(I2C_SEND_DATA_BUFFER_SIZE, i2cSendData); - i2cSendDataIndex = 0; /* reset data index */ - /* fall-through to transmit first data byte */ - case TW_ST_DATA_ACK: // 0xB8: data byte has been transmitted, ACK has been received + // we are being addressed as slave for reading (data must be transmitted back to master) + // request data from application + if (i2cSlaveTransmit) + i2cSendDataLength = + i2cSlaveTransmit(I2C_SEND_DATA_BUFFER_SIZE, i2cSendData); + i2cSendDataIndex = 0; /* reset data index */ + /* fall-through to transmit first data byte */ + case TW_ST_DATA_ACK: // 0xB8: data byte has been transmitted, ACK has been received #if I2C_DEBUG #endif - TW_DATA = i2cSendData[i2cSendDataIndex++]; /* transmit data byte */ - if(i2cSendDataIndex < i2cSendDataLength) - i2cAckReceiveByte(); /* expect ACK to data byte */ - else - i2cNackReceiveByte(); /* expect NACK to data byte */ - break; - case TW_ST_DATA_NACK: // 0xC0: data byte has been transmitted, NACK has been received - case TW_ST_LAST_DATA: // 0xC8: last data byte transmitted, ACK received + TW_DATA = i2cSendData[i2cSendDataIndex++]; /* transmit data byte */ + if (i2cSendDataIndex < i2cSendDataLength) + i2cAckReceiveByte(); /* expect ACK to data byte */ + else + i2cNackReceiveByte(); /* expect NACK to data byte */ + break; + case TW_ST_DATA_NACK: // 0xC0: data byte has been transmitted, NACK has been received + case TW_ST_LAST_DATA: // 0xC8: last data byte transmitted, ACK received #if I2C_DEBUG #endif - /* all done, switch to open slave */ - i2cInit(); /* enable TWI ACK */ - break; + /* all done, switch to open slave */ + i2cInit(); /* enable TWI ACK */ + break; + /* * * Misc * * */ - /* * * Misc * * */ - - case TW_NO_INFO: // 0xF8: No relevant state information - /* do nothing */ + case TW_NO_INFO: // 0xF8: No relevant state information + /* do nothing */ #if I2C_DEBUG #endif - break; - case TW_BUS_ERROR: // 0x00: Bus error due to illegal start or stop condition + break; + case TW_BUS_ERROR: // 0x00: Bus error due to illegal start or stop condition #if I2C_DEBUG #endif - i2cSendStop(); /* reset internal hardware and release bus */ - break; - } - TWI_CLEAR_SI(); -} + i2cSendStop(); /* reset internal hardware and release bus */ + break; + } + TWI_CLEAR_SI(); + } #endif Modified: firmware/fuxusb/trunk/i2c.h =================================================================== --- firmware/fuxusb/trunk/i2c.h 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/i2c.h 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /* * Copyright (c) 2006, C2ME S.A. * All rights reserved. @@ -2,3 +3,3 @@ * - * $Id:$ + * $Id$ */ @@ -13,7 +14,7 @@ #include "config.h" #ifdef __debug__ -extern uint8_t i2cStatus[20]; /* XXX debug only */ +extern uint8_t i2cStatus[20]; /* XXX debug only */ extern uint8_t i2cStatusIdx; #endif @@ -26,14 +27,14 @@ * Choose operation mode, comment/uncomment lines * For Slave only operation, choose Master and Slave */ -#define TWI_INT_ENABLED /* comment if you don't want twi interrupts */ -#define TWI_M_ENABLED /* comment if you don't want twi master mode */ +#define TWI_INT_ENABLED /* comment if you don't want twi interrupts */ +#define TWI_M_ENABLED /* comment if you don't want twi master mode */ //#define TWI_SLA_ENABLED /* comment if you don't want twi slave mode */ /* SSADR: TWI (Slave) Address Register * Bits 7..1 : TWI (Slave) Address Register * Bit 0 : TWI General Call Recognition Enable Bit */ -#define I2C_SLA_ADD ((0X55<<1) | 0x01) /* Only necessary in slave mode */ +#define I2C_SLA_ADD ((0X55<<1) | 0x01) /* Only necessary in slave mode */ /* * Initialise TWI clock @@ -45,7 +46,7 @@ */ //#define TWI_SCAL 160 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ -#define TWI_SCAL 960 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ +#define TWI_SCAL 960 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ /* * * END of code customisation * * */ @@ -77,13 +78,13 @@ */ typedef struct { - uint8_t i2c_busy: 1; /* set when twi hardware is busy, cleared after an i2c stop */ - uint8_t mt_nack: 1; /* error due to a nack received by the master transmitter */ - uint8_t s_nack: 1; /* error due to a nack replied by the slave */ - uint8_t sr_end: 1; /* set at the end of a receiver slave transmission if i2cSlaveReceive has not been defined */ - uint8_t st_end: 1; /* set at the end of a transmitter slave transmission if i2cSlaveTransmit has not been defined */ - uint8_t i2c_idx: 1; /* application side - can be used for data indexes status */ - uint8_t s_val: 1; /* application side - can be used for data validation */ + uint8_t i2c_busy:1; /* set when twi hardware is busy, cleared after an i2c stop */ + uint8_t mt_nack:1; /* error due to a nack received by the master transmitter */ + uint8_t s_nack:1; /* error due to a nack replied by the slave */ + uint8_t sr_end:1; /* set at the end of a receiver slave transmission if i2cSlaveReceive has not been defined */ + uint8_t st_end:1; /* set at the end of a transmitter slave transmission if i2cSlaveTransmit has not been defined */ + uint8_t i2c_idx:1; /* application side - can be used for data indexes status */ + uint8_t s_val:1; /* application side - can be used for data validation */ } I2C_FLAGS; extern volatile I2C_FLAGS i2cFlags; @@ -98,10 +99,12 @@ /* I2C state and address variables */ extern uint8_t i2cDeviceAddrRW; + /* send/transmit buffer (outgoing data) */ extern uint8_t xdata i2cSendData[]; extern uint8_t i2cSendDataIndex; extern uint8_t i2cSendDataLength; + /* receive buffer (incoming data) */ extern uint8_t xdata i2cReceiveData[]; extern uint8_t i2cReceiveDataIndex; @@ -110,9 +113,13 @@ /* Functions */ void i2cSetBitrate(void); void i2cInit(void); -void i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func)(uint8_t receiveDataLength, uint8_t* recieveData)); -void i2cSetSlaveTransmitHandler(uint8_t (*i2cSlaveTx_func)(uint8_t transmitDataLengthMax, uint8_t* transmitData)); +void +i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func) + (uint8_t receiveDataLength, uint8_t * recieveData)); +void +i2cSetSlaveTransmitHandler(uint8_t(*i2cSlaveTx_func) + (uint8_t transmitDataLengthMax, + uint8_t * transmitData)); void i2cMasterStart(void); #endif - Modified: firmware/fuxusb/trunk/main.c =================================================================== --- firmware/fuxusb/trunk/main.c 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/main.c 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /*C************************************************************************** * NAME: main.c *---------------------------------------------------------------------------- @@ -13,7 +14,6 @@ /*_____ I N C L U D E S ____________________________________________________*/ - #include "config.h" #include "lib_c/stdint.h" #include "global.h" @@ -24,9 +24,8 @@ #include "modules\fifo\fifo_mic.h" #include "modules\fifo_stt\fifo_stt.h" -char code reserve [3] _at_ 0x23; /* for Monitor-51 serial interrupt */ +char code reserve[3] _at_ 0x23; /* for Monitor-51 serial interrupt */ - /*_____ G L O B A L S ________________________________________________________*/ /*_____ M A C R O S ________________________________________________________*/ @@ -49,7 +48,7 @@ *---------------------------------------------------------------------------- * REQUIREMENTS: *****************************************************************************/ -void main (void) +void main(void) { /* RF is disabled when this signal is low and is reset when going from * 0 to 1. @@ -57,21 +56,20 @@ * It is set when USB receives SET_CONGIGURATION command during * enumeration. RF is also disabled during bootload. */ rf_reset_signal = 0; // Maintains the RF in RESET STATE until the USB has received the Command to connect RF - // Go to 0 in usb_set_configuration() + // Go to 0 in usb_set_configuration() // Stay Low During the I2C communication - RF_OFFLINE = 1; // Set Port to able to Read the Input Signal + RF_OFFLINE = 1; // Set Port to able to Read the Input Signal - Set_x2_mode(); Enable_interrupt(); - usb_task_init(); + usb_task_init(); #ifdef MAIN_DEBUG - uart_init(); + uart_init(); printf("= TUX started ==\n"); #endif - while(1) + while (1) usb_task(); } Modified: firmware/fuxusb/trunk/version.h =================================================================== --- firmware/fuxusb/trunk/version.h 2007-10-02 18:09:47 UTC (rev 575) +++ firmware/fuxusb/trunk/version.h 2007-10-02 21:03:04 UTC (rev 576) @@ -1,3 +1,4 @@ + /* KySoH iTux agent * * Behavioural source code @@ -17,9 +18,7 @@ #define VER_MINOR 2 #define VER_UPDATE 0 -#define AUTHOR_ID 0 /* official release */ -#define REVISION_NUMBER 0xFFEE /* XXX find a way to define this automatically in the Makefile from SVN */ +#define AUTHOR_ID 0 /* official release */ +#define REVISION_NUMBER 0xFFEE /* XXX find a way to define this automatically in the Makefile from SVN */ #endif /* _VERSION_H_ */ - - |
From: jaguarondi <c2m...@c2...> - 2007-10-02 18:09:51
|
Author: jaguarondi Date: 2007-10-02 20:09:47 +0200 (Tue, 02 Oct 2007) New Revision: 575 Modified: firmware/fuxusb/trunk/config.h firmware/fuxusb/trunk/modules/usb/usb_task.c Log: * Further improved debug messages of the USB commands. Modified: firmware/fuxusb/trunk/config.h =================================================================== --- firmware/fuxusb/trunk/config.h 2007-10-02 16:50:42 UTC (rev 574) +++ firmware/fuxusb/trunk/config.h 2007-10-02 18:09:47 UTC (rev 575) @@ -26,11 +26,15 @@ /*_____ M A C R O S ________________________________________________________*/ +/* + * Debugging configuration + */ //#define USB_ENUM_DEBUG //#define MAIN_DEBUG //#define USB_TASK_DEBUG //#define BOOTLOAD_DEBUG //#define USB_CMD_DEBUG +#define VERBOSE 0 #define DEBUG_1 P3_6 #define DEBUG_2 P4_0 Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c =================================================================== --- firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 16:50:42 UTC (rev 574) +++ firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 18:09:47 UTC (rev 575) @@ -119,8 +119,9 @@ if (status_requested && FifoIn_STT_Idx && !tx_data_ready) { #ifdef USB_CMD_DEBUG - printf("Stacking %Bu data from status on USB fifo.\n", - FifoIn_STT_Idx); + if (VERBOSE) + printf("Stacking %Bu data from status on USB fifo.\n", + FifoIn_STT_Idx); #endif //Led_0_off(); Usb_select_ep(EP_CMD_IN); @@ -431,7 +432,7 @@ else { #ifdef USB_CMD_DEBUG - if(Usb_rx_complete()) + if(VERBOSE && Usb_rx_complete()) printf("LOOP: interrupt flags: %Bx\n", Usb_rx_complete()); #endif //-------------------------------------------------------------------------- @@ -491,7 +492,7 @@ if (tx_data_ready == 1) { #ifdef USB_CMD_DEBUG - printf ("USB: Status ready to be sent.\n"); + if (VERBOSE) printf ("USB: Status ready to be sent.\n"); #endif tx_data_ready = 2; Usb_select_ep(EP_CMD_IN); @@ -626,7 +627,7 @@ if(Usb_tx_complete()) { #ifdef USB_CMD_DEBUG - printf ("USB: Status sent.\n"); + if (VERBOSE) printf ("USB: Status sent.\n"); #endif Usb_clear_tx_complete(); tx_data_ready = 0; @@ -739,8 +740,8 @@ { Usb_select_ep(EP_CMD_OUT); #ifdef USB_CMD_DEBUG - printf("Event on EP_CMD_OUT, data received:\n"); - printf("EP_CMD_OUT interrupt flags: %Bx\n", Usb_rx_complete()); + if (VERBOSE) + printf("EP_CMD_OUT: new event, flags: %Bx\n", Usb_rx_complete()); #endif if(Usb_rx_complete()) { @@ -750,7 +751,8 @@ { USBCommand_Header = Usb_read_byte(); // Read the Header #ifdef USB_CMD_DEBUG - printf("EP_CMD_OUT processing %Bd data.\n", USBCommand_Ctr); + if (VERBOSE) + printf("EP_CMD_OUT: now processing %Bd bytes.\n", USBCommand_Ctr); #endif //-------------------------------------------------------------------------- @@ -789,21 +791,26 @@ //-------------------------------------------------------------------------- else if(USBCommand_Header == LIBUSB_DONGLE_CMD_HDR) { + for(i=0;i<(USBCommand_Ctr-1);i++) + { + USBCommand_ForDongle[i] = Usb_read_byte(); + } #ifdef USB_CMD_DEBUG - printf("DONGLE command "); + if (VERBOSE || !((USBCommand_ForDongle[0] == 1) && + (USBCommand_ForDongle[1] == 0) && + (USBCommand_ForDongle[2] == 0) && + (USBCommand_ForDongle[3] == 0))) + { + printf("DONGLE command "); + for(i=0;i<(USBCommand_Ctr-1);i++) + { + printf("%BX ",USBCommand_ForDongle[i]); + } + printf("\n"); + } #endif - for(i=0;i<(USBCommand_Ctr-1);i++) - { - USBCommand_ForDongle[i] = Usb_read_byte(); -#ifdef USB_CMD_DEBUG - printf("%BX ",USBCommand_ForDongle[i]); -#endif - } -#ifdef USB_CMD_DEBUG - printf("\n"); -#endif - usb_command_parser(); - } + usb_command_parser(); + } //-------------------------------------------------------------------------- // // BOOTLOADER HEADER received @@ -812,7 +819,7 @@ else if(USBCommand_Header == LIBUSB_BOOTLOADER_CMD_HDR) { #ifdef USB_CMD_DEBUG - printf("BOOTLOADER command\n"); + printf("BOOTLOADER command: "); #endif i2c_bootloading_Flag = 1; //printf ("LIBUSB_BOOTLOADER_CMD_HDR \n"); @@ -821,7 +828,7 @@ if (Command_FromUSB_bootload_cmd == BOOT_INIT) /* initialize a new page programming */ { #ifdef BOOTLOAD_DEBUG - printf ("\nBOOT_INIT\n"); + printf ("BOOT_INIT\n"); #endif rf_reset_signal = 0; /* disables the RF module */ SPI_CSn = 0; /* clear CS to enter bootloader mode */ @@ -904,24 +911,26 @@ /* TODO add an error return function on the USB */ } } - Usb_select_ep(EP_CMD_OUT); /* release the bank */ - if(CMD_OUT_usb_Bank==0) - { - if (Usb_rx_bank0_complete()) - Usb_clear_rx_bank0(); - } - else if(CMD_OUT_usb_Bank) - { - if(Usb_rx_bank1_complete()) + /* Release the bank */ + /* XXX there's a bug here when the USB will + * desynchronise with CMD_OUT_usb_Bank. I don't know + * how to achieve that but it's possible and I already + * saw it. */ + //Usb_select_ep(EP_CMD_OUT); + if(CMD_OUT_usb_Bank == 0) + //if (Usb_rx_bank0_complete()) + Usb_clear_rx_bank0(); + else + //if(Usb_rx_bank1_complete()) Usb_clear_rx_bank1(); - } CMD_OUT_usb_Bank ^=1; } } #ifdef USB_CMD_DEBUG else - printf("ERROR: got EP OUT event but Usb_rx_complete returns false.\n"); - printf("END of EP_CMD_OUT, interrupt flags: %Bx\n", Usb_rx_complete()); + printf("ERROR: got EP OUT event but Usb_rx_complete returns False.\n"); + if (VERBOSE) + printf("END of EP_CMD_OUT, interrupt flags: %Bx\n", Usb_rx_complete()); #endif } /* if(Usb_test_it_ep(EP_CMD_OUT)) */ } /* if(Usb_endpoint_interrupt()) */ |
From: jaguarondi <c2m...@c2...> - 2007-10-02 16:53:04
|
Author: jaguarondi Date: 2007-10-02 18:42:39 +0200 (Tue, 02 Oct 2007) New Revision: 573 Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c Log: * BUG: Usb_set_tx_ready() could be called multiple times before the data was actually sent. We now use 3 states for 0:'data sent or no data', 1:'data ready to be sent', 2:'USB busy sending data'. Now bootloading works again. Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c =================================================================== --- firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 15:11:15 UTC (rev 572) +++ firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 16:42:39 UTC (rev 573) @@ -35,7 +35,7 @@ * Used to flush the status buffer on the USB. */ bit status_requested; -bit CMDIN_ToSend_Flag = 0; +uint8_t tx_data_ready = 0; bit EP_AUDIOIN_Loaded = 0; bit i2c_bootloading_Flag = 0; /* bootloader mode */ @@ -117,7 +117,7 @@ { data Uchar i; - if (status_requested && FifoIn_STT_Idx && !CMDIN_ToSend_Flag) + if (status_requested && FifoIn_STT_Idx && !tx_data_ready) { #ifdef USB_CMD_DEBUG printf("Stacking %Bu data from status on USB fifo.\n", @@ -146,7 +146,7 @@ for(i=FifoIn_STT_Idx;i<60;i++) Usb_write_byte(0); - CMDIN_ToSend_Flag = 1; // Synchronize the Sending command With USB + tx_data_ready = 1; // Synchronize the Sending command With USB FIFO_STT_flush(); RF_Status = 0; //Led_0_on(); @@ -485,14 +485,14 @@ Usb_clear_sof(); usb_sof_counter ++; // == 0xFF == 250ms - if ((CMDIN_ToSend_Flag == 1)) + if (tx_data_ready == 1) { #ifdef USB_TASK_DEBUG printf ("HIDCommand Sent \n"); #endif - - Usb_select_ep(EP_CMD_IN); - Usb_set_tx_ready(); + tx_data_ready = 2; + Usb_select_ep(EP_CMD_IN); + Usb_set_tx_ready(); } if(spi_watchdog_ctr) @@ -614,7 +614,7 @@ // Event on EP_CMD_IN LIBUSB EndPoint // // -> Usb_clear_tx_complete() - // -> CMDIN_ToSend_Flag = 0; + // -> tx_data_ready = 0; // -> Authorize a new loading of the FIFO //-------------------------------------------------------------------------- if (Usb_test_it_ep(EP_CMD_IN)) @@ -623,7 +623,7 @@ if(Usb_tx_complete()) { Usb_clear_tx_complete(); - CMDIN_ToSend_Flag = 0; + tx_data_ready = 0; //Led_1_off(); } } @@ -908,7 +908,7 @@ if (i2c_bootloading_Flag) /* I2C bootloading */ { - if (i2c_task_on_Flag && (CMDIN_ToSend_Flag == 0) && !i2c_wait_counter) /* wait for USB to be free for sending data */ + if (i2c_task_on_Flag && !tx_data_ready && !i2c_wait_counter) /* wait for USB to be free for sending data */ { blSendData(blHeader, 64); /* send data on I2C */ @@ -947,7 +947,7 @@ Usb_write_byte(0x00); /* XXX reserved for further use */ Usb_write_byte(0x00); /* XXX reserved for further use */ - CMDIN_ToSend_Flag = 1; + tx_data_ready = 1; i2c_task_on_Flag = 0; /* finish i2c task */ } } |
From: jaguarondi <c2m...@c2...> - 2007-10-02 16:52:58
|
Author: jaguarondi Date: 2007-10-02 18:50:42 +0200 (Tue, 02 Oct 2007) New Revision: 574 Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c Log: * Added and improved debug messages. Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c =================================================================== --- firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 16:42:39 UTC (rev 573) +++ firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 16:50:42 UTC (rev 574) @@ -3,7 +3,6 @@ #include "lib_mcu\spi\spi_lib.h" #include "lib_mcu\usb\usb_drv.h" -#include "lib_mcu\usb\uart_usb_lib.h" #include "lib_mcu\uart\uart_lib.h" #include "lib_mcu\fa-usb\flash_api.h" #include "modules\usb\usb_task.h" @@ -431,6 +430,10 @@ } else { +#ifdef USB_CMD_DEBUG + if(Usb_rx_complete()) + printf("LOOP: interrupt flags: %Bx\n", Usb_rx_complete()); +#endif //-------------------------------------------------------------------------- // // USB Suspend and Reset @@ -487,8 +490,8 @@ if (tx_data_ready == 1) { -#ifdef USB_TASK_DEBUG - printf ("HIDCommand Sent \n"); +#ifdef USB_CMD_DEBUG + printf ("USB: Status ready to be sent.\n"); #endif tx_data_ready = 2; Usb_select_ep(EP_CMD_IN); @@ -622,6 +625,9 @@ Usb_select_ep(EP_CMD_IN); if(Usb_tx_complete()) { +#ifdef USB_CMD_DEBUG + printf ("USB: Status sent.\n"); +#endif Usb_clear_tx_complete(); tx_data_ready = 0; //Led_1_off(); @@ -731,14 +737,21 @@ if(USB_ParserProcess_Permit_Flag) /* XXX should be removed from here */ if(Usb_test_it_ep(EP_CMD_OUT)) { + Usb_select_ep(EP_CMD_OUT); #ifdef USB_CMD_DEBUG - printf("Event on EP_CMD_OUT, data received:\n"); + printf("Event on EP_CMD_OUT, data received:\n"); + printf("EP_CMD_OUT interrupt flags: %Bx\n", Usb_rx_complete()); #endif - Usb_select_ep(EP_CMD_OUT); if(Usb_rx_complete()) { USBCommand_Ctr = usb_get_nb_byte(); // Capture the number of Byte in USB FIFO + /* Check that there's some data. */ + if (USBCommand_Ctr) + { USBCommand_Header = Usb_read_byte(); // Read the Header +#ifdef USB_CMD_DEBUG + printf("EP_CMD_OUT processing %Bd data.\n", USBCommand_Ctr); +#endif //-------------------------------------------------------------------------- // @@ -808,7 +821,7 @@ if (Command_FromUSB_bootload_cmd == BOOT_INIT) /* initialize a new page programming */ { #ifdef BOOTLOAD_DEBUG - printf ("\n Command_FromUSB_bootload_cmd == BOOT_INIT \n"); + printf ("\nBOOT_INIT\n"); #endif rf_reset_signal = 0; /* disables the RF module */ SPI_CSn = 0; /* clear CS to enter bootloader mode */ @@ -820,7 +833,7 @@ page_size = Usb_read_byte(); packets_per_page = Usb_read_byte(); #ifdef BOOTLOAD_DEBUG - printf (" blHeader.slave_address = %BX , page_size = %BX, packets_per_page = %BX \n",blHeader.slave_address,page_size,packets_per_page); + printf ("Slave address: %BX, Page size: %BX, Packets per page: %BX.\n",blHeader.slave_address,page_size,packets_per_page); #endif address_idx = 0; packet_idx = 0; @@ -830,7 +843,7 @@ { char tmp; #ifdef BOOTLOAD_DEBUG - printf (" Command_FromUSB_bootload_cmd == BOOT_EXIT \n"); + printf ("BOOT_EXIT\n"); #endif i2c_bootloading_Flag = 0; tmp = Usb_read_byte(); @@ -840,7 +853,7 @@ else if (Command_FromUSB_bootload_cmd == BOOT_FILLPAGE) /* read all packet data and add it to the page_data */ { #ifdef BOOTLOAD_DEBUG - printf (" Command_FromUSB_bootload_cmd == BOOT_FILLPAGE \n"); + printf ("BOOT_FILLPAGE\n"); #endif if (packet_idx == 0) /* get the address on the first packet */ { @@ -848,29 +861,45 @@ blHeader.page_address = blHeader.page_address << 8; blHeader.page_address += Usb_read_byte(); #ifdef BOOTLOAD_DEBUG - printf (" blHeader.page_address %x \n",blHeader.page_address); + printf ("Page address: %x, ",blHeader.page_address); + printf ("Address index: %Bx - %Bx\n", address_idx, address_idx + USBCommand_Ctr - 5); #endif for(i=0; i<(USBCommand_Ctr - 4); i++) blHeader.blData[address_idx++] = Usb_read_byte(); } else /* the other packets hold only data */ + { +#ifdef BOOTLOAD_DEBUG + printf ("Packet %Bd received, ", packet_idx); + printf ("Address index: %Bx - %Bx\n", address_idx, address_idx + USBCommand_Ctr - 3); +#endif for(i=0; i<(USBCommand_Ctr - 2); i++) blHeader.blData[address_idx++] = Usb_read_byte(); + } packet_idx++; } - if ((packet_idx == packets_per_page) && (address_idx == page_size)) /* last packet received and page completely filled */ + if (packet_idx == packets_per_page) /* last packet received and page completely filled */ { + if (address_idx == page_size) + { #ifdef BOOTLOAD_DEBUG - printf ("last packet received and page completely filled \n"); + printf ("Last packet received (%Bd), page filled. Now programming.\n", packet_idx); #endif address_idx = 0; packet_idx = 0; i2c_task_on_Flag = 1; + } + else + { +#ifdef BOOTLOAD_DEBUG + printf ("ERROR: expecting %Bd samples and received %Bd.\n", page_size, address_idx); +#endif + } } else if (packet_idx >= packets_per_page) { #ifdef BOOTLOAD_DEBUG - printf ("Error :: packet_idx >= packets_per_page \n"); + printf ("ERROR: packet_idx >= packets_per_page \n"); #endif /* TODO add an error return function on the USB */ } @@ -887,8 +916,13 @@ Usb_clear_rx_bank1(); } CMD_OUT_usb_Bank ^=1; - } + } +#ifdef USB_CMD_DEBUG + else + printf("ERROR: got EP OUT event but Usb_rx_complete returns false.\n"); + printf("END of EP_CMD_OUT, interrupt flags: %Bx\n", Usb_rx_complete()); +#endif } /* if(Usb_test_it_ep(EP_CMD_OUT)) */ } /* if(Usb_endpoint_interrupt()) */ } /* if (!usb_connected_Flag) */ |
Author: Paul_R Date: 2007-10-02 17:11:15 +0200 (Tue, 02 Oct 2007) New Revision: 572 Added: software/gadgets/light_monitor/tags/0.0.1/ software/gadgets/light_monitor/tags/0.0.1/Light_monitor.tgf software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/tags/0.0.1/Light_monitor/about.xml software/gadgets/light_monitor/tags/0.0.1/Light_monitor/settings.xml software/gadgets/light_monitor/tags/0.0.1/Light_monitor/strings.xml Removed: software/gadgets/light_monitor/tags/0.0.1/Light_monitor.tgf software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/tags/0.0.1/Light_monitor/about.xml software/gadgets/light_monitor/tags/0.0.1/Light_monitor/settings.xml software/gadgets/light_monitor/tags/0.0.1/Light_monitor/strings.xml Log: * Tag the light monitor gadget at version 0.0.1 Copied: software/gadgets/light_monitor/tags/0.0.1 (from rev 570, software/gadgets/light_monitor/trunk) Deleted: software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-02 15:11:15 UTC (rev 572) @@ -1,961 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="window1"> - <property name="visible">True</property> - <property name="title" translatable="yes">Parameters</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment6"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkFixed" id="fixed4"> - <property name="height_request">70</property> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="label_version"> - <property name="width_request">320</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Version :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">48</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label_description"> - <property name="width_request">312</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Description :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label_author"> - <property name="width_request">320</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Authors :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">32</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>About</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="Frame6"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed7"> - <property name="width_request">719</property> - <property name="height_request">68</property> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="txt_conf_value"> - <property name="width_request">80</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">208</property> - <property name="y">35</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txt_conf_time"> - <property name="width_request">80</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">296</property> - <property name="y">35</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_type"> - <property name="width_request">88</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Type</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_time"> - <property name="width_request">80</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Time</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">296</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_type"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_event"> - <property name="width_request">88</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Event</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">16</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_value"> - <property name="width_request">80</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Value</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">208</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Behavior script</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_notified"> - <property name="width_request">96</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Notified?</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">376</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_event"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> - </widget> - <packing> - <property name="x">16</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chk_conf_notified"> - <property name="width_request">24</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">False</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="x">416</property> - <property name="y">32</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed8"> - <property name="height_request">68</property> - <property name="visible">True</property> - - <child> - <widget class="GtkButton" id="btn_conf_add"> - <property name="width_request">88</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Add</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_add_clicked"/> - </widget> - <packing> - <property name="x">16</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btn_conf_remove"> - <property name="width_request">88</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_remove_clicked"/> - </widget> - <packing> - <property name="x">112</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btn_conf_modify"> - <property name="width_request">88</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Modify</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> - </widget> - <packing> - <property name="x">208</property> - <property name="y">8</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed9"> - <property name="height_request">60</property> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="txt_conf_sample"> - <property name="width_request">80</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">208</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txt_conf_rate"> - <property name="width_request">80</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">208</property> - <property name="y">24</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_sample"> - <property name="width_request">192</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Sample :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">16</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_rate"> - <property name="width_request">192</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Rate :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">16</property> - <property name="y">24</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblControlFrame"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Control</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame5"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment8"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkFixed" id="fixed6"> - <property name="height_request">29</property> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="delay_spinbutton"> - <property name="width_request">120</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 1 3600 1 10 10</property> - </widget> - <packing> - <property name="x">88</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label13"> - <property name="width_request">336</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Delay (sec) :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Updates</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed3"> - <property name="height_request">44</property> - <property name="visible">True</property> - - <child> - <widget class="GtkButton" id="button2"> - <property name="width_request">96</property> - <property name="height_request">32</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_accept_clicked"/> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="stock">gtk-apply</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="label" translatable="yes">Accept</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="x">16</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button3"> - <property name="width_request">96</property> - <property name="height_request">32</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_cancel_clicked"/> - - <child> - <widget class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="stock">gtk-cancel</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="label" translatable="yes">Cancel</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="x">144</property> - <property name="y">8</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> Copied: software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade (from rev 571, software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade) =================================================================== --- software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/light_monitor/tags/0.0.1/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-02 15:11:15 UTC (rev 572) @@ -0,0 +1,979 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Parameters</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame3"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed4"> + <property name="height_request">70</property> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label_version"> + <property name="width_request">320</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Version :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">48</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label_description"> + <property name="width_request">312</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Description :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label_author"> + <property name="width_request">320</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Authors :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">32</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>About</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="Frame6"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed7"> + <property name="width_request">719</property> + <property name="height_request">68</property> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="txt_conf_value"> + <property name="width_request">80</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">208</property> + <property name="y">35</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txt_conf_time"> + <property name="width_request">80</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">296</property> + <property name="y">35</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_type"> + <property name="width_request">88</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Type</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">112</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_time"> + <property name="width_request">80</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Time</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">296</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="cbb_conf_type"> + <property name="width_request">88</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">112</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_event"> + <property name="width_request">88</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Event</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">16</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_value"> + <property name="width_request">80</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Value</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">208</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Behavior script</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_notified"> + <property name="width_request">96</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Notified?</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">376</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="cbb_conf_event"> + <property name="width_request">88</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> + </widget> + <packing> + <property name="x">16</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="chk_conf_notified"> + <property name="width_request">24</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="x">416</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkFileChooserButton" id="conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">32</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed8"> + <property name="height_request">68</propert... [truncated message content] |
Author: Paul_R Date: 2007-10-02 17:03:33 +0200 (Tue, 02 Oct 2007) New Revision: 571 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Added a button in the settings window to clear the path of the behavior script. Added two check boxes in the widget window to active/deactive the behavior script. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-02 15:03:33 UTC (rev 571) @@ -295,24 +295,6 @@ </child> <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">32</property> - </packing> - </child> - - <child> <widget class="GtkComboBox" id="cbb_conf_type"> <property name="width_request">88</property> <property name="height_request">30</property> @@ -468,6 +450,24 @@ <property name="y">32</property> </packing> </child> + + <child> + <widget class="GtkFileChooserButton" id="conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">32</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> @@ -534,6 +534,24 @@ <property name="y">8</property> </packing> </child> + + <child> + <widget class="GtkButton" id="btnBehavior"> + <property name="width_request">100</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Clear path</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btnBehavior_clicked" last_modification_time="Tue, 02 Oct 2007 13:52:46 GMT"/> + </widget> + <packing> + <property name="x">502</property> + <property name="y">8</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-02 15:03:33 UTC (rev 571) @@ -144,6 +144,7 @@ self.get_widget("btn_conf_add").set_label(_me.string('conf_btnAdd')) self.get_widget("btn_conf_remove").set_label(_me.string('conf_btnRemove')) self.get_widget("btn_conf_modify").set_label(_me.string('conf_btnModify')) + self.get_widget("btnBehavior").set_label(_me.string('conf_btnBehavior')) self.get_widget("lbl_conf_sample").set_text(_me.string('conf_lblSample')) self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) @@ -207,8 +208,8 @@ ########################################################### def on_btn_conf_modify_clicked(self, widget, *args): index = self.value_list.get_value(self.iter, 0) + self.measure.event_tab = _me.get_param('config') - length = len(_me.get_param('config')) self.verify_value() @@ -298,7 +299,6 @@ elif self.measure.event_tab[i][2] == 1: Type = _me.string('conf_lblDecrease') elif self.measure.event_tab[i][2] == 2: - print ' tick' Type = _me.string('conf_lblBoth') Value = str(self.measure.event_tab[i][3]) Time = 'N.A.' @@ -362,9 +362,24 @@ def on_cancel_clicked(self, widget, *args): self.get_widget("window1").destroy() - ########################################################### # + # On Clear path button clicked + # + ########################################################### + def on_btnBehavior_clicked(self, widget, *args): + self.get_widget('conf_behavior').set_filename('None') + index = self.value_list.get_value(self.iter, 0) + print self.measure.event_tab[index][6] + self.measure.event_tab[index-1][6] = None + print self.measure.event_tab[index][6] + + self.value_list.clear() + for i in range(len(self.measure.event_tab)): + self.add_row(i) + + ########################################################### + # # Verify the value # ########################################################### Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-02 15:03:33 UTC (rev 571) @@ -432,6 +432,26 @@ <property name="y">72</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="chk_ChangeBehavior"> + <property name="width_request">168</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">checkbutton1</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">328</property> + <property name="y">48</property> + </packing> + </child> </widget> </child> </widget> @@ -695,6 +715,26 @@ <property name="y">64</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="chk_ThresholdBehavior"> + <property name="width_request">168</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">checkbutton2</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">328</property> + <property name="y">40</property> + </packing> + </child> </widget> </child> </widget> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 15:03:33 UTC (rev 571) @@ -40,9 +40,12 @@ #Restore the check boxes self.get_widget('chkThreshold').set_active(_me.get_param('threshold_chk')) + self.get_widget('chk_ThresholdBehavior').set_active(_me.get_param('chk_ThresholdBehavior')) + self.get_widget('chk_ChangeBehavior').set_active(_me.get_param('chk_ChangeBehavior')) self.get_widget("window1").set_title(_me.string('name_to_read')) #Set the labels + print 'tick' self.get_widget("radBoth").set_label(_me.string('widget_lblBoth')) self.get_widget("lblBtnApply").set_text(_me.string('widget_lblBtnApply')) self.get_widget("lblChange").set_text(_me.string('widget_lblChange')) @@ -58,6 +61,8 @@ self.get_widget("lblValue").set_text(_me.string('widget_lblValue')) self.get_widget("lblControl").set_text(_me.string('widget_lblControl')) self.get_widget("chkThreshold").set_label(_me.string('widget_lblDisplayThreshold')) + self.get_widget('chk_ThresholdBehavior').set_label(_me.string('widget_lblBehavior')) + self.get_widget('chk_ChangeBehavior').set_label(_me.string('widget_lblBehavior')) self.get_widget("lblRate").set_text(_me.string('gui_conf_rate_lb')) self.get_widget("lblSample").set_text(_me.string('gui_conf_sample_lb')) @@ -77,8 +82,6 @@ _me.set_param('Sample', self.light_measure.sample) self.get_widget("txtSample").set_text(str(_me.get_param('Sample'))) - - #Drop _me.set_param('drop', self.light_measure.val_drop) self.get_widget("valDrop_percent").set_text(str(_me.get_param('drop'))) @@ -109,6 +112,7 @@ self.get_widget("valThreshold").set_text(str(_me.get_param('threshold'))) + #update the radio button status self.light_measure.drop = _me.get_param('drop_rad') self.light_measure.raising = _me.get_param('raise_rad') @@ -122,6 +126,9 @@ self.light_measure.thresholdtext = _me.string('conf_lblThreshold') # '' the check boxes self.light_measure.threshold_chk = _me.get_param('threshold_chk') + print _me.get_param('chk_ThresholdBehavior') + self.light_measure.threshold_behavior_chk = _me.get_param('chk_ThresholdBehavior') + self.light_measure.change_behavior_chk = _me.get_param('chk_ChangeBehavior') self.light_measure.change_control() @@ -146,6 +153,9 @@ _me.set_param('decrease_rad', self.get_widget('radDecrease').get_active()) _me.set_param('both_rad', self.get_widget('radBoth').get_active()) _me.set_param('threshold_chk', self.get_widget('chkThreshold').get_active()) + _me.set_param('chk_ThresholdBehavior', self.get_widget('chk_ThresholdBehavior').get_active()) + _me.set_param('chk_ChangeBehavior', self.get_widget('chk_ChangeBehavior').get_active()) + print _me.get_param('chk_ChangeBehavior') temp_rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) temp_sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 15:03:33 UTC (rev 571) @@ -138,7 +138,6 @@ ########################################################### def event_control(self): for i in range (len(self.event_tab)): - print self.event_tab[i][0] self.Threshold_control(i) self.Change_control(i) @@ -348,7 +347,7 @@ def test_notification(self): if self.threshold_event == True: - if os.path.isfile(self.threshold_behavior): + if self.threshold_behavior_chk and os.path.isfile(self.threshold_behavior): self.threshold_event = False tux.sys.shell_free(self.threshold_behavior) else: @@ -358,9 +357,13 @@ tux.cmd.mouth_close() elif self.change_event == True: - if os.path.isfile(self.change_behavior): - self.change_event = False - tux.sys.shell_free(self.change_behavior) + print self.change_behavior + print os.path.isfile(self.change_behavior) + if self.change_behavior_chk: + if os.path.isfile(self.change_behavior): + print 'test' + self.change_event = False + tux.sys.shell_free(self.change_behavior) else: self.change_event = False tux.cmd.mouth_open() Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 15:03:33 UTC (rev 571) @@ -34,7 +34,7 @@ if event[i][7]: if event[i][5]: - if os.path.exists(str(event[i][6])): + if os.path.isfile(str(event[i][6])): tux.sys.shell_free(event[i][6]) event[i][7] = False else: Modified: software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-02 15:03:33 UTC (rev 571) @@ -8,9 +8,8 @@ <conf_lblEvent type='str'>Evènement</conf_lblEvent> <widget_lblControl type='str'>Contrôle</widget_lblControl> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> - <help_text type='str'>Bla bla bla - -bla</help_text> + <help_text type='str'> + </help_text> <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> @@ -23,6 +22,7 @@ <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> <conf_btnRemove type='str'>Enlever</conf_btnRemove> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <conf_btnBehavior type='str'>Supprimer</conf_btnBehavior> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> <conf_lblChangeD type='str'>Chute et augmente</conf_lblChangeD> <widget_lblValue type='str'>Valeur (%)</widget_lblValue> @@ -53,7 +53,7 @@ <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> <conf_lblValue type='str'>Valeur (%)</conf_lblValue> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> - <widget_lblBehavior type='str'>Activer le comportement</widget_lblBehavior> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 15:03:33 UTC (rev 571) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>light_monitor</gadget_name> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 15:03:33 UTC (rev 571) @@ -1,8 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop_rad type='bool'>True</drop_rad> + <chk_ThresholdBehavior type='bool'>False</chk_ThresholdBehavior> <increase_rad type='bool'>True</increase_rad> + <chk_ChangeBehavior type='bool'>False</chk_ChangeBehavior> <changeU_time type='int'>1</changeU_time> <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> @@ -12,6 +13,7 @@ <changeU_rad type='bool'>False</changeU_rad> <config type='list'>[]</config> <behavior_file_change type='str'>/home/</behavior_file_change> + <drop_rad type='bool'>True</drop_rad> <raise_rad type='bool'>False</raise_rad> <changeD type='float'>10.0</changeD> <drop_time type='int'>1</drop_time> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 13:35:54 UTC (rev 570) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 15:03:33 UTC (rev 571) @@ -8,7 +8,9 @@ <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <help_text type='str'>Bla bla bla bla</help_text> + <help_text type='str'> + </help_text> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -18,12 +20,11 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> @@ -39,9 +40,10 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Light monitor</name_to_read> @@ -51,9 +53,9 @@ <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> <conf_lblValue type='str'>Value (%)</conf_lblValue> <conf_lblRate type='str'>Refresh rate</conf_lblRate> - <widget_lblBehavior type='str'>Enable behavior</widget_lblBehavior> + <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_btnRemove type='str'>Remove</conf_btnRemove> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-02 13:35:55
|
Author: Paul_R Date: 2007-10-02 15:35:54 +0200 (Tue, 02 Oct 2007) New Revision: 570 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Changed the index format in the treeview object (str -> int) * Protected the entry box in the settings window. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-02 13:19:03 UTC (rev 569) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-02 13:35:54 UTC (rev 570) @@ -6,27 +6,15 @@ path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', root="window1", domain="params", **kwargs): - - """ - Constructor - """ SimpleGladeApp.__init__(self, path, root, domain, **kwargs) - - def new(self): - """ - On new window - """ self.measure = _me.get_param('measure') self.updates_commons() - self.updates_specifics() self.make_viewtree() + self.update_labels() def updates_commons(self): - """ - Updates common widgets - """ # Window title txt = "%s : %s" % (_me.string('name_to_read'), _me.string('gui_conf_window_title')) @@ -69,9 +57,6 @@ self.get_widget('txt_conf_sample').set_text(str(_me.get_param('Sample'))) - def updates_specifics(self): - pass - ########################################################### # # Light configuration control @@ -119,7 +104,7 @@ self.behavior_column.pack_start(self.behavior_cell, True) self.behavior_column.add_attribute(self.behavior_cell, 'text', 6) - self.value_list = gtk.TreeStore(str, str, str, str, str, str, str) + self.value_list = gtk.TreeStore(int, str, str, str, str, str, str) self.gadget_viewer = gtk.TreeView(self.value_list) self.gadget_viewer.append_column(self.index_column) self.gadget_viewer.append_column(self.event_column) @@ -142,7 +127,14 @@ for i in range(len(self.measure.event_tab)): self.add_row(i) - + + + ########################################################### + # + # Update the labels + # + ########################################################### + def update_labels(self): self.get_widget("lbl_conf_event").set_text(_me.string('conf_lblEvent')) self.get_widget("lbl_conf_type").set_text(_me.string('conf_lblType')) self.get_widget("lbl_conf_value").set_text(_me.string('conf_lblValue')) @@ -157,7 +149,11 @@ self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) - + ########################################################### + # + # On row selected + # + ########################################################### def on_row_selected(self, treeview, path, view_column): self.iter = self.value_list.get_iter(path) index = self.value_list.get_value(self.iter, 0) @@ -203,18 +199,21 @@ else: self.get_widget('conf_behavior').set_filename('None') + + ########################################################### + # + # On row modified + # + ########################################################### def on_btn_conf_modify_clicked(self, widget, *args): index = self.value_list.get_value(self.iter, 0) self.measure.event_tab = _me.get_param('config') length = len(_me.get_param('config')) - if self.get_widget('txt_conf_time').get_text() in ('','0' ,'0.0' ,'None'): - self.get_widget('txt_conf_time').set_text('0.1') - - if self.get_widget('txt_conf_value').get_text() in ('', '0', '0.0', 'None'): - self.get_widget('txt_conf_value').set_text('1.0') + self.verify_value() + value = [] - value = [int(index), + value = [index, self.get_widget('cbb_conf_event').get_active(), self.get_widget('cbb_conf_type').get_active(), float(self.get_widget('txt_conf_value').get_text()), @@ -224,31 +223,35 @@ False, 0] self.measure.event_tab = _me.get_param('config') - self.measure.event_tab[int(index)-1] = value + self.measure.event_tab[(index-1)] = value _me.set_param('config', self.measure.event_tab) self.value_list.clear() for i in range(len(self.measure.event_tab)): self.add_row(i) - + ########################################################### + # + # On row deleted + # + ########################################################### def on_btn_conf_remove_clicked(self, widget, *args): - index = int(self.value_list.get_value(self.iter, 0)) + index = self.value_list.get_value(self.iter, 0) self.measure.event_tab =_me.get_param('config') - self.measure.event_tab.pop(int(index - 1)) + self.measure.event_tab.pop(index - 1) _me.set_param('config', self.measure.event_tab) self.iter = 0 self.value_list.clear() for i in range(len(self.measure.event_tab)): self.add_row(i) - + ########################################################### + # + # On row added + # + ########################################################### def on_btn_conf_add_clicked(self, widget, *args): length = len(_me.get_param('config')) - if self.get_widget('txt_conf_time').get_text() in ('','0' ,'0.0' ,'None'): - self.get_widget('txt_conf_time').set_text('0.1') - - if self.get_widget('txt_conf_value').get_text() in ('', '0', '0.0', 'None'): - self.get_widget('txt_conf_value').set_text('1.0') + self.verify_value() value = [] value = [(length + 1), self.get_widget('cbb_conf_event').get_active(), @@ -267,7 +270,11 @@ for i in range(len(self.measure.event_tab)): self.add_row(i) - + ########################################################### + # + # Add row function + # + ########################################################### def add_row(self, tab_index): self.measure.event_tab = _me.get_param('config') i = tab_index @@ -306,9 +313,13 @@ Notify = _me.string('conf_lblNotNotified') Behavior = 'N.A.' - self.value_list.append(None,[str(i+1), Event, Type, Value, Time, Notify, Behavior]) + self.value_list.append(None,[(i+1), Event, Type, Value, Time, Notify, Behavior]) - + ########################################################### + # + # On combo box event + # + ########################################################### def on_cbb_conf_event_changed(self, widget, *args): if self.get_widget('cbb_conf_event').get_active() == 0: for i in range (4): @@ -325,11 +336,14 @@ self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblDecrease')) self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblBoth')) self.get_widget('cbb_conf_type').set_active(0) - + + + ########################################################### + # + # On accept button clicked + # + ########################################################### def on_accept_clicked(self, widget, *args): - """ - On button 'accept' clicked - """ _me.set_param('Rate', float(self.get_widget('txt_conf_rate').get_text())) _me.set_param('Sample',float(self.get_widget('txt_conf_sample').get_text())) self.measure.rate = _me.get_param('Rate') @@ -338,9 +352,39 @@ _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) self.get_widget("window1").destroy() - + + + ########################################################### + # + # On cancel button clicked + # + ########################################################### def on_cancel_clicked(self, widget, *args): - """ - On button 'cancel' clicked - """ self.get_widget("window1").destroy() + + + ########################################################### + # + # Verify the value + # + ########################################################### + def verify_value(self): + try: + float(self.get_widget('txt_conf_time').get_text()) + except: + self.get_widget('txt_conf_time').set_text('0.1') + + if float(self.get_widget('txt_conf_time').get_text()) < 0.1: + self.get_widget('txt_conf_time').set_text('0.1') + if float(self.get_widget('txt_conf_time').get_text()) > self.measure.rate * self.measure.sample: + self.get_widget('txt_conf_time').set_text(str(self.measure.rate * self.measure.sample)) + + try: + float(self.get_widget('txt_conf_value').get_text()) + except: + self.get_widget('txt_conf_value').set_text('1') + + if float(self.get_widget('txt_conf_value').get_text()) < 1: + self.get_widget('txt_conf_value').set_text('1') + if float(self.get_widget('txt_conf_value').get_text()) > 100: + self.get_widget('txt_conf_value').set_text('100') Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 13:19:03 UTC (rev 569) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 13:35:54 UTC (rev 570) @@ -138,6 +138,7 @@ ########################################################### def event_control(self): for i in range (len(self.event_tab)): + print self.event_tab[i][0] self.Threshold_control(i) self.Change_control(i) Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 13:19:03 UTC (rev 569) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 13:35:54 UTC (rev 570) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_version type='str'>0.0.1</gadget_version> <gadget_name type='str'>light_monitor</gadget_name> - <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_description type='str'>Light monitor for tux droid</gadget_description> - <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 13:19:03 UTC (rev 569) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 13:35:54 UTC (rev 570) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <increase_rad type='bool'>True</increase_rad> <changeU_time type='int'>1</changeU_time> <changeD_rad type='bool'>False</changeD_rad> @@ -17,7 +17,7 @@ <drop_time type='int'>1</drop_time> <changeU type='float'>10.0</changeU> <raise_time type='int'>1</raise_time> - <drop_rad type='bool'>True</drop_rad> + <drop type='float'>10.0</drop> <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 13:19:03 UTC (rev 569) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 13:35:54 UTC (rev 570) @@ -9,7 +9,6 @@ <widget_lblControl type='str'>Control</widget_lblControl> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'>Bla bla bla bla</help_text> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -19,10 +18,12 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> @@ -38,10 +39,9 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Light monitor</name_to_read> @@ -55,5 +55,5 @@ <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-10-02 13:19:04
|
Author: jaguarondi Date: 2007-10-02 15:19:03 +0200 (Tue, 02 Oct 2007) New Revision: 569 Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c Log: * Removed the blocking on the OUT EP with USBCommand_NewRequest_Flag, this doesn't make sense there and was buggy. Modified: firmware/fuxusb/trunk/modules/usb/usb_task.c =================================================================== --- firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 12:41:45 UTC (rev 568) +++ firmware/fuxusb/trunk/modules/usb/usb_task.c 2007-10-02 13:19:03 UTC (rev 569) @@ -118,7 +118,11 @@ data Uchar i; if (status_requested && FifoIn_STT_Idx && !CMDIN_ToSend_Flag) - { + { +#ifdef USB_CMD_DEBUG + printf("Stacking %Bu data from status on USB fifo.\n", + FifoIn_STT_Idx); +#endif //Led_0_off(); Usb_select_ep(EP_CMD_IN); Usb_write_byte(0); @@ -511,7 +515,7 @@ } //-------------------------------------------------------------------------- - // I2C pause timer + // Soft tiumer that suspend the I2C process when needed, 1ms unit (sof) //-------------------------------------------------------------------------- if (i2c_wait_counter) i2c_wait_counter--; @@ -724,15 +728,13 @@ // // //-------------------------------------------------------------------------- - if(USB_ParserProcess_Permit_Flag) + if(USB_ParserProcess_Permit_Flag) /* XXX should be removed from here */ if(Usb_test_it_ep(EP_CMD_OUT)) { - // printf ("if(Usb_test_it_ep(EP_CMD_OUT)) \n"); - if(!USBCommand_NewRequest_Flag) /* XXX can lock in case the RF is not responding, check this for bootloader */ - { - //DEBUG_2 = 1; +#ifdef USB_CMD_DEBUG + printf("Event on EP_CMD_OUT, data received:\n"); +#endif Usb_select_ep(EP_CMD_OUT); - //DEBUG_2 = 0; if(Usb_rx_complete()) { USBCommand_Ctr = usb_get_nb_byte(); // Capture the number of Byte in USB FIFO @@ -748,11 +750,14 @@ //-------------------------------------------------------------------------- if(USBCommand_Header == LIBUSB_TUX_CMD_HDR) { - #ifdef USB_CMD_DEBUG - printf("CMD TUX"); + printf("TUX command "); #endif - USBCommand_NewRequest_Flag = 1; // to inform SPI_task that a new command is arrived + /* XXX Changed this flag handling so that the OUT EP is + * not blocked anymore by this flag, but commands are + * not buffered and can be overwritten now. Is this a + * problem? Change this to a fifo? */ + USBCommand_NewRequest_Flag = 1; for(i=0;i<(USBCommand_Ctr-1);i++) { USBCommand_ForRF[i] = Usb_read_byte(); @@ -770,10 +775,9 @@ // //-------------------------------------------------------------------------- else if(USBCommand_Header == LIBUSB_DONGLE_CMD_HDR) - { #ifdef USB_CMD_DEBUG - printf("CMD DONGLE "); + printf("DONGLE command "); #endif for(i=0;i<(USBCommand_Ctr-1);i++) { @@ -786,8 +790,6 @@ printf("\n"); #endif usb_command_parser(); - USBCommand_NewRequest_Flag = 0; /* re-enable USB to get the next value */ - } //-------------------------------------------------------------------------- // @@ -797,11 +799,10 @@ else if(USBCommand_Header == LIBUSB_BOOTLOADER_CMD_HDR) { #ifdef USB_CMD_DEBUG - printf("CMD BOOTLOADER \n"); + printf("BOOTLOADER command\n"); #endif i2c_bootloading_Flag = 1; //printf ("LIBUSB_BOOTLOADER_CMD_HDR \n"); - USBCommand_NewRequest_Flag = 0; /* set that data has been received */ spi_task_on_Flag = 0; /* disables the spi task and enables I2C bootloading */ Command_FromUSB_bootload_cmd = Usb_read_byte(); /* first byte after the header is the bootloading command */ if (Command_FromUSB_bootload_cmd == BOOT_INIT) /* initialize a new page programming */ @@ -873,8 +874,6 @@ #endif /* TODO add an error return function on the USB */ } - - USBCommand_NewRequest_Flag = 0; /* re-enable USB to get the next value */ } Usb_select_ep(EP_CMD_OUT); /* release the bank */ if(CMD_OUT_usb_Bank==0) @@ -890,13 +889,11 @@ CMD_OUT_usb_Bank ^=1; } - } - } - } //if(Usb_endpoint_interrupt()) + } /* if(Usb_test_it_ep(EP_CMD_OUT)) */ + } /* if(Usb_endpoint_interrupt()) */ + } /* if (!usb_connected_Flag) */ - } - if(!usb_connected_Flag) return; |
From: Paul_R <c2m...@c2...> - 2007-10-02 12:43:59
|
Author: Paul_R Date: 2007-10-02 14:41:45 +0200 (Tue, 02 Oct 2007) New Revision: 568 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml Log: * Fix a bug in the event control functions : The timeout for the 'R&D' and 'D&R' functions wasn't correct. Now, the notifications occur only for the defined range of points. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 11:37:40 UTC (rev 567) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 12:41:45 UTC (rev 568) @@ -226,7 +226,7 @@ #Changements control if self.event_tab[i][1] == 0: pts_per_sec = self.sample / (self.rate * self.sample) - time = int(self.event_tab[i][4] * pts_per_sec) + time = float(self.event_tab[i][4] * pts_per_sec) if self.event_tab[i][7] != True: # Drop change part : if self.event_tab[i][2] == 0: @@ -278,7 +278,7 @@ if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - for i in range(int(time) - timeout): + for i in range(int(time - timeout)): if self.val_table[int(len(self.val_table)-1-i)] <= self.val_table[len(self.val_table) - 1] - ((val/100)*1124): maximum = max(self.val_table[init_val:len(self.val_table) - i]) if maximum >= self.val_table[len(self.val_table) - 1 - i] + val: @@ -297,7 +297,7 @@ if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - for i in range(int(time) - timeout): + for i in range(int(time - timeout)): if self.val_table[int(len(self.val_table)-1-i)] >= self.val_table[len(self.val_table) - 1] + ((val/100)*1124): minimum = min(self.val_table[init_val:len(self.val_table)-i]) if minimum <= self.val_table[len(self.val_table) - 1 - i] - val: Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 11:37:40 UTC (rev 567) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 12:41:45 UTC (rev 568) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>light_monitor</gadget_name> + <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_description type='str'>Light monitor for tux droid</gadget_description> - <gadget_author type='str'>Paul Rathgeb</gadget_author> - <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 11:37:40 UTC (rev 567) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 12:41:45 UTC (rev 568) @@ -1,40 +1,38 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop type='str'>10.0</drop> + <drop type='float'>10.0</drop> <increase_rad type='bool'>True</increase_rad> - <changeU_time type='str'>1.0</changeU_time> + <changeU_time type='int'>1</changeU_time> <changeD_rad type='bool'>False</changeD_rad> - <threshold type='str'>50.0</threshold> + <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> <behavior_file_threshold type='str'>/home/</behavior_file_threshold> - <raise type='str'>10.0</raise> + <raise type='float'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> <config type='list'>[]</config> <behavior_file_change type='str'>/home/</behavior_file_change> <raise_rad type='bool'>False</raise_rad> - <changeD type='str'>10.0</changeD> - <drop_time type='str'>1.0</drop_time> - <changeU type='str'>10.0</changeU> - <raise_time type='str'>1.0</raise_time> + <changeD type='float'>10.0</changeD> + <drop_time type='int'>1</drop_time> + <changeU type='float'>10.0</changeU> + <raise_time type='int'>1</raise_time> <drop_rad type='bool'>True</drop_rad> - <Sample type='str'>500.0</Sample> + <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> - <Rate type='str'>0.1</Rate> - <changeD_time type='str'>1.0</changeD_time> + <Rate type='float'>0.1</Rate> + <changeD_time type='int'>1</changeD_time> <both_rad type='bool'>False</both_rad> </parameters> <general> <gui_state> <widget> - <y type='int'>49</y> - <visible type='bool'>True</visible> - <x type='int'>5</x> + <visible type='bool'>False</visible> </widget> <conf> - <y type='int'>146</y> + <y type='int'>131</y> <visible type='bool'>True</visible> - <x type='int'>510</x> + <x type='int'>656</x> </conf> </gui_state> <language type='str'>en_US</language> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-02 11:37:44
|
Author: Paul_R Date: 2007-10-02 13:37:40 +0200 (Tue, 02 Oct 2007) New Revision: 567 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Fix a bug in 'raise & drop' and 'drop & raise' events. After the first event, the gadget was blocked Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 11:37:40 UTC (rev 567) @@ -276,10 +276,9 @@ def ChangeD_control(self, time, val, timeout, index): if timeout != 0: - timeout -= 1 - + timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - for i in range(int(time - self.timeout)): + for i in range(int(time) - timeout): if self.val_table[int(len(self.val_table)-1-i)] <= self.val_table[len(self.val_table) - 1] - ((val/100)*1124): maximum = max(self.val_table[init_val:len(self.val_table) - i]) if maximum >= self.val_table[len(self.val_table) - 1 - i] + val: @@ -290,12 +289,15 @@ return True if self.GUI_on: self.timeout = timeout + else: + self.event_tab[index][8] = timeout + return False def ChangeU_control(self, time, val, timeout, index): if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - for i in range(int(time - self.timeout)): + for i in range(int(time) - timeout): if self.val_table[int(len(self.val_table)-1-i)] >= self.val_table[len(self.val_table) - 1] + ((val/100)*1124): minimum = min(self.val_table[init_val:len(self.val_table)-i]) if minimum <= self.val_table[len(self.val_table) - 1 - i] - val: @@ -306,6 +308,9 @@ return True if self.GUI_on: self.timeout = timeout + else: + self.event_tab[index][8] = timeout + return False ########################################################### # Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 11:37:40 UTC (rev 567) @@ -5,8 +5,9 @@ temp = measure.event_tab[i][7] if temp == True: return True - else: - return False + return False + else: + return False Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 11:37:40 UTC (rev 567) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> - <gadget_name type='str'>light_monitor</gadget_name> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 11:37:40 UTC (rev 567) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop_rad type='bool'>True</drop_rad> + <drop type='str'>10.0</drop> <increase_rad type='bool'>True</increase_rad> <changeU_time type='str'>1.0</changeU_time> <changeD_rad type='bool'>False</changeD_rad> @@ -17,7 +17,7 @@ <drop_time type='str'>1.0</drop_time> <changeU type='str'>10.0</changeU> <raise_time type='str'>1.0</raise_time> - <drop type='str'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <Sample type='str'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='str'>0.1</Rate> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 11:37:40 UTC (rev 567) @@ -9,6 +9,7 @@ <widget_lblControl type='str'>Control</widget_lblControl> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'>Bla bla bla bla</help_text> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -18,12 +19,10 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> @@ -39,9 +38,10 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Light monitor</name_to_read> @@ -55,5 +55,5 @@ <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_btnRemove type='str'>Remove</conf_btnRemove> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-02 10:33:31
|
Author: Paul_R Date: 2007-10-02 12:33:05 +0200 (Tue, 02 Oct 2007) New Revision: 566 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Resolved a bug in the widget window : When the apply button was active, the time values were false. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 10:33:05 UTC (rev 566) @@ -77,11 +77,12 @@ _me.set_param('Sample', self.light_measure.sample) self.get_widget("txtSample").set_text(str(_me.get_param('Sample'))) - self.light_measure.change_control() - #Drop + + #Drop _me.set_param('drop', self.light_measure.val_drop) self.get_widget("valDrop_percent").set_text(str(_me.get_param('drop'))) + print self.light_measure.val_drop_time _me.set_param('drop_time', self.light_measure.val_drop_time) self.get_widget("valDrop_time").set_text(str(_me.get_param('drop_time'))) @@ -121,7 +122,7 @@ self.light_measure.thresholdtext = _me.string('conf_lblThreshold') # '' the check boxes self.light_measure.threshold_chk = _me.get_param('threshold_chk') - + self.light_measure.change_control() @@ -146,16 +147,16 @@ _me.set_param('both_rad', self.get_widget('radBoth').get_active()) _me.set_param('threshold_chk', self.get_widget('chkThreshold').get_active()) + temp_rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) + temp_sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) #sample and rate param - if self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) != self.light_measure.rate or self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) != self.light_measure.sample: - + if temp_rate != self.light_measure.rate or temp_sample != self.light_measure.sample: self.light_measure.tick = 1 - self.light_measure.rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) - self.light_measure.sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) + self.light_measure.rate = temp_rate + self.light_measure.sample = temp_sample self.light_measure.val_table = [0] * (int(self.light_measure.sample)+1) - max_time = self.light_measure.rate * self.light_measure.sample self.light_measure.val_drop = self.check_float_value(self.get_widget('valDrop_percent').get_text(), 1, 100) @@ -167,13 +168,13 @@ self.light_measure.val_changeU = self.check_float_value(self.get_widget('valChangeU_percent').get_text(), 1, 100) self.light_measure.val_changeU_time = self.check_float_value(self.get_widget('valChangeU_time').get_text(), self.light_measure.rate, max_time) self.light_measure.val_threshold = self.check_float_value(self.get_widget('valThreshold').get_text(), 0, 100) + print self.light_measure.val_changeD_time #Update values self.update_value() def on_threshold_selection_changed(self, widget, *args): filename = widget.get_filename() - print filename _me.set_param('behavior_file_threshold', filename) _me.get_param('measure').threshold_behavior = _me.get_param('behavior_file_threshold') @@ -190,15 +191,16 @@ ########################################################### def check_float_value(self, value, minimum, maximum): try: - print value value = float(value) except: - print 'value error' + print '0' value = float(minimum) if value < float(minimum): + print '1' value = float(minimum) elif value > float(maximum): + print '2' value = float(maximum) return value Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:33:05 UTC (rev 566) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_version type='str'>0.0.1</gadget_version> <gadget_description type='str'>Light monitor for tux droid</gadget_description> - <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_name type='str'>light_monitor</gadget_name> - <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:33:05 UTC (rev 566) @@ -1,27 +1,27 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <increase_rad type='bool'>True</increase_rad> - <changeU_time type='float'>1.0</changeU_time> + <changeU_time type='str'>1.0</changeU_time> <changeD_rad type='bool'>False</changeD_rad> - <threshold type='float'>50.0</threshold> + <threshold type='str'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> <behavior_file_threshold type='str'>/home/</behavior_file_threshold> - <raise type='float'>10.0</raise> + <raise type='str'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> <config type='list'>[]</config> <behavior_file_change type='str'>/home/</behavior_file_change> <raise_rad type='bool'>False</raise_rad> - <changeD type='float'>10.0</changeD> - <drop_time type='float'>1.0</drop_time> - <changeU type='float'>10.0</changeU> - <raise_time type='float'>1.0</raise_time> - <drop_rad type='bool'>True</drop_rad> + <changeD type='str'>10.0</changeD> + <drop_time type='str'>1.0</drop_time> + <changeU type='str'>10.0</changeU> + <raise_time type='str'>1.0</raise_time> + <drop type='str'>10.0</drop> <Sample type='str'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='str'>0.1</Rate> - <changeD_time type='float'>1.0</changeD_time> + <changeD_time type='str'>1.0</changeD_time> <both_rad type='bool'>False</both_rad> </parameters> <general> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 10:33:05 UTC (rev 566) @@ -9,7 +9,6 @@ <widget_lblControl type='str'>Control</widget_lblControl> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'>Bla bla bla bla</help_text> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -19,10 +18,12 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> @@ -38,10 +39,9 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Light monitor</name_to_read> @@ -55,5 +55,5 @@ <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-02 10:08:58
|
Author: Paul_R Date: 2007-10-02 12:08:22 +0200 (Tue, 02 Oct 2007) New Revision: 565 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml Log: * Reorganize some function in light_measure class. * Protect the entry box of the widget window against false format. Only accepted format are numbers. The wrong value are corrected when the Apply button is pressed. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-01 14:34:44 UTC (rev 564) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-02 10:08:22 UTC (rev 565) @@ -65,8 +65,8 @@ txt = _me.string('gui_conf_accept_bt') self.get_widget("label5").set_text(txt) - self.get_widget('txt_conf_rate').set_text(_me.get_param('Rate')) - self.get_widget('txt_conf_sample').set_text(_me.get_param('Sample')) + self.get_widget('txt_conf_rate').set_text(str(_me.get_param('Rate'))) + self.get_widget('txt_conf_sample').set_text(str(_me.get_param('Sample'))) def updates_specifics(self): @@ -128,7 +128,6 @@ self.gadget_viewer.append_column(self.time_column) self.gadget_viewer.append_column(self.notified_column) self.gadget_viewer.append_column(self.behavior_column) - #self.gadget_viewer.set_reorderable(True) self.get_widget("scrolledwindow1").add(self.gadget_viewer) self.get_widget("scrolledwindow1").set_size_request(0, 150) self.get_widget("scrolledwindow1").show_all() @@ -137,25 +136,25 @@ self.get_widget('txt_conf_time').set_text('0.1') self.gadget_viewer.connect("row_activated", self.on_row_selected) self.measure.event_tab = _me.get_param('config') - self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblChange')) + self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblChange')) self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblThreshold')) - self.get_widget('cbb_conf_event').set_active(0) + self.get_widget('cbb_conf_event').set_active(0) for i in range(len(self.measure.event_tab)): self.add_row(i) - self.get_widget("lbl_conf_event").set_text(_me.string('conf_lblEvent')) - self.get_widget("lbl_conf_type").set_text(_me.string('conf_lblType')) - self.get_widget("lbl_conf_value").set_text(_me.string('conf_lblValue')) - self.get_widget("lbl_conf_time").set_text(_me.string('conf_lblTime')) - self.get_widget("lbl_conf_notified").set_text(_me.string('conf_lblNotified')) - self.get_widget("lbl_conf_behavior").set_text(_me.string('conf_lblBehavior')) - self.get_widget("btn_conf_add").set_label(_me.string('conf_btnAdd')) - self.get_widget("btn_conf_remove").set_label(_me.string('conf_btnRemove')) - self.get_widget("btn_conf_modify").set_label(_me.string('conf_btnModify')) - self.get_widget("lbl_conf_sample").set_text(_me.string('conf_lblSample')) - self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) - self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) + self.get_widget("lbl_conf_event").set_text(_me.string('conf_lblEvent')) + self.get_widget("lbl_conf_type").set_text(_me.string('conf_lblType')) + self.get_widget("lbl_conf_value").set_text(_me.string('conf_lblValue')) + self.get_widget("lbl_conf_time").set_text(_me.string('conf_lblTime')) + self.get_widget("lbl_conf_notified").set_text(_me.string('conf_lblNotified')) + self.get_widget("lbl_conf_behavior").set_text(_me.string('conf_lblBehavior')) + self.get_widget("btn_conf_add").set_label(_me.string('conf_btnAdd')) + self.get_widget("btn_conf_remove").set_label(_me.string('conf_btnRemove')) + self.get_widget("btn_conf_modify").set_label(_me.string('conf_btnModify')) + self.get_widget("lbl_conf_sample").set_text(_me.string('conf_lblSample')) + self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) + self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-01 14:34:44 UTC (rev 564) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 10:08:22 UTC (rev 565) @@ -1,11 +1,7 @@ bindtextdomain("params", "") sys.path.append(_me.get_path('root') + '/Scripts/Python') -try: - from lightGraph_class import lightGraph -except: - print sys.exc_info() +from lightGraph_class import lightGraph - class Window(SimpleGladeApp): def __init__(self, @@ -13,7 +9,12 @@ root="window1", domain="params", **kwargs): SimpleGladeApp.__init__(self, path, root, domain, **kwargs) - + + ########################################################### + # + # Display the new window + # + ########################################################### def new(self): #Fill the text box with the previous values self.get_widget("valDrop_percent").set_text(str(_me.get_param('drop'))) @@ -62,50 +63,51 @@ thread.start_new_thread(self.update, ()) - def on_window1_destroy(self, widget, *args): - _me.get_param('measure').GUI_on = False - self.light_measure.GUI_on = False - #tux.monitoring.remove(self.monitor_id) - - def on_btnApply_clicked(self, widget, *args): - #Store the new values - _me.set_param('drop', self.get_widget('valDrop_percent').get_text()) - _me.set_param('raise', self.get_widget('valRaise_percent').get_text()) - _me.set_param('changeD', self.get_widget('valChangeD_percent').get_text()) - _me.set_param('changeU', self.get_widget('valChangeU_percent').get_text()) - _me.set_param('drop_time', self.get_widget('valDrop_time').get_text()) - _me.set_param('raise_time', self.get_widget('valRaise_time').get_text()) - _me.set_param('changeD_time', self.get_widget('valChangeD_time').get_text()) - _me.set_param('changeU_time', self.get_widget('valChangeU_time').get_text()) - _me.set_param('threshold', self.get_widget('valThreshold').get_text()) - _me.set_param('Rate', self.get_widget('txtRate').get_text()) - _me.set_param('Sample', self.get_widget('txtSample').get_text()) + ########################################################### + # + # Update the values + # + ########################################################### + def update_value(self): + #Rate + _me.set_param('Rate', self.light_measure.rate) + self.get_widget("txtRate").set_text(str(_me.get_param('Rate'))) - #Store the new radio buttons status - _me.set_param('drop_rad', self.get_widget('radDrop').get_active()) - _me.set_param('raise_rad', self.get_widget('radRaise').get_active()) - _me.set_param('changeD_rad', self.get_widget('radChangeD').get_active()) - _me.set_param('changeU_rad', self.get_widget('radChangeU').get_active()) - _me.set_param('increase_rad', self.get_widget('radIncrease').get_active()) - _me.set_param('decrease_rad', self.get_widget('radDecrease').get_active()) - _me.set_param('both_rad', self.get_widget('radBoth').get_active()) - _me.set_param('threshold_chk', self.get_widget('chkThreshold').get_active()) + #Sample + _me.set_param('Sample', self.light_measure.sample) + self.get_widget("txtSample").set_text(str(_me.get_param('Sample'))) - #Update value for the current graphic - self.update_value() - - def update_value(self): - #update the values - self.light_measure.val_drop = float(_me.get_param('drop')) - self.light_measure.val_raise = float(_me.get_param('raise')) - self.light_measure.val_changeD = float(_me.get_param('changeD')) - self.light_measure.val_changeU = float(_me.get_param('changeU')) - self.light_measure.val_drop_time = float(_me.get_param('drop_time')) - self.light_measure.val_raise_time = float(_me.get_param('raise_time')) - self.light_measure.val_changeD_time = float(_me.get_param('changeD_time')) - self.light_measure.val_changeU_time = float(_me.get_param('changeU_time')) - self.light_measure.val_threshold = float(_me.get_param('threshold')) + self.light_measure.change_control() + #Drop + _me.set_param('drop', self.light_measure.val_drop) + self.get_widget("valDrop_percent").set_text(str(_me.get_param('drop'))) + _me.set_param('drop_time', self.light_measure.val_drop_time) + self.get_widget("valDrop_time").set_text(str(_me.get_param('drop_time'))) + + #Raise + _me.set_param('raise', self.light_measure.val_raise) + self.get_widget("valRaise_percent").set_text(str(_me.get_param('raise'))) + _me.set_param('raise_time', self.light_measure.val_raise_time) + self.get_widget("valRaise_time").set_text(str(_me.get_param('raise_time'))) + + #Drop and raise + _me.set_param('changeD', self.light_measure.val_changeD) + self.get_widget("valChangeD_percent").set_text(str(_me.get_param('changeD'))) + _me.set_param('changeD_time', self.light_measure.val_changeD_time) + self.get_widget("valChangeD_time").set_text(str(_me.get_param('changeD_time'))) + + #Raise and drop + _me.set_param('changeU', self.light_measure.val_changeU) + self.get_widget("valChangeU_percent").set_text(str(_me.get_param('changeU'))) + _me.set_param('changeU_time', self.light_measure.val_changeU_time) + self.get_widget("valChangeU_time").set_text(str(_me.get_param('changeU_time'))) + + #Threshold + _me.set_param('threshold', self.light_measure.val_threshold) + self.get_widget("valThreshold").set_text(str(_me.get_param('threshold'))) + + #update the radio button status self.light_measure.drop = _me.get_param('drop_rad') self.light_measure.raising = _me.get_param('raise_rad') @@ -117,20 +119,58 @@ self.light_measure.changetext = _me.string('conf_lblChange') self.light_measure.thresholdtext = _me.string('conf_lblThreshold') - # '' the check boxes self.light_measure.threshold_chk = _me.get_param('threshold_chk') - # update the sample and rate values - if _me.get_param('Rate') != (0.0 or None or '') and float(_me.get_param('Rate')) != self.light_measure.rate: + + + + + ########################################################### + # + # Event functions + # + ########################################################### + def on_window1_destroy(self, widget, *args): + _me.get_param('measure').GUI_on = False + self.light_measure.GUI_on = False + + def on_btnApply_clicked(self, widget, *args): + #Store the new radio buttons status + _me.set_param('drop_rad', self.get_widget('radDrop').get_active()) + _me.set_param('raise_rad', self.get_widget('radRaise').get_active()) + _me.set_param('changeD_rad', self.get_widget('radChangeD').get_active()) + _me.set_param('changeU_rad', self.get_widget('radChangeU').get_active()) + _me.set_param('increase_rad', self.get_widget('radIncrease').get_active()) + _me.set_param('decrease_rad', self.get_widget('radDecrease').get_active()) + _me.set_param('both_rad', self.get_widget('radBoth').get_active()) + _me.set_param('threshold_chk', self.get_widget('chkThreshold').get_active()) + + #sample and rate param + if self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) != self.light_measure.rate or self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) != self.light_measure.sample: + self.light_measure.tick = 1 - self.light_measure.rate = float(_me.get_param('Rate')) - if _me.get_param('Sample') != (0 or None or '' or '1') and float(_me.get_param('Sample')) != self.light_measure.sample: - self.light_measure.val_table = [0] * (int(_me.get_param('Sample'))+1) - self.light_measure.sample = float(_me.get_param('Sample')) - - self.light_measure.change_control() - + self.light_measure.rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) + self.light_measure.sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) + self.light_measure.val_table = [0] * (int(self.light_measure.sample)+1) + + + + max_time = self.light_measure.rate * self.light_measure.sample + + self.light_measure.val_drop = self.check_float_value(self.get_widget('valDrop_percent').get_text(), 1, 100) + self.light_measure.val_drop_time = self.check_float_value(self.get_widget('valDrop_time').get_text(), self.light_measure.rate, max_time) + self.light_measure.val_raise = self.check_float_value(self.get_widget('valRaise_percent').get_text(), 1, 100) + self.light_measure.val_raise_time = self.check_float_value(self.get_widget('valRaise_time').get_text(), self.light_measure.rate, max_time) + self.light_measure.val_changeD = self.check_float_value(self.get_widget('valChangeD_percent').get_text(), 1, 100) + self.light_measure.val_changeD_time = self.check_float_value(self.get_widget('valChangeD_time').get_text(), self.light_measure.rate, max_time) + self.light_measure.val_changeU = self.check_float_value(self.get_widget('valChangeU_percent').get_text(), 1, 100) + self.light_measure.val_changeU_time = self.check_float_value(self.get_widget('valChangeU_time').get_text(), self.light_measure.rate, max_time) + self.light_measure.val_threshold = self.check_float_value(self.get_widget('valThreshold').get_text(), 0, 100) + + #Update values + self.update_value() + def on_threshold_selection_changed(self, widget, *args): filename = widget.get_filename() print filename @@ -142,7 +182,26 @@ _me.set_param('behavior_file_change', filename) _me.get_param('measure').change_behavior = _me.get_param('behavior_file_change') + + ########################################################### + # + # Value integrity control + # + ########################################################### + def check_float_value(self, value, minimum, maximum): + try: + print value + value = float(value) + except: + print 'value error' + value = float(minimum) + if value < float(minimum): + value = float(minimum) + elif value > float(maximum): + value = float(maximum) + return value + def update(self): self.light_graph = lightGraph() _me.set_param('graph', self.light_graph) @@ -151,9 +210,9 @@ _me.get_param('measure').light_graph_measure = self.light_graph _me.get_param('graph').light_measure_graph = self.light_measure _me.get_param('measure').GUI_on = True + self.update_value() self.light_graph.set_size_request(600, 300) gtk.gdk.threads_enter() - self.update_value() layout = self.get_widget('vbox2') layout.add(self.light_graph) layout.show_all() Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-01 14:34:44 UTC (rev 564) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 10:08:22 UTC (rev 565) @@ -136,81 +136,24 @@ # Events control # ########################################################### - def event_control(self): for i in range (len(self.event_tab)): - if self.event_tab[i][1] == 1: - if self.event_tab[i][7] == False: - - if self.event_tab[i][2] == 0: - #Increasing threshold control - if self.Increase_control(self.event_tab[i][3]) == True: - self.event_tab[i][7] = True - - elif self.event_tab[i][2] == 1: - #Decreasing threshold control - if self.Decrease_control(self.event_tab[i][3]) == True: - self.event_tab[i][7] = True - - elif self.event_tab[i][2] == 2: - #Both direction theshold control - if self.Both_control(self.event_tab[i][3]) == True: - self.event_tab[i][7] = True + self.Threshold_control(i) + self.Change_control(i) - #Changements control - else: - pts_per_sec = self.sample / (self.rate * self.sample) - time = int(self.event_tab[i][4] * pts_per_sec) - if self.event_tab[i][7] == False: - # Drop change part : - if self.event_tab[i][2] == 0: - if self.Drop_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - self.event_tab[i][7] = True - # Raise change part - if self.event_tab[i][2] == 1: - if self.Raise_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - self.event_tab[i][7] = True - # Drop and Raise change - if self.event_tab[i][2] == 2: - if self.ChangeD_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - self.event_tab[i][7] = True - # Raise and Drop change - if self.event_tab[i][2] == 3: - if self.ChangeU_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: - self.event_tab[i][7] = True - #Gadget or test notifications if self.GUI_on: - #Decrease threshold control - if self.decrease: - self.threshold_event = self.Decrease_control(self.val_threshold) - #Increasing threshold control - if self.increase: - self.threshold_event = self.Increase_control(self.val_threshold) - #Both direction theshold control - if self.both: - self.threshold_event = self.Both_control(self.val_threshold) - - #Changements control - if self.change_event != True: - # Drop change part : - if self.drop == True and self.val_drop_time > 0.0: - self.change_event = self.Drop_control(self.val_drop_time, self.val_drop, self.timeout, 0) - # Raise change part - if self.raising == True and self.val_raise_time > 0.0: - self.change_event = self.Raise_control(self.val_raise_time, self.val_raise, self.timeout, 0) - # Drop and Raise change - if self.changeD == True and self.val_changeD_time > 0.0: - self.change_event = self.ChangeD_control(self.val_changeD_time, self.val_changeD, self.timeout, 0) - # Raise and Drop change - if self.changeU == True and self.val_changeU_time > 0.0: - self.change_event = self.ChangeU_control(self.val_changeU_time, self.val_changeU, self.timeout, 0) - + self.test_func() #disable gadget notifications self.notify = False - #goto test notification - self.test_notification() - + + #goto test notification every sec. + if self.wait == 0: + self.wait = 10 + self.test_notification() + else: + self.wait -= 1 + # To prevent notifications at startup if self.start_flag == True: self.change_event = False @@ -224,17 +167,13 @@ pts_per_sec = self.sample / (self.rate * self.sample) self.timeout = 0 if self.val_drop_time >= 0.1 and self.val_drop > 0: - self.val_drop_time = (self.val_drop_time * pts_per_sec) - self.timeout = int(self.val_drop_time) + self.val_drop_time = int(self.val_drop_time * pts_per_sec) if self.val_raise_time >= 0.1 and self.val_raise > 0: - self.val_raise_time = self.val_raise_time * pts_per_sec - self.timeout = int(self.val_raise_time) + self.val_raise_time = int(self.val_raise_time * pts_per_sec) if self.val_changeD_time >= 0.1 and self.val_changeD > 0: - self.val_changeD_time = self.val_changeD_time * pts_per_sec - self.timeout = int(self.val_changeD_time) + self.val_changeD_time = int(self.val_changeD_time * pts_per_sec) if self.val_changeU_time >= 0.1 and self.val_changeU > 0: - self.val_changeU_time = self.val_changeU_time * pts_per_sec - self.timeout = int(self.val_changeU_time) + self.val_changeU_time = int(self.val_changeU_time * pts_per_sec) ########################################################### @@ -242,6 +181,22 @@ # Threshold control # ########################################################### + def Threshold_control(self, index): + if self.event_tab[index][1] == 1: + if self.event_tab[index][7] != True: + if self.event_tab[index][2] == 0: + #Increasing threshold control + if self.Increase_control(self.event_tab[index][3]) == True: + self.event_tab[index][7] = True + elif self.event_tab[index][2] == 1: + #Decreasing threshold control + if self.Decrease_control(self.event_tab[index][3]) == True: + self.event_tab[index][7] = True + elif self.event_tab[index][2] == 2: + #Both direction theshold control + if self.Both_control(self.event_tab[index][3]) == True: + self.event_tab[index][7] = True + def Increase_control(self, value): val_act = (self.val_table[len(self.val_table)-1]*100) / 1124.0 val_prev = (self.val_table[len(self.val_table)-2]*100) / 1124.0 @@ -267,10 +222,33 @@ # Changes control # ########################################################### + def Change_control(self, i): + #Changements control + if self.event_tab[i][1] == 0: + pts_per_sec = self.sample / (self.rate * self.sample) + time = int(self.event_tab[i][4] * pts_per_sec) + if self.event_tab[i][7] != True: + # Drop change part : + if self.event_tab[i][2] == 0: + if self.Drop_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + self.event_tab[i][7] = True + # Raise change part + if self.event_tab[i][2] == 1: + if self.Raise_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + self.event_tab[i][7] = True + # Drop and Raise change + if self.event_tab[i][2] == 2: + if self.ChangeD_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + self.event_tab[i][7] = True + # Raise and Drop change + if self.event_tab[i][2] == 3: + if self.ChangeU_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: + self.event_tab[i][7] = True + def Drop_control(self, time, val, timeout, index): #timeout control : to prevent multiple notifications with the same event if timeout != 0: - timeout -= 1 + timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout maximum = max(self.val_table[init_val:len(self.val_table)-1]) if maximum >= self.val_table[len(self.val_table)-1] + ((val/100)*1124): @@ -279,6 +257,8 @@ else: self.timeout = int(time) return True + elif self.GUI_on: + self.timeout = timeout def Raise_control(self, time, val, timeout, index): if timeout != 0: @@ -291,6 +271,8 @@ else: self.timeout = int(time) return True + elif self.GUI_on: + self.timeout = timeout def ChangeD_control(self, time, val, timeout, index): if timeout != 0: @@ -306,8 +288,9 @@ else: self.timeout = int(time) return True - - + if self.GUI_on: + self.timeout = timeout + def ChangeU_control(self, time, val, timeout, index): if timeout != 0: timeout -= 1 @@ -321,36 +304,62 @@ else: self.timeout = int(time) return True - + if self.GUI_on: + self.timeout = timeout + ########################################################### # - # Test notifications + # Test functions # ########################################################### + def test_func(self): + if self.threshold_event != True: + #Decrease threshold control + if self.decrease: + self.threshold_event = self.Decrease_control(self.val_threshold) + #Increasing threshold control + if self.increase: + self.threshold_event = self.Increase_control(self.val_threshold) + #Both direction theshold control + if self.both: + self.threshold_event = self.Both_control(self.val_threshold) + + #Changements control + if self.change_event != True: + # Drop change part : + if self.drop == True and self.val_drop_time > 0.0: + self.change_event = self.Drop_control(self.val_drop_time, self.val_drop, self.timeout, 0) + # Raise change part + if self.raising == True and self.val_raise_time > 0.0: + self.change_event = self.Raise_control(self.val_raise_time, self.val_raise, self.timeout, 0) + # Drop and Raise change + if self.changeD == True and self.val_changeD_time > 0.0: + self.change_event = self.ChangeD_control(self.val_changeD_time, self.val_changeD, self.timeout, 0) + # Raise and Drop change + if self.changeU == True and self.val_changeU_time > 0.0: + self.change_event = self.ChangeU_control(self.val_changeU_time, self.val_changeU, self.timeout, 0) + + def test_notification(self): - #if self.wait != 0: - # self.wait -= 1 if self.threshold_event == True: - if os.path.exists(self.threshold_behavior): - if os.path.isfile(self.threshold_behavior): - self.threshold_event = False - tux.sys.shell_free(self.threshold_behavior) - else: - self.threshold_event = False - tux.cmd.mouth_open() - tux.tts.speak(self.thresholdtext) - tux.cmd.mouth_close() - + if os.path.isfile(self.threshold_behavior): + self.threshold_event = False + tux.sys.shell_free(self.threshold_behavior) + else: + self.threshold_event = False + tux.cmd.mouth_open() + tux.tts.speak(self.thresholdtext) + tux.cmd.mouth_close() + elif self.change_event == True: - if os.path.exists(self.change_behavior): - if os.path.isfile(self.change_behavior): - self.change_event = False - tux.sys.shell_free(self.change_behavior) - else: - self.change_event = False - tux.cmd.mouth_open() - tux.tts.speak(self.changetext) - tux.cmd.mouth_close() + if os.path.isfile(self.change_behavior): + self.change_event = False + tux.sys.shell_free(self.change_behavior) + else: + self.change_event = False + tux.cmd.mouth_open() + tux.tts.speak(self.changetext) + tux.cmd.mouth_close() ########################################################### # Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-01 14:34:44 UTC (rev 564) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 10:08:22 UTC (rev 565) @@ -5,8 +5,8 @@ temp = measure.event_tab[i][7] if temp == True: return True - else: - return False + else: + return False @@ -43,5 +43,6 @@ event[i][7] = False else: event[i][7] = False + print 'notification done' break Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-01 14:34:44 UTC (rev 564) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:08:22 UTC (rev 565) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> + <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_name type='str'>light_monitor</gadget_name> - <gadget_author type='str'>Paul Rathgeb</gadget_author> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-01 14:34:44 UTC (rev 564) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:08:22 UTC (rev 565) @@ -1,27 +1,27 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop type='str'>10</drop> + <drop type='float'>10.0</drop> <increase_rad type='bool'>True</increase_rad> - <changeU_time type='str'>1</changeU_time> + <changeU_time type='float'>1.0</changeU_time> <changeD_rad type='bool'>False</changeD_rad> - <threshold type='str'>50</threshold> + <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> <behavior_file_threshold type='str'>/home/</behavior_file_threshold> - <raise type='str'>10</raise> + <raise type='float'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> <config type='list'>[]</config> <behavior_file_change type='str'>/home/</behavior_file_change> <raise_rad type='bool'>False</raise_rad> - <changeD type='str'>10</changeD> - <drop_time type='str'>1</drop_time> - <changeU type='str'>10</changeU> - <raise_time type='str'>1</raise_time> + <changeD type='float'>10.0</changeD> + <drop_time type='float'>1.0</drop_time> + <changeU type='float'>10.0</changeU> + <raise_time type='float'>1.0</raise_time> <drop_rad type='bool'>True</drop_rad> - <Sample type='str'>500</Sample> + <Sample type='str'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='str'>0.1</Rate> - <changeD_time type='str'>1</changeD_time> + <changeD_time type='float'>1.0</changeD_time> <both_rad type='bool'>False</both_rad> </parameters> <general> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-01 14:34:51
|
Author: Paul_R Date: 2007-10-01 16:34:44 +0200 (Mon, 01 Oct 2007) New Revision: 564 Removed: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep.bak software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade.bak software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.gladep software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.gladep.bak Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/settings.xml Log: * Removed all the temp and backup files * Separate the test mode (settings from the widget window) and the normal (values from setting window) notifications. Now, when the widget window is displayed, the gadget notifications are disabled. Deleted: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-10-01 12:59:32 UTC (rev 563) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-10-01 14:34:44 UTC (rev 564) @@ -1,961 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="window1"> - <property name="visible">True</property> - <property name="title" translatable="yes">Parameters</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment6"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkFixed" id="fixed4"> - <property name="height_request">70</property> - <property name="visible">True</property> - - <child> - <widget class="GtkLabel" id="label_version"> - <property name="width_request">320</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Version :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">48</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label_description"> - <property name="width_request">312</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Description :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label_author"> - <property name="width_request">320</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Authors :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">32</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>About</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="Frame6"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed7"> - <property name="width_request">719</property> - <property name="height_request">68</property> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="txt_conf_value"> - <property name="width_request">80</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">208</property> - <property name="y">35</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txt_conf_time"> - <property name="width_request">80</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">296</property> - <property name="y">35</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_type"> - <property name="width_request">88</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Type</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_time"> - <property name="width_request">80</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Time</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">296</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chk_conf_notified"> - <property name="width_request">24</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">False</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="x">416</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_type"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_event"> - <property name="width_request">88</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Event</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">16</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_value"> - <property name="width_request">80</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Value</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">208</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Behavior script</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_notified"> - <property name="width_request">96</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Notified?</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">376</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_event"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> - </widget> - <packing> - <property name="x">16</property> - <property name="y">32</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed8"> - <property name="height_request">68</property> - <property name="visible">True</property> - - <child> - <widget class="GtkButton" id="btn_conf_add"> - <property name="width_request">62</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Add</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_add_clicked"/> - </widget> - <packing> - <property name="x">16</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btn_conf_remove"> - <property name="width_request">62</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_remove_clicked"/> - </widget> - <packing> - <property name="x">96</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btn_conf_modify"> - <property name="width_request">62</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Modify</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> - </widget> - <packing> - <property name="x">176</property> - <property name="y">8</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed9"> - <property name="height_request">60</property> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="txt_conf_sample"> - <property name="width_request">72</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">136</property> - <property name="y">14</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txt_conf_rate"> - <property name="width_request">72</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">318</property> - <property name="y">14</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_rate"> - <property name="width_request">100</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Rate :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">232</property> - <property name="y">16</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lbl_conf_sample"> - <property name="width_request">100</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Sample :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">24</property> - <property name="y">16</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblControlFrame"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Control</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame5"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment8"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkFixed" id="fixed6"> - <property name="height_request">29</property> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="delay_spinbutton"> - <property name="width_request">120</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 1 3600 1 10 10</property> - </widget> - <packing> - <property name="x">88</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label13"> - <property name="width_request">336</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Delay (sec) :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Updates</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed3"> - <property name="height_request">44</property> - <property name="visible">True</property> - - <child> - <widget class="GtkButton" id="button2"> - <property name="width_request">96</property> - <property name="height_request">32</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_accept_clicked"/> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image2"> - <property name="visible">True</property> - <property name="stock">gtk-apply</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="label" translatable="yes">Accept</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="x">16</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="button3"> - <property name="width_request">96</property> - <property name="height_request">32</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_cancel_clicked"/> - - <child> - <widget class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="stock">gtk-cancel</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="label" translatable="yes">Cancel</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="x">144</property> - <property name="y">8</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> Deleted: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep 2007-10-01 12:59:32 UTC (rev 563) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep 2007-10-01 14:34:44 UTC (rev 564) @@ -1,8 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> - -<glade-project> - <name></name> - <program_name></program_name> - <gnome_support>FALSE</gnome_support> -</glade-project> Deleted: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep.bak =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep.bak 2007-10-01 12:59:32 UTC (rev 563) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.gladep.bak 2007-10-01 14:34:44 UTC (rev 564) @@ -1,8 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> - -<glade-project> - <name></name> - <program_name></program_name> - <gnome_support>FALSE</gnome_support> -</glade-project> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-01 12:59:32 UTC (rev 563) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-01 14:34:44 UTC (rev 564) @@ -302,26 +302,6 @@ </child> <child> - <widget class="GtkCheckButton" id="change_behavior"> - <property name="width_request">168</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">328</property> - <property name="y">40</property> - </packing> - </child> - - <child> <widget class="GtkRadioButton" id="radDrop"> <property name="width_request">140</property> <property name="height_request">22</property> @@ -409,32 +389,6 @@ </child> <child> - <widget class="GtkLabel" id="lblBehaviorChange"> - <property name="width_request">192</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Enable behavior</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">352</property> - <property name="y">40</property> - </packing> - </child> - - <child> <widget class="GtkLabel" id="lblEventChange"> <property name="width_request">128</property> <property name="height_request">16</property> @@ -657,52 +611,6 @@ </child> <child> - <widget class="GtkCheckButton" id="threshold_behavior"> - <property name="width_request">168</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">328</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblBehaviorThreshold"> - <property name="width_request">192</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Enable behavior</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">352</property> - <property name="y">32</property> - </packing> - </child> - - <child> <widget class="GtkLabel" id="lblEventThreshold"> <property name="width_request">136</property> <property name="height_request">16</property> Deleted: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade.bak =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade.bak 2007-10-01 12:59:32 UTC (rev 563) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade.bak 2007-10-01 14:34:44 UTC (rev 564) @@ -1,1084 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="window1"> - <property name="visible">True</property> - <property name="title" translatable="yes">Widget</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="default_width">600</property> - <property name="default_height">449</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> - <signal name="destroy" handler="on_window1_destroy"/> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkExpander" id="expander1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="expanded">True</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="border_width">1</property> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkFixed" id="fixed1"> - <property name="visible">True</property> - - <child> - <widget class="GtkEntry" id="valDrop_percent"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">176</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valRaise_percent"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">176</property> - <property name="y">56</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valChangeD_percent"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">176</property> - <property name="y">80</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed4"> - <property name="width_request">0</property> - <property name="height_request">0</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label10"> - <property name="width_request">46</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">%</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">176</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valDrop_time"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">232</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valRaise_time"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">232</property> - <property name="y">56</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valChangeD_time"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">232</property> - <property name="y">80</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label11"> - <property name="width_request">46</property> - <property name="height_request">17</property> - <property name="visible">True</property> - <property name="label" translatable="yes">sec.</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">232</property> - <property name="y">8</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valChangeU_percent"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">176</property> - <property name="y">104</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="valChangeU_time"> - <property name="width_request">48</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">●</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="x">232</property> - <property name="y">104</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="change_behavior"> - <property name="width_request">168</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">328</property> - <property name="y">40</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radDrop"> - <property name="width_request">140</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">False</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">32</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radRaise"> - <property name="width_request">140</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">False</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radDrop</property> - </widget> - <packing> - <property name="x">32</property> - <property name="y">56</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radChangeD"> - <property name="width_request">140</property> - <property name="height_request">22</property> - <property name="visible">True</pr... [truncated message content] |
From: jaguarondi <c2m...@c2...> - 2007-10-01 12:59:34
|
Author: jaguarondi Date: 2007-10-01 14:59:32 +0200 (Mon, 01 Oct 2007) New Revision: 563 Modified: firmware/fuxrf/trunk/default/Makefile firmware/fuxrf/trunk/device.aps firmware/fuxrf/trunk/device.c firmware/tuxrf/trunk/device.c Log: * .version sections were wrong in the RF codes, both firmware now compile correctly but I still don't know whether they work. That's the next step. Modified: firmware/fuxrf/trunk/default/Makefile =================================================================== --- firmware/fuxrf/trunk/default/Makefile 2007-10-01 12:51:16 UTC (rev 562) +++ firmware/fuxrf/trunk/default/Makefile 2007-10-01 12:59:32 UTC (rev 563) @@ -22,7 +22,7 @@ ## Linker flags LDFLAGS = $(COMMON) -LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map +LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map LDFLAGS += -Wl,-section-start=.buffer_tx1=0x800100 LDFLAGS += -Wl,-section-start=.buffer_rx1=0x800140 LDFLAGS += -Wl,-section-start=.sof=0x8001e6 Modified: firmware/fuxrf/trunk/device.aps =================================================================== --- firmware/fuxrf/trunk/device.aps 2007-10-01 12:51:16 UTC (rev 562) +++ firmware/fuxrf/trunk/device.aps 2007-10-01 12:59:32 UTC (rev 563) @@ -1 +1 @@ -<AVRStudio><MANAGEMENT><ProjectName>device</ProjectName><Created>10-Nov-2005 15:17:29</Created><LastEdit>03-Jul-2007 17:26:25</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>10-Nov-2005 15:17:29</Created><Version>4</Version><Build>4, 12, 0, 454</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\device.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>ATmega168</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><Item>51</Item><Item>580</Item><Item>103</Item><Item>17</Item><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>1</WATCHNUM><WATCHNAMES><Pane0><Variables>ts</Variables><Variables>i</Variables><Variables>rf_rx_state</Variables><Variables>checksum</Variables><Variables>protocol_flags</Variables><Variables>rf_buffer_tx</Variables><Variables>channel</Variables><Variables>FHAState</Variables><Variables>frequencyTable</Variables><Variables>commandStatus</Variables></Pane0><Pane1><Variables>ACKmode</Variables><Variables>sof_ary</Variables><Variables>toy_id_h</Variables><Variables>toy_id_l</Variables><Variables>prf_buffer_tx</Variables><Variables>rf_tx_counter</Variables><Variables>tx_pac_len</Variables><Variables>rf_buffer_rx1</Variables><Variables>rf_buffer_rx2</Variables><Variables>pspi_buffer_rx</Variables><Variables>rf_buffer_tx2</Variables><Variables>rf_buffer_tx1</Variables><Variables>pspi_buffer_tx</Variables><Variables>rf_header</Variables><Variables>rf_status</Variables><Variables>watchdog</Variables><Variables>gfilter</Variables><Variables>replaceFrequency</Variables><Variables>frequencyTable</Variables><Variables>commandBuffer</Variables><Variables>spiConfigFrame</Variables></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module><map private="C:\Documents and Settings\Pascal\Desktop\TUX\Dongle\RF\Branches\RF_test\Branches\" public=""/><map private="C:\Documents and Settings\Pascal\Desktop\TUX\Dongle\RF\New_timing\" public=""/></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>device.c</SOURCEFILE><SOURCEFILE>init.c</SOURCEFILE><SOURCEFILE>misc.c</SOURCEFILE><SOURCEFILE>prot.c</SOURCEFILE><SOURCEFILE>rf_ctrl.c</SOURCEFILE><SOURCEFILE>varis.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><SOURCEFILE>bootloader.c</SOURCEFILE><HEADERFILE>varis.h</HEADERFILE><HEADERFILE>init.h</HEADERFILE><HEADERFILE>misc.h</HEADERFILE><HEADERFILE>prot.h</HEADERFILE><HEADERFILE>rf_ctrl.h</HEADERFILE><HEADERFILE>defines.h</HEADERFILE><HEADERFILE>bootloader.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><HEADERFILE>version.h</HEADERFILE><HEADERFILE>commands.h</HEADERFILE><OTHERFILE>default\device.lss</OTHERFILE><OTHERFILE>default\device.map</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega48</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>device.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS><OPTION><FILE>bootloader.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>device.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>init.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>misc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>prot.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>rf_ctrl.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>spi.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>varis.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=13824000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS> -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 </LINKEROPTIONS><SEGMENTS><SEGMENT><NAME>.buffer_tx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x100</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x140</ADDRESS></SEGMENT><SEGMENT><NAME>.sof</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1e6</ADDRESS></SEGMENT><SEGMENT><NAME>.globals</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1ea</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_tx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x173</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1b3</ADDRESS></SEGMENT></SEGMENTS></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20060421\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20060421\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>device.c</FileName><Status>258</Status></File00000><File00001><FileId>00001</FileId><FileName>prot.c</FileName><Status>258</Status></File00001><File00002><FileId>00002</FileId><FileName>rf_ctrl.c</FileName><Status>258</Status></File00002><File00003><FileId>00003</FileId><FileName>init.c</FileName><Status>258</Status></File00003><File00004><FileId>00004</FileId><FileName>misc.c</FileName><Status>258</Status></File00004><File00005><FileId>00005</FileId><FileName>bootloader.c</FileName><Status>1</Status></File00005><File00006><FileId>00006</FileId><FileName>spi.c</FileName><Status>258</Status></File00006></Files><Workspace><File00005><Position>303 72 1381 502</Position><LineCol>22 13</LineCol><State>Maximized</State></File00005></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> +<AVRStudio><MANAGEMENT><ProjectName>device</ProjectName><Created>10-Nov-2005 15:17:29</Created><LastEdit>01-Oct-2007 14:04:44</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>10-Nov-2005 15:17:29</Created><Version>4</Version><Build>4, 12, 0, 454</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\device.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>ATmega168</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><Item>51</Item><Item>580</Item><Item>103</Item><Item>17</Item><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>1</WATCHNUM><WATCHNAMES><Pane0><Variables>ts</Variables><Variables>i</Variables><Variables>rf_rx_state</Variables><Variables>checksum</Variables><Variables>protocol_flags</Variables><Variables>rf_buffer_tx</Variables><Variables>channel</Variables><Variables>FHAState</Variables><Variables>frequencyTable</Variables><Variables>commandStatus</Variables></Pane0><Pane1><Variables>ACKmode</Variables><Variables>sof_ary</Variables><Variables>toy_id_h</Variables><Variables>toy_id_l</Variables><Variables>prf_buffer_tx</Variables><Variables>rf_tx_counter</Variables><Variables>tx_pac_len</Variables><Variables>rf_buffer_rx1</Variables><Variables>rf_buffer_rx2</Variables><Variables>pspi_buffer_rx</Variables><Variables>rf_buffer_tx2</Variables><Variables>rf_buffer_tx1</Variables><Variables>pspi_buffer_tx</Variables><Variables>rf_header</Variables><Variables>rf_status</Variables><Variables>watchdog</Variables><Variables>gfilter</Variables><Variables>replaceFrequency</Variables><Variables>frequencyTable</Variables><Variables>commandBuffer</Variables><Variables>spiConfigFrame</Variables></Pane1><Pane2></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module><map private="C:\Documents and Settings\Pascal\Desktop\TUX\Dongle\RF\Branches\RF_test\Branches\" public=""/><map private="C:\Documents and Settings\Pascal\Desktop\TUX\Dongle\RF\New_timing\" public=""/></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>device.c</SOURCEFILE><SOURCEFILE>init.c</SOURCEFILE><SOURCEFILE>misc.c</SOURCEFILE><SOURCEFILE>prot.c</SOURCEFILE><SOURCEFILE>rf_ctrl.c</SOURCEFILE><SOURCEFILE>varis.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><SOURCEFILE>bootloader.c</SOURCEFILE><HEADERFILE>varis.h</HEADERFILE><HEADERFILE>init.h</HEADERFILE><HEADERFILE>misc.h</HEADERFILE><HEADERFILE>prot.h</HEADERFILE><HEADERFILE>rf_ctrl.h</HEADERFILE><HEADERFILE>defines.h</HEADERFILE><HEADERFILE>bootloader.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><HEADERFILE>version.h</HEADERFILE><HEADERFILE>common\commands.h</HEADERFILE><OTHERFILE>default\device.lss</OTHERFILE><OTHERFILE>default\device.map</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega48</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>device.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS><OPTION><FILE>bootloader.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>device.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>init.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>misc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>prot.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>rf_ctrl.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>spi.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>varis.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=13824000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS>-Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0</LINKEROPTIONS><SEGMENTS><SEGMENT><NAME>.buffer_tx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x100</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x140</ADDRESS></SEGMENT><SEGMENT><NAME>.sof</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1e6</ADDRESS></SEGMENT><SEGMENT><NAME>.globals</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1ea</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_tx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x173</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1b3</ADDRESS></SEGMENT></SEGMENTS></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20060421\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20060421\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><ProjectFiles><Files><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\varis.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\init.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\misc.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\prot.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\rf_ctrl.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\defines.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\bootloader.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\spi.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\version.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\common\commands.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\device.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\init.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\misc.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\prot.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\rf_ctrl.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\varis.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\spi.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\fuxrf\trunk\bootloader.c</Name></Files></ProjectFiles><Files><File00000><FileId>00000</FileId><FileName>device.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>prot.c</FileName><Status>258</Status></File00001><File00002><FileId>00002</FileId><FileName>rf_ctrl.c</FileName><Status>258</Status></File00002><File00003><FileId>00003</FileId><FileName>init.c</FileName><Status>258</Status></File00003><File00004><FileId>00004</FileId><FileName>misc.c</FileName><Status>258</Status></File00004><File00005><FileId>00005</FileId><FileName>spi.c</FileName><Status>258</Status></File00005><File00006><FileId>00006</FileId><FileName>rf_ctrl.h</FileName><Status>1</Status></File00006></Files><Workspace><File00000><Position>329 132 1321 417</Position><LineCol>0 0</LineCol></File00000><File00006><Position>303 72 1391 507</Position><LineCol>48 49</LineCol><State>Maximized</State></File00006></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-01 12:51:16 UTC (rev 562) +++ firmware/fuxrf/trunk/device.c 2007-10-01 12:59:32 UTC (rev 563) @@ -17,15 +17,15 @@ #define CPU_NUMBER FUXRF_CPU_NUM /* sound CPU */ /* XXX Add the linker script to have fixed version positions once the project will compile with latest gcc under linux. */ -const author_t author __attribute__ ((section("version"))) = +const author_t author __attribute__ ((section(".version"))) = { AUTHOR_CMD, AUTHOR_ID, 0, }; -const revision_t svn_revision __attribute__ ((section("version"))) = +const revision_t svn_revision __attribute__ ((section(".version"))) = { REVISION_CMD, SVN_REV, SVN_STATUS, }; -const version_t tag_version __attribute__ ((section("version"))) = +const version_t tag_version __attribute__ ((section(".version"))) = { VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE, }; Modified: firmware/tuxrf/trunk/device.c =================================================================== --- firmware/tuxrf/trunk/device.c 2007-10-01 12:51:16 UTC (rev 562) +++ firmware/tuxrf/trunk/device.c 2007-10-01 12:59:32 UTC (rev 563) @@ -26,15 +26,15 @@ #define CPU_NUMBER TUXRF_CPU_NUM /* sound CPU */ /* XXX Add the linker script to have fixed version positions once the project will compile with latest gcc under linux. */ -const author_t author __attribute__ ((section("version"))) = +const author_t author __attribute__ ((section(".version"))) = { AUTHOR_CMD, AUTHOR_ID, 0, }; -const revision_t svn_revision __attribute__ ((section("version"))) = +const revision_t svn_revision __attribute__ ((section(".version"))) = { REVISION_CMD, SVN_REV, SVN_STATUS, }; -const version_t tag_version __attribute__ ((section("version"))) = +const version_t tag_version __attribute__ ((section(".version"))) = { VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE, }; |
From: Paul_R <c2m...@c2...> - 2007-10-01 12:51:18
|
Author: Paul_R Date: 2007-10-01 14:51:16 +0200 (Mon, 01 Oct 2007) New Revision: 562 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Added the notifications for all the possible events. Three options are possible : - Enable / disable the notification - Use the default notification. Tux say the event type. - Use an external behavior python script. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-01 12:51:16 UTC (rev 562) @@ -243,11 +243,11 @@ </child> <child> - <widget class="GtkLabel" id="lbl_conf_event"> + <widget class="GtkLabel" id="lbl_conf_type"> <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Event</property> + <property name="label" translatable="yes">Type</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -263,17 +263,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">16</property> + <property name="x">112</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_type"> - <property name="width_request">88</property> + <widget class="GtkLabel" id="lbl_conf_time"> + <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Type</property> + <property name="label" translatable="yes">Time</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -289,17 +289,50 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">112</property> + <property name="x">296</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_value"> - <property name="width_request">80</property> + <widget class="GtkFileChooserButton" id="conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="cbb_conf_type"> + <property name="width_request">88</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">112</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_event"> + <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Value</property> + <property name="label" translatable="yes">Event</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -315,17 +348,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">208</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_time"> + <widget class="GtkLabel" id="lbl_conf_value"> <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Time</property> + <property name="label" translatable="yes">Value</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -341,21 +374,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">296</property> + <property name="x">208</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_notified"> - <property name="width_request">96</property> + <widget class="GtkLabel" id="lbl_conf_behavior"> + <property name="width_request">144</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Notified?</property> + <property name="label" translatable="yes">Behavior script</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> + <property name="wrap">True</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -367,21 +400,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">376</property> + <property name="x">480</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_behavior"> - <property name="width_request">144</property> + <widget class="GtkLabel" id="lbl_conf_notified"> + <property name="width_request">96</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Behavior script</property> + <property name="label" translatable="yes">Notified?</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> + <property name="wrap">False</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -393,25 +426,23 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">480</property> + <property name="x">376</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> + <widget class="GtkComboBox" id="cbb_conf_event"> + <property name="width_request">88</property> <property name="height_request">30</property> <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> </widget> <packing> - <property name="x">480</property> + <property name="x">16</property> <property name="y">32</property> </packing> </child> @@ -437,38 +468,6 @@ <property name="y">32</property> </packing> </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_type"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_event"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes">Change -Threshold</property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> - </widget> - <packing> - <property name="x">16</property> - <property name="y">32</property> - </packing> - </child> </widget> <packing> <property name="padding">0</property> @@ -483,44 +482,44 @@ <property name="visible">True</property> <child> - <widget class="GtkButton" id="btn_conf_remove"> - <property name="width_request">62</property> + <widget class="GtkButton" id="btn_conf_add"> + <property name="width_request">88</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</property> + <property name="label" translatable="yes">Add</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_remove_clicked"/> + <signal name="clicked" handler="on_btn_conf_add_clicked"/> </widget> <packing> - <property name="x">96</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkButton" id="btn_conf_add"> - <property name="width_request">62</property> + <widget class="GtkButton" id="btn_conf_remove"> + <property name="width_request">88</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Add</property> + <property name="label" translatable="yes">Remove</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_add_clicked"/> + <signal name="clicked" handler="on_btn_conf_remove_clicked"/> </widget> <packing> - <property name="x">16</property> + <property name="x">112</property> <property name="y">8</property> </packing> </child> <child> <widget class="GtkButton" id="btn_conf_modify"> - <property name="width_request">62</property> + <property name="width_request">88</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -531,7 +530,7 @@ <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> </widget> <packing> - <property name="x">176</property> + <property name="x">208</property> <property name="y">8</property> </packing> </child> @@ -549,34 +548,8 @@ <property name="visible">True</property> <child> - <widget class="GtkLabel" id="lbl_conf_sample"> - <property name="width_request">100</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Sample :</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="x">24</property> - <property name="y">16</property> - </packing> - </child> - - <child> <widget class="GtkEntry" id="txt_conf_sample"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -589,14 +562,14 @@ <property name="activates_default">False</property> </widget> <packing> - <property name="x">136</property> - <property name="y">14</property> + <property name="x">208</property> + <property name="y">0</property> </packing> </child> <child> <widget class="GtkEntry" id="txt_conf_rate"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -609,15 +582,41 @@ <property name="activates_default">False</property> </widget> <packing> - <property name="x">318</property> - <property name="y">14</property> + <property name="x">208</property> + <property name="y">24</property> </packing> </child> <child> + <widget class="GtkLabel" id="lbl_conf_sample"> + <property name="width_request">192</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Sample :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">16</property> + <property name="y">0</property> + </packing> + </child> + + <child> <widget class="GtkLabel" id="lbl_conf_rate"> - <property name="width_request">100</property> - <property name="height_request">20</property> + <property name="width_request">192</property> + <property name="height_request">24</property> <property name="visible">True</property> <property name="label" translatable="yes">Rate :</property> <property name="use_underline">False</property> @@ -635,8 +634,8 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">232</property> - <property name="y">16</property> + <property name="x">16</property> + <property name="y">24</property> </packing> </child> </widget> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-10-01 12:51:16 UTC (rev 562) @@ -243,11 +243,11 @@ </child> <child> - <widget class="GtkLabel" id="lbl_conf_event"> + <widget class="GtkLabel" id="lbl_conf_type"> <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Event</property> + <property name="label" translatable="yes">Type</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -263,17 +263,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">16</property> + <property name="x">112</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_type"> - <property name="width_request">88</property> + <widget class="GtkLabel" id="lbl_conf_time"> + <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Type</property> + <property name="label" translatable="yes">Time</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -289,17 +289,72 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">112</property> + <property name="x">296</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_value"> - <property name="width_request">80</property> + <widget class="GtkFileChooserButton" id="conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="chk_conf_notified"> + <property name="width_request">24</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="x">416</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="cbb_conf_type"> + <property name="width_request">88</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">112</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_event"> + <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Value</property> + <property name="label" translatable="yes">Event</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -315,17 +370,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">208</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_time"> + <widget class="GtkLabel" id="lbl_conf_value"> <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Time</property> + <property name="label" translatable="yes">Value</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -341,21 +396,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">296</property> + <property name="x">208</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_notified"> - <property name="width_request">96</property> + <widget class="GtkLabel" id="lbl_conf_behavior"> + <property name="width_request">144</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Notified?</property> + <property name="label" translatable="yes">Behavior script</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> + <property name="wrap">True</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -367,21 +422,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">376</property> + <property name="x">480</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_behavior"> - <property name="width_request">144</property> + <widget class="GtkLabel" id="lbl_conf_notified"> + <property name="width_request">96</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Behavior script</property> + <property name="label" translatable="yes">Notified?</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">True</property> + <property name="wrap">False</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -393,75 +448,19 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">480</property> + <property name="x">376</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chk_conf_notified"> - <property name="width_request">24</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">False</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="x">416</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_type"> + <widget class="GtkComboBox" id="cbb_conf_event"> <property name="width_request">88</property> <property name="height_request">30</property> <property name="visible">True</property> <property name="items" translatable="yes"></property> <property name="add_tearoffs">False</property> <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_event"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes">Change -Threshold</property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> </widget> <packing> @@ -483,37 +482,37 @@ <property name="visible">True</property> <child> - <widget class="GtkButton" id="btn_conf_remove"> + <widget class="GtkButton" id="btn_conf_add"> <property name="width_request">62</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</property> + <property name="label" translatable="yes">Add</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_remove_clicked"/> + <signal name="clicked" handler="on_btn_conf_add_clicked"/> </widget> <packing> - <property name="x">96</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkButton" id="btn_conf_add"> + <widget class="GtkButton" id="btn_conf_remove"> <property name="width_request">62</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Add</property> + <property name="label" translatable="yes">Remove</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_btn_conf_add_clicked"/> + <signal name="clicked" handler="on_btn_conf_remove_clicked"/> </widget> <packing> - <property name="x">16</property> + <property name="x">96</property> <property name="y">8</property> </packing> </child> @@ -542,6 +541,110 @@ <property name="fill">True</property> </packing> </child> + + <child> + <widget class="GtkFixed" id="fixed9"> + <property name="height_request">60</property> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="txt_conf_sample"> + <property name="width_request">72</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">136</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txt_conf_rate"> + <property name="width_request">72</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">318</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_rate"> + <property name="width_request">100</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Rate :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">232</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_sample"> + <property name="width_request">100</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Sample :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">24</property> + <property name="y">16</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> </widget> </child> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-01 12:51:16 UTC (rev 562) @@ -84,37 +84,37 @@ self.index_column.pack_start(self.index_cell, True) self.index_column.add_attribute(self.index_cell, 'text', 0) - self.event_column = gtk.TreeViewColumn('Event') + self.event_column = gtk.TreeViewColumn(_me.string('conf_lblEvent')) self.event_column.set_min_width(100) self.event_cell = gtk.CellRendererText() self.event_column.pack_start(self.event_cell, True) self.event_column.add_attribute(self.event_cell, 'text', 1) - self.type_column = gtk.TreeViewColumn('Type') + self.type_column = gtk.TreeViewColumn(_me.string('conf_lblType')) self.type_column.set_min_width(100) self.type_cell = gtk.CellRendererText() self.type_column.pack_start(self.type_cell, True) self.type_column.add_attribute(self.type_cell, 'text', 2) - self.value_column = gtk.TreeViewColumn('Value') + self.value_column = gtk.TreeViewColumn(_me.string('conf_lblValue')) self.value_column.set_min_width(100) self.value_cell = gtk.CellRendererText() self.value_column.pack_start(self.value_cell, True) self.value_column.add_attribute(self.value_cell, 'text', 3) - self.time_column = gtk.TreeViewColumn('Time') + self.time_column = gtk.TreeViewColumn(_me.string('conf_lblTime')) self.time_column.set_min_width(100) self.time_cell = gtk.CellRendererText() self.time_column.pack_start(self.time_cell, True) self.time_column.add_attribute(self.time_cell, 'text', 4) - self.notified_column = gtk.TreeViewColumn('Notified') + self.notified_column = gtk.TreeViewColumn(_me.string('conf_lblNotified')) self.notified_column.set_min_width(100) self.notified_cell = gtk.CellRendererText() self.notified_column.pack_start(self.notified_cell, True) self.notified_column.add_attribute(self.notified_cell, 'text', 5) - self.behavior_column = gtk.TreeViewColumn('Behavior') + self.behavior_column = gtk.TreeViewColumn(_me.string('conf_lblBehavior')) self.behavior_cell = gtk.CellRendererText() self.behavior_column.pack_start(self.behavior_cell, True) self.behavior_column.add_attribute(self.behavior_cell, 'text', 6) @@ -137,47 +137,64 @@ self.get_widget('txt_conf_time').set_text('0.1') self.gadget_viewer.connect("row_activated", self.on_row_selected) self.measure.event_tab = _me.get_param('config') + self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblChange')) + self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblThreshold')) + self.get_widget('cbb_conf_event').set_active(0) + for i in range(len(self.measure.event_tab)): self.add_row(i) + self.get_widget("lbl_conf_event").set_text(_me.string('conf_lblEvent')) + self.get_widget("lbl_conf_type").set_text(_me.string('conf_lblType')) + self.get_widget("lbl_conf_value").set_text(_me.string('conf_lblValue')) + self.get_widget("lbl_conf_time").set_text(_me.string('conf_lblTime')) + self.get_widget("lbl_conf_notified").set_text(_me.string('conf_lblNotified')) + self.get_widget("lbl_conf_behavior").set_text(_me.string('conf_lblBehavior')) + self.get_widget("btn_conf_add").set_label(_me.string('conf_btnAdd')) + self.get_widget("btn_conf_remove").set_label(_me.string('conf_btnRemove')) + self.get_widget("btn_conf_modify").set_label(_me.string('conf_btnModify')) + self.get_widget("lbl_conf_sample").set_text(_me.string('conf_lblSample')) + self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) + self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) + def on_row_selected(self, treeview, path, view_column): self.iter = self.value_list.get_iter(path) index = self.value_list.get_value(self.iter, 0) event = self.value_list.get_value(self.iter, 1) - type = self.value_list.get_value(self.iter, 2) + typet = self.value_list.get_value(self.iter, 2) value = self.value_list.get_value(self.iter, 3) time = self.value_list.get_value(self.iter, 4) notify = self.value_list.get_value(self.iter, 5) behavior = self.value_list.get_value(self.iter, 6) - if event == 'Change': + if event == _me.string('conf_lblChange'): self.get_widget('cbb_conf_event').set_active(0) - if type == 'Drop': + if typet == _me.string('conf_lblDrop'): self.get_widget('cbb_conf_type').set_active(0) - if type == 'Raise': + if typet == _me.string('conf_lblRaise'): self.get_widget('cbb_conf_type').set_active(1) - if type == 'Drop and raise': + if typet == _me.string('conf_lblChangeD'): self.get_widget('cbb_conf_type').set_active(2) - if type == 'Raise and drop': + if typet == _me.string('conf_lblChangeU'): self.get_widget('cbb_conf_type').set_active(3) self.get_widget('txt_conf_value').set_text(value) self.get_widget('txt_conf_time').set_text(time) else: self.get_widget('cbb_conf_event').set_active(1) - if type == 'Increase': + if typet == _me.string('conf_lblIncrease'): self.get_widget('cbb_conf_type').set_active(0) - if type == 'Decrease': + if typet == _me.string('conf_lblDecrease'): self.get_widget('cbb_conf_type').set_active(1) - if type == 'Both direction': + if typet == _me.string('conf_lblBoth'): self.get_widget('cbb_conf_type').set_active(2) self.get_widget('txt_conf_value').set_text(value) self.get_widget('txt_conf_time').set_text('') - if notify == 'Notified': + if notify == _me.string('conf_lblNotifiedBehavior'): self.get_widget('chk_conf_notified').set_active(True) else: self.get_widget('chk_conf_notified').set_active(False) @@ -192,20 +209,21 @@ self.measure.event_tab = _me.get_param('config') length = len(_me.get_param('config')) - if self.get_widget('cbb_conf_type').get_active() == 0 and self.get_widget('txt_conf_time').get_text() in ('','0' ,'0.0' ,'None'): + if self.get_widget('txt_conf_time').get_text() in ('','0' ,'0.0' ,'None'): self.get_widget('txt_conf_time').set_text('0.1') if self.get_widget('txt_conf_value').get_text() in ('', '0', '0.0', 'None'): self.get_widget('txt_conf_value').set_text('1.0') value = [] - value = [(length + 1), + value = [int(index), self.get_widget('cbb_conf_event').get_active(), self.get_widget('cbb_conf_type').get_active(), float(self.get_widget('txt_conf_value').get_text()), float(self.get_widget('txt_conf_time').get_text()), self.get_widget('chk_conf_notified').get_active(), - self.get_widget('conf_behavior').get_filename(), - False] + str(self.get_widget('conf_behavior').get_filename()), + False, + 0] self.measure.event_tab = _me.get_param('config') self.measure.event_tab[int(index)-1] = value _me.set_param('config', self.measure.event_tab) @@ -239,8 +257,9 @@ float(self.get_widget('txt_conf_value').get_text()), float(self.get_widget('txt_conf_time').get_text()), self.get_widget('chk_conf_notified').get_active(), - self.get_widget('conf_behavior').get_filename(), - False] + str(self.get_widget('conf_behavior').get_filename()), + False, + 0] self.measure.event_tab = _me.get_param('config') self.measure.event_tab.append(value) @@ -255,36 +274,37 @@ i = tab_index if self.measure.event_tab[i][1] == 0: - Event = 'Change' + Event = _me.string('conf_lblChange') if self.measure.event_tab[i][2] == 0: - Type = 'Drop' + Type = _me.string('conf_lblDrop') elif self.measure.event_tab[i][2] == 1: - Type = 'Raise' + Type = _me.string('conf_lblRaise') elif self.measure.event_tab[i][2] == 2: - Type = 'Drop and raise' + Type = _me.string('conf_lblChangeD') elif self.measure.event_tab[i][2] == 3: - Type = 'Raise and drop' + Type = _me.string('conf_lblChangeU') Value = str(self.measure.event_tab[i][3]) Time = str(self.measure.event_tab[i][4]) else: - Event = 'Threshold' + Event = _me.string('conf_lblThreshold') if self.measure.event_tab[i][2] == 0: - Type = 'Increase' + Type = _me.string('conf_lblIncrease') elif self.measure.event_tab[i][2] == 1: - Type = 'Decrease' + Type = _me.string('conf_lblDecrease') elif self.measure.event_tab[i][2] == 2: - Type = 'Both direction' + print ' tick' + Type = _me.string('conf_lblBoth') Value = str(self.measure.event_tab[i][3]) Time = 'N.A.' if self.measure.event_tab[i][5]: - Notify = 'Notified' + Notify = _me.string('conf_lblNotifiedBehavior') if self.measure.event_tab[i][6] == None: - Behavior = 'Default behavior' + Behavior = _me.string('conf_lblDefaultBehavior') else: Behavior = str(self.measure.event_tab[i][6]) else: - Notify = 'Not notified' + Notify = _me.string('conf_lblNotNotified') Behavior = 'N.A.' self.value_list.append(None,[str(i+1), Event, Type, Value, Time, Notify, Behavior]) @@ -294,23 +314,19 @@ if self.get_widget('cbb_conf_event').get_active() == 0: for i in range (4): self.get_widget('cbb_conf_type').remove_text(0) - self.get_widget('cbb_conf_type').append_text('Drop') - self.get_widget('cbb_conf_type').append_text('Raise') - self.get_widget('cbb_conf_type').append_text('Drop and raise') - self.get_widget('cbb_conf_type').append_text('Raise and drop') + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblDrop')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblRaise')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblChangeD')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblChangeU')) self.get_widget('cbb_conf_type').set_active(0) else: for i in range (4): self.get_widget('cbb_conf_type').remove_text(0) - self.get_widget('cbb_conf_type').append_text('Increase') - self.get_widget('cbb_conf_type').append_text('Decrease') - self.get_widget('cbb_conf_type').append_text('Both direction') + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblIncrease')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblDecrease')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblBoth')) self.get_widget('cbb_conf_type').set_active(0) - - - - def on_accept_clicked(self, widget, *args): """ On button 'accept' clicked Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-01 12:51:16 UTC (rev 562) @@ -157,25 +157,27 @@ self.event_tab[i][7] = True #Changements control - else: - if self.event_tab[i][7] != True: + else: + pts_per_sec = self.sample / (self.rate * self.sample) + time = int(self.event_tab[i][4] * pts_per_sec) + if self.event_tab[i][7] == False: # Drop change part : - if self.event_tab[i][2] == 0: - if self.Drop_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.event_tab[i][2] == 0: + if self.Drop_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True # Raise change part if self.event_tab[i][2] == 1: - if self.Raise_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.Raise_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True # Drop and Raise change if self.event_tab[i][2] == 2: - if self.ChangeD_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.ChangeD_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True # Raise and Drop change if self.event_tab[i][2] == 3: - if self.ChangeU_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.ChangeU_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True - + ''' #Gadget or test notifications if self.GUI_on: #Decrease threshold control @@ -187,7 +189,7 @@ #Both direction theshold control if self.both: self.threshold_event = self.Both_control(self.val_threshold) - + #Changements control if self.change_event == False: # Drop change part : @@ -207,21 +209,23 @@ self.notify = False #goto test notification self.test_notification() + else: #enable gadget notifications self.notify = True - + ''' # To prevent notifications at startup if self.start_flag == True: self.change_event = False self.threshold_event = False self.start_flag = False - def change_control(self): # Determine how many point must be checked for changes events + + pts_per_sec = self.sample / (self.rate * self.sample) self.timeout = 0 if self.val_drop_time >= 0.1 and self.val_drop > 0: @@ -236,7 +240,7 @@ if self.val_changeU_time >= 0.1 and self.val_changeU > 0: self.val_changeU_time = self.val_changeU_time * pts_per_sec self.timeout = int(self.val_changeU_time) - + ########################################################### # @@ -268,47 +272,48 @@ # Changes control # ########################################################### - def Drop_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def Drop_control(self, time, val, timeout, index): + #timeout control : to prevent multiple notifications with the same event + if timeout != 0: + timeout -= 1 + init_val = len(self.val_table) - 1 - int(time) + timeout maximum = max(self.val_table[init_val:len(self.val_table)-1]) if maximum >= self.val_table[len(self.val_table)-1] + ((val/100)*1124): - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True - - def Raise_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def Raise_control(self, time, val, timeout, index): + if timeout != 0: + timeout -= 1 + init_val = len(self.val_table) - 1 - int(time) + timeout minimum = min(self.val_table[init_val:(len(self.val_table)-1)]) if minimum <= self.val_table[len(self.val_table)-1] - ((val/100)*1124): - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True - def ChangeD_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def ChangeD_control(self, time, val, timeout, index): + if timeout != 0: + timeout -= 1 + + init_val = len(self.val_table) - 1 - int(time) + timeout for i in range(int(time - self.timeout)): if self.val_table[int(len(self.val_table)-1-i)] <= self.val_table[len(self.val_table) - 1] - ((val/100)*1124): maximum = max(self.val_table[init_val:len(self.val_table) - i]) if maximum >= self.val_table[len(self.val_table) - 1 - i] + val: - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True break - def ChangeU_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def ChangeU_control(self, time, val, timeout, index): + if timeout != 0: + timeout -= 1 + init_val = len(self.val_table) - 1 - int(time) + timeout for i in range(int(time - self.timeout)): if self.val_table[int(len(self.val_table)-1-i)] >= self.val_table[len(self.val_table) - 1] + ((val/100)*1124): minimum = min(self.val_table[init_val:len(self.val_table)-i]) if minimum <= self.val_table[len(self.val_table) - 1 - i] - val: - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True break @@ -317,7 +322,7 @@ # Test notifications # ########################################################### - + ''' def test_notification(self): if self.wait != 0: self.wait -= 1 @@ -344,7 +349,7 @@ tux.cmd.mouth_open() tux.cmd.mouth_close() - +''' ########################################################### # # Acquire @@ -352,6 +357,7 @@ ########################################################### def on_light_level(self, args): self.tick -= 1 + print self.tick if self.tick == 0: val = (args[0] * 256) + args[1] self.val_table.append(val) Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-01 12:51:16 UTC (rev 562) @@ -1,32 +1,46 @@ def notify_checker(): - if _me.get_param('measure').threshold_event == True: - return True - - elif _me.get_param('measure').change_event == True: - return True + event = _me.get_param('measure').event_tab + print event + for i in range(len(event)): + temp = event[i][7] + if temp == True: + return True + + - else: - return False - -def notify_actuator(): - if _me.get_param('measure').threshold_event == True: - if os.path.isfile(_me.get_param('behavior_file_threshold')): - tux.sys.shell_free(_me.get_param('behavior_file_threshold')) - _me.get_param('measure').threshold_event = False +def notify_actuator(): + event = _me.get_param('measure').event_tab + for i in range(len(event)): + #create text to speach for the default notification + if event[i][1] == 0: + if event[i][2] == 0: + text = _me.string('conf_lblDrop') + elif event[i][2] == 1: + text = _me.string('conf_lblRaise') + elif event[i][2] == 2: + text = _me.string('conf_lblChangeD') + elif event[i][2] == 3: + text = _me.string('conf_lblChangeU') else: - tux.cmd.wings_on(2) - _me.get_param('measure').threshold_event = False - + if event[i][2] == 0: + text = _me.string('conf_lblIncrease') + elif event[i][2] == 1: + text = _me.string('conf_lblDecrease') + elif event[i][2] == 2: + text = _me.string('conf_lblBoth') - elif _me.get_param('measure').change_event == True: - if os.path.isfile(_me.get_param('behavior_file_change')): - tux.sys.shell_free(_me.get_param('behavior_file_change')) - _me.get_param('measure').change_event = False - else: - tux.cmd.mouth_open() - tux.cmd.mouth_close() - _me.get_param('measure').change_event = False + if event[i][7]: + if event[i][5]: + if os.path.exists(str(event[i][6])): + tux.sys.shell_free(event[i][6]) + event[i][7] = False + else: + tux.cmd.mouth_open() + tux.tts.speak(text) + tux.cmd.mouth_close() + event[i][7] = False + else: + event[i][7] = False + break - - Modified: software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-01 12:51:16 UTC (rev 562) @@ -1,37 +1,61 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <conf_lblIncrease type='str'>Augmente</conf_lblIncrease> + <conf_lblThreshold type='str'>Seuil</conf_lblThreshold> <gui_conf_remote_title type='str'>Contrôle</gui_conf_remote_title> + <conf_lblRaise type='str'>Accroissement</conf_lblRaise> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <conf_lblEvent type='str'>Evènement</conf_lblEvent> <widget_lblControl type='str'>Contrôle</widget_lblControl> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> - <speaker_name type='str'>Bruno8k</speaker_name> <help_text type='str'>Bla bla bla bla</help_text> + <conf_lblChange type='str'>Changement</conf_lblChange> + <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> + <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title>... [truncated message content] |
From: jaguarondi <c2m...@c2...> - 2007-10-01 12:02:57
|
Author: jaguarondi Date: 2007-10-01 14:02:54 +0200 (Mon, 01 Oct 2007) New Revision: 561 Modified: firmware/fuxrf/trunk/defines.h firmware/fuxrf/trunk/device.c firmware/fuxrf/trunk/init.c firmware/fuxrf/trunk/misc.c firmware/fuxrf/trunk/misc.h firmware/fuxrf/trunk/rf_ctrl.c firmware/fuxrf/trunk/rf_ctrl.h firmware/fuxrf/trunk/varis.c firmware/fuxrf/trunk/varis.h firmware/tuxrf/trunk/defines.h firmware/tuxrf/trunk/init.c firmware/tuxrf/trunk/misc.c firmware/tuxrf/trunk/misc.h firmware/tuxrf/trunk/prot.c firmware/tuxrf/trunk/rf_ctrl.c firmware/tuxrf/trunk/rf_ctrl.h firmware/tuxrf/trunk/varis.c firmware/tuxrf/trunk/varis.h Log: * Now using stdint types instead of custom defines. Modified: firmware/fuxrf/trunk/defines.h =================================================================== --- firmware/fuxrf/trunk/defines.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/defines.h 2007-10-01 12:02:54 UTC (rev 561) @@ -15,12 +15,6 @@ #define WIFI -// Type definition -#define uc_8 unsigned char -#define ui_16 unsigned int -#define sc_8 char -#define si_16 int - //------->rf_status-Defines<-------// #define WAIT_HOPPING 0x02 #define RXING 0x04 Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/device.c 2007-10-01 12:02:54 UTC (rev 561) @@ -31,7 +31,7 @@ }; /* Bootloader can be included with the program */ -#define BOOTLOADER 1 +#define BOOTLOADER 1 #if (BOOTLOADER) #include "bootloader.h" Modified: firmware/fuxrf/trunk/init.c =================================================================== --- firmware/fuxrf/trunk/init.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/init.c 2007-10-01 12:02:54 UTC (rev 561) @@ -56,12 +56,15 @@ output(UBRR0L, 0x05); //***********init-needed-peripherals***************// - SPCR = 0x40; // Slave + SPCR = 0x40; /* XXX what's this for? */// Slave SPSR = 0x00; - // Clear the SPI interrupt flag - asm volatile /* Clear the SPI interrupt flag */ - ("in __tmp_reg__, %0" "\n\t" "in __tmp_reg__, %1" - "\n\t"::"I" (_SFR_IO_ADDR(SPSR)), "I"(_SFR_IO_ADDR(SPDR))); + + /* Clear the SPI interrupt flag. XXX is this necessary at startup? */ + asm volatile + ("in __tmp_reg__, %0" "\n\t" + "in __tmp_reg__, %1" "\n\t" + ::"I" (_SFR_IO_ADDR(SPSR)), + "I"(_SFR_IO_ADDR(SPDR))); } //***************************************************************************** @@ -77,15 +80,15 @@ //***************************************************************************** void init_varis(void) { - uc_8 i; + uint8_t i; i = input(SPL); i ^= 0xFF; - extern ui_16 __bss_start; - extern ui_16 __stack; - uc_8 *ptr = (uc_8 *) & __bss_start; + extern uint16_t __bss_start; + extern uint16_t __stack; + uint8_t *ptr = (uint8_t *) & __bss_start; - while (ptr < (uc_8 *) & __stack - i) + while (ptr < (uint8_t *) & __stack - i) { /*sub because of returning of subroutine */ *ptr++ = 0; } // Reduce 26 bytes Modified: firmware/fuxrf/trunk/misc.c =================================================================== --- firmware/fuxrf/trunk/misc.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/misc.c 2007-10-01 12:02:54 UTC (rev 561) @@ -15,9 +15,9 @@ //* Date: 31.01.06 * //* Description: Generates a delay. T(delay) = val * 10us * //***************************************************************************** -void wait_n_10us(uc_8 val) +void wait_n_10us(uint8_t val) { - uc_8 i, j; + uint8_t i, j; i = val; for (i = 0; i < val; i++) @@ -43,9 +43,9 @@ //* Date: 31.01.06 * //* Description: Random value needed for system setup * //***************************************************************************** -uc_8 get_random(void) +uint8_t get_random(void) { - uc_8 i, random; + uint8_t i, random; //init of the global variable random, this is done by using the noise //output of the RF-Chip when settlet up for receive without having @@ -87,9 +87,9 @@ //* Date: 10.07.06 * //* Description: Random channel value needed for frequency hopping * //***************************************************************************** -uc_8 get_random_channel(void) +uint8_t get_random_channel(void) { - uc_8 value; + uint8_t value; while (1) { @@ -120,8 +120,8 @@ //***************************************************************************** void calc_checksum(unsigned char *pbuffer) { - uc_8 i, tmp; - uc_8 *ptr; + uint8_t i, tmp; + uint8_t *ptr; ptr = pbuffer + 16; // Get address of start of RF frame if (*(pbuffer + 16) & SMALLFRAME) Modified: firmware/fuxrf/trunk/misc.h =================================================================== --- firmware/fuxrf/trunk/misc.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/misc.h 2007-10-01 12:02:54 UTC (rev 561) @@ -3,9 +3,9 @@ #include "defines.h" -extern void wait_n_10us(uc_8 val); -extern uc_8 get_random(void); -extern uc_8 get_random_channel(void); +extern void wait_n_10us(uint8_t val); +extern uint8_t get_random(void); +extern uint8_t get_random_channel(void); extern void calc_checksum(unsigned char *pbuffer); #endif Modified: firmware/fuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 12:02:54 UTC (rev 561) @@ -272,10 +272,10 @@ //* Description: Programms the ATR2406 to the desired channel and to the * //* desired mode. * //***************************************************************************** -void init_atr2406(uc_8 channel, uc_8 mode) +void init_atr2406(uint8_t channel, uint8_t mode) { - uc_8 i, dat_l, dat_h, tmp; - ui_16 conf_data; + uint8_t i, dat_l, dat_h, tmp; + uint16_t conf_data; set_nole; clr_data; @@ -304,9 +304,9 @@ } } dat_l |= 0x80; - conf_data = (uc_8) dat_h; + conf_data = (uint8_t) dat_h; conf_data = conf_data << 8; - conf_data += (uc_8) dat_l; + conf_data += (uint8_t) dat_l; for (i = 0; i < 16; i++) // Shift out configuration word { clr_clock; @@ -383,8 +383,8 @@ //--------------------------C-Source Code-------------------------------------* //*SIGNAL (SIG_USART_DATA) * //*{ * -//* uc_8 *ptr; * -//* uc_8 data; * +//* uint8_t *ptr; * +//* uint8_t data; * //* ptr = prf_buffer_tx; * //* ptr += rf_tx_counter; * //* rf_tx_counter++; * @@ -541,8 +541,8 @@ //*---------------------C-Source Code-----------------------------------------* //*SIGNAL_NAKED (SIG_USART_RECV) * //*{ * -//* uc_8 data,tmp; * -//* uc_8 *ptr; * +//* uint8_t data,tmp; * +//* uint8_t *ptr; * //* if (rf_rx_state == 0x03) // Receive data * //* { * //* ptr = prf_buffer_rx + rf_rx_counter * Modified: firmware/fuxrf/trunk/rf_ctrl.h =================================================================== --- firmware/fuxrf/trunk/rf_ctrl.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/rf_ctrl.h 2007-10-01 12:02:54 UTC (rev 561) @@ -46,7 +46,7 @@ #include "defines.h" -extern void init_atr2406(uc_8 channel, uc_8 mode); +extern void init_atr2406(uint8_t channel, uint8_t mode); extern void pwr_up_atr2406(void); extern void pwr_dwn_atr2406(void); extern void start_rf_timer(void); Modified: firmware/fuxrf/trunk/varis.c =================================================================== --- firmware/fuxrf/trunk/varis.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/varis.c 2007-10-01 12:02:54 UTC (rev 561) @@ -1,72 +1,72 @@ #include "defines.h" // RF buffer -uc_8 rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data -uc_8 rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data -uc_8 rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data -uc_8 rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data +uint8_t rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data +uint8_t rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data +uint8_t rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data +uint8_t rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data -uc_8 *prf_buffer_rx __attribute__ ((section(".globals"))); -uc_8 *pspi_buffer_rx __attribute__ ((section(".globals"))); -uc_8 *prf_buffer_tx __attribute__ ((section(".globals"))); -uc_8 *pspi_buffer_tx __attribute__ ((section(".globals"))); +uint8_t *prf_buffer_rx __attribute__ ((section(".globals"))); +uint8_t *pspi_buffer_rx __attribute__ ((section(".globals"))); +uint8_t *prf_buffer_tx __attribute__ ((section(".globals"))); +uint8_t *pspi_buffer_tx __attribute__ ((section(".globals"))); // SOF buffer -uc_8 sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame +uint8_t sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame -uc_8 rf_header[4] __attribute__ ((section(".globals"))); // Rf header +uint8_t rf_header[4] __attribute__ ((section(".globals"))); // Rf header // RF variables -uc_8 rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) -volatile uc_8 channel __attribute__ ((section(".globals"))); // Currently used RF - Channel -uc_8 rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine -uc_8 tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX -uc_8 rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX -uc_8 rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes -uc_8 rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes -uc_8 rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt -uc_8 checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay -ui_16 ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode -uc_8 rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag -uc_8 gfilter __attribute__ ((section(".globals"))); // Gaussian filter value +uint8_t rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) +volatile uint8_t channel __attribute__ ((section(".globals"))); // Currently used RF - Channel +uint8_t rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine +uint8_t tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX +uint8_t rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX +uint8_t rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes +uint8_t rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes +uint8_t rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt +uint8_t checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay +uint16_t ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode +uint8_t rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag +uint8_t gfilter __attribute__ ((section(".globals"))); // Gaussian filter value // Adaptive FHSS -uc_8 frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency -uc_8 frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency -uc_8 FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine -uc_8 frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame -uc_8 frequencyStatistic[20] __attribute__ ((section(".globals"))); // Table with statistic for FHA -ui_16 statisticPointer __attribute__ ((section(".globals"))); // Pointer for the table with statistic for FHA -uc_8 tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index -uc_8 replaceFrequency __attribute__ ((section(".globals"))); // Temporary index -uc_8 random_numb __attribute__ ((section(".globals"))); // Random number for FHA +uint8_t frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency +uint8_t frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency +uint8_t FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine +uint8_t frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame +uint8_t frequencyStatistic[20] __attribute__ ((section(".globals"))); // Table with statistic for FHA +uint16_t statisticPointer __attribute__ ((section(".globals"))); // Pointer for the table with statistic for FHA +uint8_t tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index +uint8_t replaceFrequency __attribute__ ((section(".globals"))); // Temporary index +uint8_t random_numb __attribute__ ((section(".globals"))); // Random number for FHA // SPI -uc_8 spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction +uint8_t spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction typedef enum { PUT_SOUND_SPI, PUT_COMMAND_SPI, PUT_STATUS_SPI, END_SPI } STM_SPI_SLAVE_MASTER_TYPE; STM_SPI_SLAVE_MASTER_TYPE spi_slave __attribute__ ((section(".globals"))); // SPI state machine variable -uc_8 spi_lenght __attribute__ ((section(".globals"))); // SPI legnht -uc_8 commandBuffer[4] __attribute__ ((section(".globals"))); // SPI command buffer -uc_8 spiConfigFrame[7] __attribute__ ((section(".globals"))); // SPI ID +uint8_t spi_lenght __attribute__ ((section(".globals"))); // SPI legnht +uint8_t commandBuffer[4] __attribute__ ((section(".globals"))); // SPI command buffer +uint8_t spiConfigFrame[7] __attribute__ ((section(".globals"))); // SPI ID // Redundancy variable -uc_8 errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission +uint8_t errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission // Command variables -uc_8 commandStatus __attribute__ ((section(".globals"))); // Status of the command -uc_8 commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command -uc_8 ACKmode __attribute__ ((section(".globals"))); // Wait an ACK +uint8_t commandStatus __attribute__ ((section(".globals"))); // Status of the command +uint8_t commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command +uint8_t ACKmode __attribute__ ((section(".globals"))); // Wait an ACK // Watchdog variable -uc_8 watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset +uint8_t watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset // RF toy ID -uc_8 toy_id_l __attribute__ ((section(".globals"))); // Toy ID -uc_8 toy_id_h __attribute__ ((section(".globals"))); +uint8_t toy_id_l __attribute__ ((section(".globals"))); // Toy ID +uint8_t toy_id_h __attribute__ ((section(".globals"))); -volatile uc_8 Test __attribute__ ((section(".globals"))); +volatile uint8_t Test __attribute__ ((section(".globals"))); // Eeprom variable unsigned char ee_filter __attribute__ ((section(".eeprom"))) = 7; Modified: firmware/fuxrf/trunk/varis.h =================================================================== --- firmware/fuxrf/trunk/varis.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/fuxrf/trunk/varis.h 2007-10-01 12:02:54 UTC (rev 561) @@ -4,72 +4,72 @@ #include "defines.h" // RF buffer -extern uc_8 rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data -extern uc_8 rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data -extern uc_8 rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data -extern uc_8 rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data +extern uint8_t rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data +extern uint8_t rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data +extern uint8_t rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data +extern uint8_t rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data -extern uc_8 *prf_buffer_rx __attribute__ ((section(".globals"))); -extern uc_8 *pspi_buffer_rx __attribute__ ((section(".globals"))); -extern uc_8 *prf_buffer_tx __attribute__ ((section(".globals"))); -extern uc_8 *pspi_buffer_tx __attribute__ ((section(".globals"))); +extern uint8_t *prf_buffer_rx __attribute__ ((section(".globals"))); +extern uint8_t *pspi_buffer_rx __attribute__ ((section(".globals"))); +extern uint8_t *prf_buffer_tx __attribute__ ((section(".globals"))); +extern uint8_t *pspi_buffer_tx __attribute__ ((section(".globals"))); -extern uc_8 rf_header[4] __attribute__ ((section(".globals"))); // Rf header +extern uint8_t rf_header[4] __attribute__ ((section(".globals"))); // Rf header // SOF buffer -extern uc_8 sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame +extern uint8_t sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame // RF variables -extern uc_8 rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) -extern volatile uc_8 channel __attribute__ ((section(".globals"))); // Currently used RF - Channel -extern uc_8 rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine -extern uc_8 tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX -extern uc_8 rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX -extern uc_8 rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes -extern uc_8 rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes -extern uc_8 rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt -extern uc_8 checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay -extern ui_16 ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode -extern uc_8 rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag -extern uc_8 gfilter __attribute__ ((section(".globals"))); // Gaussian filter value +extern uint8_t rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) +extern volatile uint8_t channel __attribute__ ((section(".globals"))); // Currently used RF - Channel +extern uint8_t rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine +extern uint8_t tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX +extern uint8_t rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX +extern uint8_t rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes +extern uint8_t rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes +extern uint8_t rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt +extern uint8_t checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay +extern uint16_t ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode +extern uint8_t rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag +extern uint8_t gfilter __attribute__ ((section(".globals"))); // Gaussian filter value // Adaptive FHSS -extern uc_8 frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency -extern uc_8 frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency -extern uc_8 FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine -extern uc_8 frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame -extern uc_8 frequencyStatistic[20] __attribute__ ((section(".globals"))); // Table with statistic for FHA -extern ui_16 statisticPointer __attribute__ ((section(".globals"))); // Pointer for the table with statistic for FHA -extern uc_8 tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index -extern uc_8 replaceFrequency __attribute__ ((section(".globals"))); // Temporary frequency -extern uc_8 random_numb __attribute__ ((section(".globals"))); // Random number for FHA +extern uint8_t frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency +extern uint8_t frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency +extern uint8_t FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine +extern uint8_t frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame +extern uint8_t frequencyStatistic[20] __attribute__ ((section(".globals"))); // Table with statistic for FHA +extern uint16_t statisticPointer __attribute__ ((section(".globals"))); // Pointer for the table with statistic for FHA +extern uint8_t tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index +extern uint8_t replaceFrequency __attribute__ ((section(".globals"))); // Temporary frequency +extern uint8_t random_numb __attribute__ ((section(".globals"))); // Random number for FHA // SPI -extern uc_8 spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction +extern uint8_t spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction typedef enum { PUT_SOUND_SPI, PUT_COMMAND_SPI, PUT_STATUS_SPI, END_SPI } STM_SPI_SLAVE_MASTER_TYPE; extern STM_SPI_SLAVE_MASTER_TYPE spi_slave __attribute__ ((section(".globals"))); // SPI state machine variable -extern uc_8 spi_lenght __attribute__ ((section(".globals"))); // SPI legnht -extern uc_8 commandBuffer[4] __attribute__ ((section(".globals"))); // SPI legnht -extern uc_8 spiConfigFrame[7] __attribute__ ((section(".globals"))); // SPI ID +extern uint8_t spi_lenght __attribute__ ((section(".globals"))); // SPI legnht +extern uint8_t commandBuffer[4] __attribute__ ((section(".globals"))); // SPI legnht +extern uint8_t spiConfigFrame[7] __attribute__ ((section(".globals"))); // SPI ID // Redundancy variable -extern uc_8 errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission +extern uint8_t errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission // Command variables -extern uc_8 commandStatus __attribute__ ((section(".globals"))); // Status of the command -extern uc_8 commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command -extern uc_8 ACKmode __attribute__ ((section(".globals"))); // Wait an ACK +extern uint8_t commandStatus __attribute__ ((section(".globals"))); // Status of the command +extern uint8_t commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command +extern uint8_t ACKmode __attribute__ ((section(".globals"))); // Wait an ACK // Watchdog variable -extern uc_8 watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset +extern uint8_t watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset // RF toy ID -extern uc_8 toy_id_l __attribute__ ((section(".globals"))); // Toy ID -extern uc_8 toy_id_h __attribute__ ((section(".globals"))); +extern uint8_t toy_id_l __attribute__ ((section(".globals"))); // Toy ID +extern uint8_t toy_id_h __attribute__ ((section(".globals"))); -extern volatile uc_8 Test __attribute__ ((section(".globals"))); +extern volatile uint8_t Test __attribute__ ((section(".globals"))); // Eeprom variable extern unsigned char ee_filter __attribute__ ((section(".eeprom"))); Modified: firmware/tuxrf/trunk/defines.h =================================================================== --- firmware/tuxrf/trunk/defines.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/defines.h 2007-10-01 12:02:54 UTC (rev 561) @@ -13,12 +13,6 @@ #define TRX_CHANNEL 90 #define FHA // Use frequency hopping adaptativ -// Type definition -#define uc_8 unsigned char -#define ui_16 unsigned int -#define sc_8 char -#define si_16 int - //------->rf_status-Defines<-------// #define WAIT_HOPPING 0x02 #define RXING 0x04 Modified: firmware/tuxrf/trunk/init.c =================================================================== --- firmware/tuxrf/trunk/init.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/init.c 2007-10-01 12:02:54 UTC (rev 561) @@ -89,15 +89,15 @@ //***************************************************************************** void init_varis(void) { - uc_8 i; + uint8_t i; i = input(SPL); i ^= 0xFF; - extern ui_16 __bss_start; - extern ui_16 __stack; - uc_8 *ptr = (uc_8 *) & __bss_start; + extern uint16_t __bss_start; + extern uint16_t __stack; + uint8_t *ptr = (uint8_t *) & __bss_start; - while (ptr < (uc_8 *) & __stack - i) + while (ptr < (uint8_t *) & __stack - i) { /*sub because of returning of subroutine */ *ptr++ = 0; } // Put the RAM to 0 Modified: firmware/tuxrf/trunk/misc.c =================================================================== --- firmware/tuxrf/trunk/misc.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/misc.c 2007-10-01 12:02:54 UTC (rev 561) @@ -15,9 +15,9 @@ //* Date: 31.01.06 * //* Description: Generates a delay. T(delay) = val * 10us * //***************************************************************************** -void wait_n_10us(uc_8 val) +void wait_n_10us(uint8_t val) { - uc_8 i, j; + uint8_t i, j; i = val; for (i = 0; i < val; i++) @@ -45,8 +45,8 @@ //***************************************************************************** void calc_checksum(unsigned char *pbuffer) { - uc_8 i, tmp; - uc_8 *ptr; + uint8_t i, tmp; + uint8_t *ptr; ptr = pbuffer + 16; // Get address of start of RF frame if (*(pbuffer + 16) & SMALLFRAME) Modified: firmware/tuxrf/trunk/misc.h =================================================================== --- firmware/tuxrf/trunk/misc.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/misc.h 2007-10-01 12:02:54 UTC (rev 561) @@ -3,7 +3,7 @@ #include "defines.h" -extern void wait_n_10us(uc_8 val); +extern void wait_n_10us(uint8_t val); extern void calc_checksum(unsigned char *pbuffer); #endif Modified: firmware/tuxrf/trunk/prot.c =================================================================== --- firmware/tuxrf/trunk/prot.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/prot.c 2007-10-01 12:02:54 UTC (rev 561) @@ -22,7 +22,7 @@ { unsigned char i, out, sleepCmpt; unsigned char RFinitState; // Init state machine variable - ui_16 j; + uint16_t j; rf_status |= SLAVE; // Set rf status like slave out = 0; // Variable to control init loop Modified: firmware/tuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 12:02:54 UTC (rev 561) @@ -255,10 +255,10 @@ //* Description: Programms the ATR2406 to the desired channel and to the * //* desired mode. * //***************************************************************************** -void init_atr2406(uc_8 channel, uc_8 mode) +void init_atr2406(uint8_t channel, uint8_t mode) { - uc_8 i, dat_l, dat_h, tmp; - ui_16 conf_data; + uint8_t i, dat_l, dat_h, tmp; + uint16_t conf_data; set_nole; clr_data; @@ -287,9 +287,9 @@ } } dat_l |= 0x80; - conf_data = (uc_8) dat_h; + conf_data = (uint8_t) dat_h; conf_data = conf_data << 8; - conf_data += (uc_8) dat_l; + conf_data += (uint8_t) dat_l; for (i = 0; i < 16; i++) // Shift out configuration word { clr_clock; @@ -366,8 +366,8 @@ //--------------------------C-Source Code-------------------------------------* //*SIGNAL (SIG_USART_DATA) * //*{ * -//* uc_8 *ptr; * -//* uc_8 data; * +//* uint8_t *ptr; * +//* uint8_t data; * //* ptr = prf_buffer_tx; * //* ptr += rf_tx_counter; * //* rf_tx_counter++; * @@ -524,8 +524,8 @@ //*---------------------C-Source Code-----------------------------------------* //*SIGNAL_NAKED (SIG_USART_RECV) * //*{ * -//* uc_8 data,tmp; * -//* uc_8 *ptr; * +//* uint8_t data,tmp; * +//* uint8_t *ptr; * //* if (rf_rx_state == 0x03) // Receive data * //* { * //* ptr = prf_buffer_rx + rf_rx_counter * Modified: firmware/tuxrf/trunk/rf_ctrl.h =================================================================== --- firmware/tuxrf/trunk/rf_ctrl.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/rf_ctrl.h 2007-10-01 12:02:54 UTC (rev 561) @@ -46,7 +46,7 @@ #include "defines.h" -extern void init_atr2406(uc_8 channel, uc_8 mode); +extern void init_atr2406(uint8_t channel, uint8_t mode); extern void pwr_up_atr2406(void); extern void pwr_dwn_atr2406(void); extern void start_rf_timer(void); Modified: firmware/tuxrf/trunk/varis.c =================================================================== --- firmware/tuxrf/trunk/varis.c 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/varis.c 2007-10-01 12:02:54 UTC (rev 561) @@ -1,71 +1,71 @@ #include "defines.h" // RF buffer -uc_8 rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data -uc_8 rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data -uc_8 rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data -uc_8 rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data +uint8_t rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data +uint8_t rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data +uint8_t rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data +uint8_t rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data -uc_8 *prf_buffer_rx __attribute__ ((section(".globals"))); -uc_8 *pspi_buffer_rx __attribute__ ((section(".globals"))); -uc_8 *prf_buffer_tx __attribute__ ((section(".globals"))); -uc_8 *pspi_buffer_tx __attribute__ ((section(".globals"))); +uint8_t *prf_buffer_rx __attribute__ ((section(".globals"))); +uint8_t *pspi_buffer_rx __attribute__ ((section(".globals"))); +uint8_t *prf_buffer_tx __attribute__ ((section(".globals"))); +uint8_t *pspi_buffer_tx __attribute__ ((section(".globals"))); // SOF buffer -uc_8 sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame +uint8_t sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame // RF variables -uc_8 rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) -volatile uc_8 channel __attribute__ ((section(".globals"))); // Currently used RF - Channel -uc_8 rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine -uc_8 tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX -uc_8 rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX -uc_8 rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes -uc_8 rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes -uc_8 rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt -uc_8 checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay -ui_16 ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode -uc_8 rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag -uc_8 gfilter __attribute__ ((section(".globals"))); // Gaussian filter value +uint8_t rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) +volatile uint8_t channel __attribute__ ((section(".globals"))); // Currently used RF - Channel +uint8_t rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine +uint8_t tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX +uint8_t rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX +uint8_t rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes +uint8_t rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes +uint8_t rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt +uint8_t checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay +uint16_t ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode +uint8_t rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag +uint8_t gfilter __attribute__ ((section(".globals"))); // Gaussian filter value // Adaptive FHSS -uc_8 frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency -uc_8 frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency -uc_8 FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine -uc_8 frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame -uc_8 tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index -uc_8 replaceFrequency __attribute__ ((section(".globals"))); // Temporary index +uint8_t frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency +uint8_t frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency +uint8_t FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine +uint8_t frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame +uint8_t tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index +uint8_t replaceFrequency __attribute__ ((section(".globals"))); // Temporary index // SPI -uc_8 spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction +uint8_t spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction typedef enum { PUT_SOUND_SPI, PUT_COMMAND_SPI, PUT_STATUS_SPI, END_SPI } STM_SPI_SLAVE_MASTER_TYPE; STM_SPI_SLAVE_MASTER_TYPE spi_slave __attribute__ ((section(".globals"))); // SPI state machine variable -uc_8 spi_lenght __attribute__ ((section(".globals"))); // SPI legnht -uc_8 commandBuffer[4] __attribute__ ((section(".globals"))); // SPI legnht +uint8_t spi_lenght __attribute__ ((section(".globals"))); // SPI legnht +uint8_t commandBuffer[4] __attribute__ ((section(".globals"))); // SPI legnht // Redundancy variable -uc_8 errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission +uint8_t errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission // Command variables -uc_8 commandStatus __attribute__ ((section(".globals"))); // Status of the command -uc_8 commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command -uc_8 ACKmode __attribute__ ((section(".globals"))); // Wait an ACK +uint8_t commandStatus __attribute__ ((section(".globals"))); // Status of the command +uint8_t commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command +uint8_t ACKmode __attribute__ ((section(".globals"))); // Wait an ACK // Watchdog variable -uc_8 watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset +uint8_t watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset // RF toy ID -uc_8 toy_id_l __attribute__ ((section(".globals"))); // Toy ID -uc_8 toy_id_h __attribute__ ((section(".globals"))); -uc_8 requestID __attribute__ ((section(".globals"))); -uc_8 changeID __attribute__ ((section(".globals"))); -volatile uc_8 Test __attribute__ ((section(".globals"))); // Test +uint8_t toy_id_l __attribute__ ((section(".globals"))); // Toy ID +uint8_t toy_id_h __attribute__ ((section(".globals"))); +uint8_t requestID __attribute__ ((section(".globals"))); +uint8_t changeID __attribute__ ((section(".globals"))); +volatile uint8_t Test __attribute__ ((section(".globals"))); // Test // Sleep mode -volatile uc_8 sleepMode __attribute__ ((section(".globals"))); // Sleep mode flag +volatile uint8_t sleepMode __attribute__ ((section(".globals"))); // Sleep mode flag // Eeprom variable unsigned char ee_filter __attribute__ ((section(".eeprom"))) = 5; Modified: firmware/tuxrf/trunk/varis.h =================================================================== --- firmware/tuxrf/trunk/varis.h 2007-10-01 10:43:21 UTC (rev 560) +++ firmware/tuxrf/trunk/varis.h 2007-10-01 12:02:54 UTC (rev 561) @@ -4,72 +4,72 @@ #include "defines.h" // RF buffer -extern uc_8 rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data -extern uc_8 rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data -extern uc_8 rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data -extern uc_8 rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data +extern uint8_t rf_buffer_tx1[64] __attribute__ ((section(".buffer_tx1"))); // Buffer for storing the RF TX data +extern uint8_t rf_buffer_rx1[51] __attribute__ ((section(".buffer_rx1"))); // Buffer for storing the RF RX data +extern uint8_t rf_buffer_tx2[64] __attribute__ ((section(".buffer_tx2"))); // Buffer for storing the RF TX data +extern uint8_t rf_buffer_rx2[51] __attribute__ ((section(".buffer_rx2"))); // Buffer for storing the RF RX data -extern uc_8 *prf_buffer_rx __attribute__ ((section(".globals"))); -extern uc_8 *pspi_buffer_rx __attribute__ ((section(".globals"))); -extern uc_8 *prf_buffer_tx __attribute__ ((section(".globals"))); -extern uc_8 *pspi_buffer_tx __attribute__ ((section(".globals"))); +extern uint8_t *prf_buffer_rx __attribute__ ((section(".globals"))); +extern uint8_t *pspi_buffer_rx __attribute__ ((section(".globals"))); +extern uint8_t *prf_buffer_tx __attribute__ ((section(".globals"))); +extern uint8_t *pspi_buffer_tx __attribute__ ((section(".globals"))); // SOF buffer -extern uc_8 sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame +extern uint8_t sof_ary[3] __attribute__ ((section(".sof"))); // Variable holding the 4 bytes start of frame // RF variables -extern uc_8 rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) -extern volatile uc_8 channel __attribute__ ((section(".globals"))); // Currently used RF - Channel -extern uc_8 rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine -extern uc_8 tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX -extern uc_8 rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX -extern uc_8 rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes -extern uc_8 rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes -extern uc_8 rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt -extern uc_8 checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay -extern ui_16 ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode -extern uc_8 rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag -extern uc_8 gfilter __attribute__ ((section(".globals"))); // Gaussian filter value +extern uint8_t rf_status __attribute__ ((section(".globals"))); // Satus of the RF - Task (Locked or Unlocked) +extern volatile uint8_t channel __attribute__ ((section(".globals"))); // Currently used RF - Channel +extern uint8_t rfStateCount __attribute__ ((section(".globals"))); // Counter for RF-IRQ-State machine +extern uint8_t tx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet TX +extern uint8_t rx_pac_len __attribute__ ((section(".globals"))); // Variable containing the length of the current RF - Packet RX +extern uint8_t rf_tx_counter __attribute__ ((section(".globals"))); // Counting the TX'ed bytes +extern uint8_t rf_rx_counter __attribute__ ((section(".globals"))); // Counting the RX'ed bytes +extern uint8_t rf_rx_state __attribute__ ((section(".globals"))); // State of the RX interrupt +extern uint8_t checksum __attribute__ ((section(".globals"))); // Checksum => 0x00 => okay +extern uint16_t ts __attribute__ ((section(".globals"))); // Timestamp for resynchronisation, if in synchronous mode +extern uint8_t rx_buffer_ready __attribute__ ((section(".globals"))); // Correct frame recieve flag +extern uint8_t gfilter __attribute__ ((section(".globals"))); // Gaussian filter value // Adaptive FHSS -extern uc_8 frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency -extern uc_8 frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency -extern uc_8 FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine -extern uc_8 frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame -extern uc_8 tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index -extern uc_8 replaceFrequency __attribute__ ((section(".globals"))); // Temporary frequency +extern uint8_t frequencyTable[20] __attribute__ ((section(".globals"))); // Table with the scheme of frequency +extern uint8_t frequencyIndex __attribute__ ((section(".globals"))); // Pointer for the table of frequency +extern uint8_t FHAState __attribute__ ((section(".globals"))); // Status of FHA state machine +extern uint8_t frameCmpt __attribute__ ((section(".globals"))); // Counter of RF frame +extern uint8_t tempoIndexFreq __attribute__ ((section(".globals"))); // Temporary index +extern uint8_t replaceFrequency __attribute__ ((section(".globals"))); // Temporary frequency // SPI -extern uc_8 spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction +extern uint8_t spi_enable __attribute__ ((section(".globals"))); // Flag to start spi transaction typedef enum { PUT_SOUND_SPI, PUT_COMMAND_SPI, PUT_STATUS_SPI, END_SPI } STM_SPI_SLAVE_MASTER_TYPE; extern STM_SPI_SLAVE_MASTER_TYPE spi_slave __attribute__ ((section(".globals"))); // SPI state machine variable -extern uc_8 spi_lenght __attribute__ ((section(".globals"))); // SPI legnht -extern uc_8 commandBuffer[4] __attribute__ ((section(".globals"))); // SPI legnht +extern uint8_t spi_lenght __attribute__ ((section(".globals"))); // SPI legnht +extern uint8_t commandBuffer[4] __attribute__ ((section(".globals"))); // SPI legnht // Redundancy variable -extern uc_8 errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission +extern uint8_t errorFrame __attribute__ ((section(".globals"))); // Detect error in transmission // Command variables -extern uc_8 commandStatus __attribute__ ((section(".globals"))); // Status of the command -extern uc_8 commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command -extern uc_8 ACKmode __attribute__ ((section(".globals"))); // Wait an ACK +extern uint8_t commandStatus __attribute__ ((section(".globals"))); // Status of the command +extern uint8_t commandCmpt __attribute__ ((section(".globals"))); // Counter for resend command +extern uint8_t ACKmode __attribute__ ((section(".globals"))); // Wait an ACK // Watchdog variable -extern uc_8 watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset +extern uint8_t watchdog __attribute__ ((section(".globals"))); // Watchdog for auto reset // RF toy ID -extern uc_8 toy_id_l __attribute__ ((section(".globals"))); // Toy ID -extern uc_8 toy_id_h __attribute__ ((section(".globals"))); -extern uc_8 requestID __attribute__ ((section(".globals"))); -extern uc_8 changeID __attribute__ ((section(".globals"))); +extern uint8_t toy_id_l __attribute__ ((section(".globals"))); // Toy ID +extern uint8_t toy_id_h __attribute__ ((section(".globals"))); +extern uint8_t requestID __attribute__ ((section(".globals"))); +extern uint8_t changeID __attribute__ ((section(".globals"))); -extern volatile uc_8 Test __attribute__ ((section(".globals"))); // Test +extern volatile uint8_t Test __attribute__ ((section(".globals"))); // Test // Sleep mode -extern volatile uc_8 sleepMode __attribute__ ((section(".globals"))); // Sleep mode flag +extern volatile uint8_t sleepMode __attribute__ ((section(".globals"))); // Sleep mode flag // Eeprom variable extern unsigned char ee_filter __attribute__ ((section(".eeprom"))); |
From: jaguarondi <c2m...@c2...> - 2007-10-01 10:43:22
|
Author: jaguarondi Date: 2007-10-01 12:43:21 +0200 (Mon, 01 Oct 2007) New Revision: 560 Modified: firmware/fuxrf/trunk/bootloader.h firmware/fuxrf/trunk/rf_ctrl.c firmware/tuxrf/trunk/bootloader.h firmware/tuxrf/trunk/device.c firmware/tuxrf/trunk/prot.c firmware/tuxrf/trunk/rf_ctrl.c firmware/tuxrf/trunk/sleep.c firmware/tuxrf/trunk/spi.c Log: * Removed spaces at EOL. Modified: firmware/fuxrf/trunk/bootloader.h =================================================================== --- firmware/fuxrf/trunk/bootloader.h 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/fuxrf/trunk/bootloader.h 2007-10-01 10:43:21 UTC (rev 560) @@ -5,7 +5,7 @@ * Bootloader source code * created on 2006/11/25 David Bourgeois * ------------------------------------------------------------------- - * $Id: bootloader.h 456 2007-06-26 14:12:36Z jaguarondi + * $Id: bootloader.h 456 2007-06-26 14:12:36Z jaguarondi */ #ifndef _BOOTLOADER_H_ Modified: firmware/fuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 10:43:21 UTC (rev 560) @@ -27,7 +27,7 @@ //***************************************************************************** SIGNAL(SIG_OUTPUT_COMPARE1A) { - rfStateCount++; // Increment state machine counter + rfStateCount++; // Increment state machine counter if (rfStateCount == 0x01) // Start ATR2406 { @@ -73,9 +73,9 @@ { // --> Critical timing section. Don't add code! <-- output(OCR1A, input(OCR1A) + T_LOOP_TX); // Update timer (120 S). - init_atr2406(channel, TXEN); // Configure ATR2406 to desired channel. + init_atr2406(channel, TXEN); // Configure ATR2406 to desired channel. // --> End of critical timing section <-- - *(prf_buffer_tx + 13) = channel; // Save current channel into the frame + *(prf_buffer_tx + 13) = channel; // Save current channel into the frame if (rf_status & LOGGED) setup_pac(); // Build packet if (*(prf_buffer_tx + 16) & SMALLFRAME) // Calculate packet lenght @@ -97,7 +97,7 @@ // --> Critical timing section. Don't add code! <-- output(OCR1A, (input(OCR1A) + T_TX2RX)); // Update timer (804 S) rf_tx_counter = 0x00; // Reset the pointer of frame - output(UCSR0C, 0x46); // Synchronous usart + 8 bits + output(UCSR0C, 0x46); // Synchronous usart + 8 bits output(UCSR0B, 0x28); // Interrupt enable if empty + Transmit enable output(UDR0, 0x55); // Start transmission of the packet output(UDR0, 0x55); // Double buffered!! @@ -107,7 +107,7 @@ { // --> Critical timing section. Don't add code! <-- output(OCR1A, input(OCR1A) + T_PWR_UP_RX); // Update timer (40 S) - pwr_up_atr2406(); // Start ATR2406 + pwr_up_atr2406(); // Start ATR2406 // --> End of critical timing section <-- #ifndef HOPPING channel = TRX_CHANNEL; // Set the channel @@ -119,7 +119,7 @@ output(OCR1A, input(OCR1A) + T_LOOP_RX); // Update timer (80 S) init_atr2406(channel, RXEN); // Configure ATR2406 to desired channel output(DDRD, input(DDRD) & 0xEF); // XCK PIN set to input!! - // --> End of critical timing section <-- + // --> End of critical timing section <-- #ifdef FHA if ((rf_status & FHA_EFFECTIVE) && (statisticPointer == 0)) // Analyse channel statistic frequencyStatistic[frequencyIndex] = 0; // Reset statistic @@ -143,7 +143,7 @@ output(OCR1A, input(OCR1A) + T_MAX_PAC_RX); // Update timer (650 S) output(UCSR0A, 0x00); // Reset usart output(UCSR0B, 0x90); // Interrupt on RX complete + RX enable - output(UCSR0C, 0x46); // Synchronous usart + 8 bits + output(UCSR0C, 0x46); // Synchronous usart + 8 bits // --> End of critical timing section <-- } else if (rfStateCount == 0x09) // Wait RX complete and resync @@ -255,8 +255,8 @@ output(TCNT1L, 0x00); output(TCCR1A, 0x00); output(TCCR1B, 0x02); // Clocksource enabled at system clock /8 ==> 1 click == 578,703ns - output(TIMSK1, 0x02); // Enable compare A irq - output(TIFR1, 0x02); // Match when timer = compare A register + output(TIMSK1, 0x02); // Enable compare A irq + output(TIFR1, 0x02); // Match when timer = compare A register } //***************************************************************************** @@ -554,7 +554,7 @@ //* if (data & 0x80) * //* rx_pac_len = 0x06; * //* else * -//* rx_pac_len = 0x30; * +//* rx_pac_len = 0x30; * //* if (rf_rx_counter == rx_pac_len) * //* { * //* rf_rx_state = 0xFF; * @@ -563,7 +563,7 @@ //* output(UCSR0C,0x00); * //* PU_PWR = 0; * //* RXON = 0; * -//* ENABLE = 0; * +//* ENABLE = 0; * //* } * //* else // Check for SOF * //* { * @@ -579,7 +579,7 @@ //* else // Reset rx state machine * //* { * //* rf_rx_state = 0x00; * -//* } * +//* } * //* } * //* * //*} * Modified: firmware/tuxrf/trunk/bootloader.h =================================================================== --- firmware/tuxrf/trunk/bootloader.h 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/tuxrf/trunk/bootloader.h 2007-10-01 10:43:21 UTC (rev 560) @@ -5,7 +5,7 @@ * Bootloader source code * created on 2006/11/25 David Bourgeois * ------------------------------------------------------------------- - * $Id: bootloader.h 456 2007-06-26 14:12:36Z jaguarondi + * $Id: bootloader.h 456 2007-06-26 14:12:36Z jaguarondi */ #ifndef _BOOTLOADER_H_ Modified: firmware/tuxrf/trunk/device.c =================================================================== --- firmware/tuxrf/trunk/device.c 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/tuxrf/trunk/device.c 2007-10-01 10:43:21 UTC (rev 560) @@ -56,7 +56,7 @@ { if (MCUSR & 0x01) // Power on reset from protection only very useful???? { - eeprom_write_byte(&ee_sleepMode, 0xFF); // Cancel the sleeep mode + eeprom_write_byte(&ee_sleepMode, 0xFF); // Cancel the sleeep mode } MCUSR = 0; // Watchdog disable wdt_disable(); @@ -73,7 +73,7 @@ asm volatile ("rjmp bootloader"::); /* jump to bootloader */ #endif - init_toy_id(); // Init the id for RF communication + init_toy_id(); // Init the id for RF communication init_frame_RF(); // Init RF frame sei(); gfilter = eeprom_read_byte(&ee_filter); // Read gaussian filter into the eeprom @@ -91,7 +91,7 @@ { if (changeID) // Change ID request { - _delay_ms(5000); // Wait 5 sec + _delay_ms(5000); // Wait 5 sec if (!(PIND & 0x40)) // Head button is pushed { eeprom_write_byte(&ee_toy_id_h, toy_id_h); // Write toy id into the eeprom Modified: firmware/tuxrf/trunk/prot.c =================================================================== --- firmware/tuxrf/trunk/prot.c 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/tuxrf/trunk/prot.c 2007-10-01 10:43:21 UTC (rev 560) @@ -103,7 +103,7 @@ _delay_ms(300); // Wait 300 msec PORTD &= ~0x40; // Stop sending signal of wake up DDRD |= 0x40; // Reconfigure PORTD.6 as input - sleepMode = 0xFF; // Reset sleepMode + sleepMode = 0xFF; // Reset sleepMode resetCPU(); } @@ -183,7 +183,7 @@ if (FHAState & SEND_ACK) // Sending ACK, waiting frame counter { rf_buffer_tx1[16] = rf_buffer_tx2[16] |= FHAACKH; // Send ACK to Master - if (rx_buffer_ready) // Valid receive frame + if (rx_buffer_ready) // Valid receive frame { rx_buffer_ready = 0x00; // Reset recieve flag frameCmpt = *(pspi_buffer_rx + 6) + 1; @@ -204,7 +204,7 @@ } else if (FHAState & INIT) // Wait frequency sequence { - if (rx_buffer_ready) // Valid receive frame + if (rx_buffer_ready) // Valid receive frame { rx_buffer_ready = 0x00; // Reset recieve flag if (*(pspi_buffer_rx) & FHTRSEQ) @@ -267,7 +267,7 @@ { // Go to sleep mode, otherwise is deep sleep sleepMode = 0x03; // Sleep + Sleep activated } - commandBuffer[3] = 0x01; // RF ACK + commandBuffer[3] = 0x01; // RF ACK } for (i = 0; i < 4; i++) // Copy command into the frame *(pbuffer_tx + 23 + i) = commandBuffer[i]; Modified: firmware/tuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 10:43:21 UTC (rev 560) @@ -24,7 +24,7 @@ //***************************************************************************** SIGNAL(SIG_OUTPUT_COMPARE1A) { - rfStateCount++; // Increment state machine counter + rfStateCount++; // Increment state machine counter if (rfStateCount == 0x01) // Start ATR2406 { @@ -36,12 +36,12 @@ channel = TRX_CHANNEL; // Set the channel #endif } - else if (rfStateCount == 0x02) // Config ATR2406 + else if (rfStateCount == 0x02) // Config ATR2406 { // --> Critical timing section. Don't add code! <-- output(OCR1A, input(OCR1A) + T_LOOP_TX); // Update timer (120 S) - init_atr2406(channel, TXEN); // Configure ATR2406 to desired channel. - // --> End of critical timing section <-- + init_atr2406(channel, TXEN); // Configure ATR2406 to desired channel. + // --> End of critical timing section <-- if (rf_status & LOGGED) setup_pac(); // Build packet if (*(prf_buffer_tx + 16) & SMALLFRAME) // Calculate packet lenght @@ -63,7 +63,7 @@ // --> Critical timing section. Don't add code! <-- output(OCR1A, (input(OCR1A) + T_TX2RX)); // Update timer (804 S) rf_tx_counter = 0x00; // Reset the pointer of frame - output(UCSR0C, 0x46); // Synchronous usart + 8 bits + output(UCSR0C, 0x46); // Synchronous usart + 8 bits output(UCSR0B, 0x28); // Interrupt enable if empty + Transmit enable output(UDR0, 0x55); // Start transmission of the packet output(UDR0, 0x55); // Double buffered!! @@ -73,7 +73,7 @@ { // --> Critical timing section. Don't add code! <-- output(OCR1A, input(OCR1A) + T_PWR_UP_RX); // Update timer (40 S) - pwr_up_atr2406(); // Start ATR2406 + pwr_up_atr2406(); // Start ATR2406 // --> End of critical timing section <-- #ifndef HOPPING channel = TRX_CHANNEL; // Set the channel @@ -112,7 +112,7 @@ output(OCR1A, input(OCR1A) + T_LOOP_RX); // Update timer (80 S) init_atr2406(channel, RXEN); // Configure ATR2406 to desired channel output(DDRD, input(DDRD) & 0xEF); // XCK PIN set to input!! - // --> End of critical timing section <-- + // --> End of critical timing section <-- rf_rx_counter = 0x00; // Reset the pointer of frame rf_rx_state = 0x00; // Reset RX state machine rx_buffer_ready = 0x00; // Reset ready rx buffer flag @@ -132,12 +132,12 @@ output(OCR1A, input(OCR1A) + T_MAX_PAC_RX); // Update timer (650 S) output(UCSR0A, 0x00); // Reset usart output(UCSR0B, 0x90); // Interrupt on RX complete + RX enable - output(UCSR0C, 0x46); // Synchronous usart + 8 bits + output(UCSR0C, 0x46); // Synchronous usart + 8 bits // --> End of critical timing section <-- } else if (rfStateCount == 0x09) // Wait RX complete and resync { - // --> Critical timing section. Don't add code! <-- + // --> Critical timing section. Don't add code! <-- output(UCSR0A, 0x00); // Reset Usart output(UCSR0B, 0x00); output(UCSR0C, 0x00); @@ -216,8 +216,8 @@ output(TCNT1L, 0x00); output(TCCR1A, 0x00); output(TCCR1B, 0x02); // Clocksource enabled at system clock /8 ==> 1 click == 578,703ns - output(TIMSK1, 0x02); // Enable compare A irq - output(TIFR1, 0x02); // Match when timer = compare A register + output(TIMSK1, 0x02); // Enable compare A irq + output(TIFR1, 0x02); // Match when timer = compare A register } //***************************************************************************** @@ -537,7 +537,7 @@ //* if (data & 0x80) * //* rx_pac_len = 0x06; * //* else * -//* rx_pac_len = 0x30; * +//* rx_pac_len = 0x30; * //* if (rf_rx_counter == rx_pac_len) * //* { * //* rf_rx_state = 0xFF; * @@ -546,7 +546,7 @@ //* output(UCSR0C,0x00); * //* PU_PWR = 0; * //* RXON = 0; * -//* ENABLE = 0; * +//* ENABLE = 0; * //* } * //* else // Check for SOF * //* { * @@ -562,7 +562,7 @@ //* else // Reset rx state machine * //* { * //* rf_rx_state = 0x00; * -//* } * +//* } * //* } * //* * //*} * Modified: firmware/tuxrf/trunk/sleep.c =================================================================== --- firmware/tuxrf/trunk/sleep.c 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/tuxrf/trunk/sleep.c 2007-10-01 10:43:21 UTC (rev 560) @@ -8,7 +8,7 @@ //* Parameters: NONE * //* Returns: NONE * //* Action: Reset the CPU * -//* Duration: tbd * +//* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * //* Description: Reset the CPU using the watchdog * @@ -26,7 +26,7 @@ //* Parameters: NONE * //* Returns: NONE * //* Action: Go to sleep mode * -//* Duration: tbd * +//* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * //* Description: Configure type of sleep mode and execute it * @@ -39,7 +39,7 @@ { eeprom_write_byte(&ee_sleepMode, 0x03); // Write sleep mode state wdt_reset(); - WDTCSR |= 0x40; // Enable watchdog interrupt + WDTCSR |= 0x40; // Enable watchdog interrupt } _delay_ms(2); // Wait 2 msec @@ -60,7 +60,7 @@ //* Parameters: NONE * //* Returns: NONE * //* Action: Disable wathdog timer * -//* Duration: tbd * +//* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * //* Description: Interrupt to go out of sleep * Modified: firmware/tuxrf/trunk/spi.c =================================================================== --- firmware/tuxrf/trunk/spi.c 2007-10-01 10:38:14 UTC (rev 559) +++ firmware/tuxrf/trunk/spi.c 2007-10-01 10:43:21 UTC (rev 560) @@ -9,7 +9,7 @@ //* Parameters: NONE * //* Returns: NONE * //* Action: Manage the SPI transaction * -//* Duration: tbd * +//* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * //* Description: Send and receive sound / command via the SPI * @@ -110,7 +110,7 @@ if (commandStatus != 0x00) // No need of protection from interrupt, timing protected { - headerb |= 0x08; // Status in SPI frame + headerb |= 0x08; // Status in SPI frame spi_config_tx |= 0x10; } |
From: jaguarondi <c2m...@c2...> - 2007-10-01 10:38:16
|
Author: jaguarondi Date: 2007-10-01 12:38:14 +0200 (Mon, 01 Oct 2007) New Revision: 559 Modified: firmware/fuxrf/trunk/bootloader.c firmware/fuxrf/trunk/bootloader.h firmware/fuxrf/trunk/defines.h firmware/fuxrf/trunk/device.c firmware/fuxrf/trunk/init.c firmware/fuxrf/trunk/init.h firmware/fuxrf/trunk/misc.c firmware/fuxrf/trunk/misc.h firmware/fuxrf/trunk/prot.c firmware/fuxrf/trunk/prot.h firmware/fuxrf/trunk/rf_ctrl.c firmware/fuxrf/trunk/rf_ctrl.h firmware/fuxrf/trunk/spi.c firmware/fuxrf/trunk/varis.c firmware/fuxrf/trunk/varis.h firmware/tuxrf/trunk/bootloader.c firmware/tuxrf/trunk/bootloader.h firmware/tuxrf/trunk/defines.h firmware/tuxrf/trunk/device.c firmware/tuxrf/trunk/init.c firmware/tuxrf/trunk/init.h firmware/tuxrf/trunk/misc.c firmware/tuxrf/trunk/misc.h firmware/tuxrf/trunk/prot.c firmware/tuxrf/trunk/prot.h firmware/tuxrf/trunk/rf_ctrl.c firmware/tuxrf/trunk/rf_ctrl.h firmware/tuxrf/trunk/sleep.c firmware/tuxrf/trunk/sleep.h firmware/tuxrf/trunk/spi.c firmware/tuxrf/trunk/varis.c firmware/tuxrf/trunk/varis.h firmware/tuxrf/trunk/version.h Log: * Reindented with: indent -nut -i4 -bad -bap -sob -sc -bl -bli0 -cli0 -cbi4 -nce -ncdw -ss -bls -npsl -ncs -npcs -nprs -saf -sai -saw -nbfda -nhnl -l80 Modified: firmware/fuxrf/trunk/bootloader.c =================================================================== --- firmware/fuxrf/trunk/bootloader.c 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/bootloader.c 2007-10-01 10:38:14 UTC (rev 559) @@ -29,23 +29,28 @@ TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); for (;;) { - i2cWaitForComplete(); /* wait the I2C address */ - if ((twStatus = TW_STATUS) != TW_SR_SLA_ACK) while(1); + i2cWaitForComplete(); /* wait the I2C address */ + if ((twStatus = TW_STATUS) != TW_SR_SLA_ACK) + while (1) ; TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); - i2cWaitForComplete(); /* wait the high byte of the page address */ - if ((twStatus = TW_STATUS) != TW_SR_DATA_ACK) while(1); + i2cWaitForComplete(); /* wait the high byte of the page address */ + if ((twStatus = TW_STATUS) != TW_SR_DATA_ACK) + while (1) ; pageAddress.b[1] = TWDR; TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); - i2cWaitForComplete(); /* wait the low byte of the page address */ - if ((twStatus = TW_STATUS) != TW_SR_DATA_ACK) while(1); + i2cWaitForComplete(); /* wait the low byte of the page address */ + if ((twStatus = TW_STATUS) != TW_SR_DATA_ACK) + while (1) ; pageAddress.b[0] = TWDR; - if (pageAddress.w & 0x003F) while(1); /* incorrect page address */ - if (pageAddress.w >= 0x0F00) while(1); /* don't overwrite the bootloader */ + if (pageAddress.w & 0x003F) + while (1) ; /* incorrect page address */ + if (pageAddress.w >= 0x0F00) + while (1) ; /* don't overwrite the bootloader */ address = pageAddress.w; TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); - for (i=0; i<SPM_PAGESIZE; i++) /* fill the complete page with the next data */ + for (i = 0; i < SPM_PAGESIZE; i++) /* fill the complete page with the next data */ { - i2cWaitForComplete(); /* wait data */ + i2cWaitForComplete(); /* wait data */ if ((twStatus = TW_STATUS) == TW_SR_DATA_ACK) { if ((i & 0x01) == 0) @@ -55,22 +60,24 @@ else { data.b[1] = TWDR; - boot_page_fill (address, data.w); + boot_page_fill(address, data.w); address += 2; } TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); } - else while(1); /* error in communication */ + else + while (1) ; /* error in communication */ } i2cWaitForComplete(); - if ((twStatus = TW_STATUS) != TW_SR_STOP) while(1); /* if no stop at this exact position, there's something wrong with the number of bytes sent, we cancel */ - TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); /* clear the interrupt immediately so not to miss the next frame */ - boot_page_erase (pageAddress.w); - boot_page_write (pageAddress.w); /* Store buffer in flash page */ + if ((twStatus = TW_STATUS) != TW_SR_STOP) + while (1) ; /* if no stop at this exact position, there's something wrong with the number of bytes sent, we cancel */ + TWCR = _BV(TWEA) | _BV(TWEN) | _BV(TWINT); /* clear the interrupt immediately so not to miss the next frame */ + boot_page_erase(pageAddress.w); + boot_page_write(pageAddress.w); /* Store buffer in flash page */ } } void i2cWaitForComplete(void) { - while( !(TWCR & _BV(TWINT)) ); /* wait for i2c interface to complete operation */ + while (!(TWCR & _BV(TWINT))) ; /* wait for i2c interface to complete operation */ } Modified: firmware/fuxrf/trunk/bootloader.h =================================================================== --- firmware/fuxrf/trunk/bootloader.h 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/bootloader.h 2007-10-01 10:38:14 UTC (rev 559) @@ -1,3 +1,4 @@ + /* KySoH's iTux agent Copyright (c) 2006, C2ME S.A. All rights reserved. @@ -40,7 +41,8 @@ */ #define I2C_BL_TWAR (0X33 << 1) -void bootloader(void) __attribute__ ((section (".bootloader"))) __attribute__ ((naked)); -void i2cWaitForComplete(void) __attribute__ ((section (".bootloader"))); +void bootloader(void) __attribute__ ((section(".bootloader"))) + __attribute__ ((naked)); +void i2cWaitForComplete(void) __attribute__ ((section(".bootloader"))); #endif /* _BOOTLOADER_H_ */ Modified: firmware/fuxrf/trunk/defines.h =================================================================== --- firmware/fuxrf/trunk/defines.h 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/defines.h 2007-10-01 10:38:14 UTC (rev 559) @@ -9,9 +9,9 @@ #include <avr/eeprom.h> // Define the used HOPPING SCHEME -#define HOPPING // No hopping, use signel channel TRX_CHANNEL. If no define use frequency hopping +#define HOPPING // No hopping, use signel channel TRX_CHANNEL. If no define use frequency hopping #define TRX_CHANNEL 90 -#define FHA // Use frequency hopping adaptativ +#define FHA // Use frequency hopping adaptativ #define WIFI @@ -69,43 +69,43 @@ //----->Assembler Definitions<-----// //----->Hardware Definitions<-----// -#define set_clock __asm__ __volatile__ ("sbi 0x0B,4") //D.4# CLOCK PORTD.4 -#define clr_clock __asm__ __volatile__ ("cbi 0x0B,4") //D.4# CLOCK PORTD.4 -#define set_data __asm__ __volatile__ ("sbi 0x0B,1") //D.1# TXD/D PORTD.1 -#define clr_data __asm__ __volatile__ ("cbi 0x0B,1") //D.1# TXD/D PORTD.1 -#define set_enable __asm__ __volatile__ ("sbi 0x08,1")//C.1# ENABLE PORTC.1 -#define clr_enable __asm__ __volatile__ ("cbi 0x08,1")//C.1# ENABLE PORTC.1 -#define set_rxon __asm__ __volatile__ ("sbi 0x0B,5") //D.5# RXON PORTD.5 -#define clr_rxon __asm__ __volatile__ ("cbi 0x0B,5") //D.5# RXON PORTD.5 -#define set_txon __asm__ __volatile__ ("sbi 0x05,0") //B.0# TXON PORTB.0 -#define clr_txon __asm__ __volatile__ ("cbi 0x05,0") //B.0# TXON PORTB.0 -#define set_pupwr __asm__ __volatile__ ("sbi 0x0B,2") //D.2# PU_PWR PORTD.2 -#define clr_pupwr __asm__ __volatile__ ("cbi 0x0B,2") //D.2# PU_PWR PORTD.2 -#define set_nole __asm__ __volatile__ ("sbi 0x05,1") //B.1# OLE PORTB.1 -#define clr_nole __asm__ __volatile__ ("cbi 0x05,1") //B.1# OLE PORTB.1 -#define in_rxd input(PIND)&0x01 //# RXD PIND.0 +#define set_clock __asm__ __volatile__ ("sbi 0x0B,4") //D.4# CLOCK PORTD.4 +#define clr_clock __asm__ __volatile__ ("cbi 0x0B,4") //D.4# CLOCK PORTD.4 +#define set_data __asm__ __volatile__ ("sbi 0x0B,1") //D.1# TXD/D PORTD.1 +#define clr_data __asm__ __volatile__ ("cbi 0x0B,1") //D.1# TXD/D PORTD.1 +#define set_enable __asm__ __volatile__ ("sbi 0x08,1") //C.1# ENABLE PORTC.1 +#define clr_enable __asm__ __volatile__ ("cbi 0x08,1") //C.1# ENABLE PORTC.1 +#define set_rxon __asm__ __volatile__ ("sbi 0x0B,5") //D.5# RXON PORTD.5 +#define clr_rxon __asm__ __volatile__ ("cbi 0x0B,5") //D.5# RXON PORTD.5 +#define set_txon __asm__ __volatile__ ("sbi 0x05,0") //B.0# TXON PORTB.0 +#define clr_txon __asm__ __volatile__ ("cbi 0x05,0") //B.0# TXON PORTB.0 +#define set_pupwr __asm__ __volatile__ ("sbi 0x0B,2") //D.2# PU_PWR PORTD.2 +#define clr_pupwr __asm__ __volatile__ ("cbi 0x0B,2") //D.2# PU_PWR PORTD.2 +#define set_nole __asm__ __volatile__ ("sbi 0x05,1") //B.1# OLE PORTB.1 +#define clr_nole __asm__ __volatile__ ("cbi 0x05,1") //B.1# OLE PORTB.1 +#define in_rxd input(PIND)&0x01 //# RXD PIND.0 //----->Hardware Definitions<-----// //----->RF-Config-Word-Defines<-----// -#define TXEN 0x01 // XXX -#define RXEN 0x00 // XXX +#define TXEN 0x01 // XXX +#define RXEN 0x00 // XXX #define CH00TX 0x1B #define CH00RX 0x1C //----->RF-Config-Word-Defines<-----// //----->RF-Timing-Defines<-----// // T_SLOT == 1ms ==> every 1000us 48 Bytes of payload are exchanged - #define POLL_LOOPS 1 - #define T_1ms 1728 // Exact -> 1000us - #define T_PWR_UP_TX 69 // 69 == 40us (39.93) - #define T_LOOP_TX 341 // 341 == 197us (197.34) - #define T_START_TX 59 // 59 == 34us (34.14) - #define T_TX2RX 1259 // 1259 == 728us (728.59) - #define T_PWR_UP_RX 69 // 69 == 40us (39.93) - #define T_LOOP_RX 139 // 139 == 80us (80.44) - #define T_RX_ON 260 // 260 == 150us (150.46) - #define T_MAX_PAC_RX 1088 // 1088 == 630us (629.62) - #define T_RX2TX 172 // 172 == 100us (99.54) +#define POLL_LOOPS 1 +#define T_1ms 1728 // Exact -> 1000us +#define T_PWR_UP_TX 69 // 69 == 40us (39.93) +#define T_LOOP_TX 341 // 341 == 197us (197.34) +#define T_START_TX 59 // 59 == 34us (34.14) +#define T_TX2RX 1259 // 1259 == 728us (728.59) +#define T_PWR_UP_RX 69 // 69 == 40us (39.93) +#define T_LOOP_RX 139 // 139 == 80us (80.44) +#define T_RX_ON 260 // 260 == 150us (150.46) +#define T_MAX_PAC_RX 1088 // 1088 == 630us (629.62) +#define T_RX2TX 172 // 172 == 100us (99.54) // ==> 48KB/second (384.000bps) //----->RF-Timing-Defines<-----// Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/device.c 2007-10-01 10:38:14 UTC (rev 559) @@ -30,7 +30,6 @@ VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE, }; - /* Bootloader can be included with the program */ #define BOOTLOADER 1 @@ -38,9 +37,9 @@ #include "bootloader.h" #endif - #ifdef WIFI -const unsigned char OffsetTbl[] = { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41 }; +const unsigned char OffsetTbl[] = + { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41 }; #endif //***************************************************************************** @@ -59,49 +58,50 @@ int main(void) { #if (BOOTLOADER) - if (!(PINB & 0x04)) /* if SPI_SS is cleared at startup */ - asm volatile ("rjmp bootloader" ::); /* jump to bootloader */ + if (!(PINB & 0x04)) /* if SPI_SS is cleared at startup */ + asm volatile ("rjmp bootloader"::); /* jump to bootloader */ #endif - init_avr(); // System init - init_varis(); // Init variables - spiTransaction(); // Spi transaction to recieve + init_avr(); // System init + init_varis(); // Init variables + spiTransaction(); // Spi transaction to recieve // spiConfigFrame[5] = 6; // spiConfigFrame[6] = 32; - generate_frequency_sequence (); // Generate hopping sequence - init_frame_RF (); // Init RF frame - sei(); - gfilter = eeprom_read_byte(&ee_filter); // Read gaussian filter into the eeprom - if (gfilter == 0xFF) // No value program in the eeprom - gfilter = 5; - gfilter = (gfilter << 1); // Configure gaussian filter - system_start_up(); // Start RF connection - PORTD &= ~0x80; // On line radio + generate_frequency_sequence(); // Generate hopping sequence + init_frame_RF(); // Init RF frame + sei(); + gfilter = eeprom_read_byte(&ee_filter); // Read gaussian filter into the eeprom + if (gfilter == 0xFF) // No value program in the eeprom + gfilter = 5; + gfilter = (gfilter << 1); // Configure gaussian filter + system_start_up(); // Start RF connection + PORTD &= ~0x80; // On line radio - while (1) // Infinite main loop + while (1) // Infinite main loop + { +#ifdef WIFI + if (FHAState == COMPUTE_FREQ) { -#ifdef WIFI - if (FHAState == COMPUTE_FREQ) - { - while (1) - { - replaceFrequency += OffsetTbl[random_numb]; // Calculate next channel + while (1) + { + replaceFrequency += OffsetTbl[random_numb]; // Calculate next channel if (replaceFrequency >= 93) - replaceFrequency -= 91; - random_numb++; - if (random_numb == 12) - random_numb = 0; - if ((replaceFrequency < spiConfigFrame[5]) || (replaceFrequency > spiConfigFrame[6])) - break; - } - FHAState = WAIT_ACK_CHF; - } + replaceFrequency -= 91; + random_numb++; + if (random_numb == 12) + random_numb = 0; + if ((replaceFrequency < spiConfigFrame[5]) + || (replaceFrequency > spiConfigFrame[6])) + break; + } + FHAState = WAIT_ACK_CHF; + } #endif - if (spi_enable) // Spi transaction ready + if (spi_enable) // Spi transaction ready { - spi_enable = 0; // Reset spi flag - spiTransaction(); - } + spi_enable = 0; // Reset spi flag + spiTransaction(); } + } } Modified: firmware/fuxrf/trunk/init.c =================================================================== --- firmware/fuxrf/trunk/init.c 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/init.c 2007-10-01 10:38:14 UTC (rev 559) @@ -3,7 +3,6 @@ #include "varis.h" #include "misc.h" - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: init_avr * @@ -17,59 +16,54 @@ //***************************************************************************** void init_avr(void) { - //init of AVR ports + //init of AVR ports //*************PORTB*************// - //PORTB.0 -> OUT TXON - //PORTB.1 -> OUT nOLE - //PORTB.2 -> IN CS - //PORTB.3 -> IN MOSI - //PORTB.4 -> OUT MISO - //PORTB.5 -> IN SCK - //PORTB.6 -> XTAL1 - //PORTB.7 -> XTAL2 (output to RF - Chip) - output(PORTB,0x20); - output(DDRB,0x13); + //PORTB.0 -> OUT TXON + //PORTB.1 -> OUT nOLE + //PORTB.2 -> IN CS + //PORTB.3 -> IN MOSI + //PORTB.4 -> OUT MISO + //PORTB.5 -> IN SCK + //PORTB.6 -> XTAL1 + //PORTB.7 -> XTAL2 (output to RF - Chip) + output(PORTB, 0x20); + output(DDRB, 0x13); //*************PORTB*************// //*************PORTC*************// - //PORTC.0 -> OUT READY SPI - //PORTC.1 -> OUT Enable - //PORTC.2 -> OUT READY SPI - //PORTC.3 -> OUT DEBUFG RF - //PORTC.4 -> NOT USED, PULLED UP - //PORTC.5 -> NOT USED, PULLED UP - //PORTC.6 -> DEBUG - PIN - output(PORTC,0x31); - output(DDRC,0x1F); + //PORTC.0 -> OUT READY SPI + //PORTC.1 -> OUT Enable + //PORTC.2 -> OUT READY SPI + //PORTC.3 -> OUT DEBUFG RF + //PORTC.4 -> NOT USED, PULLED UP + //PORTC.5 -> NOT USED, PULLED UP + //PORTC.6 -> DEBUG - PIN + output(PORTC, 0x31); + output(DDRC, 0x1F); //*************PORTC*************// - //*************PORTD*************// - //PORTD.0 -> IN RX_DATA - //PORTD.1 -> OUT TX_DATA/Data - //PORTD.2 -> OUT PU_TRX/PU_REG - //PORTD.3 -> IN RESET LINE - //PORTD.4 -> I/O CLK_REC/Clock - //PORTD.5 -> OUT RXON - //PORTD.6 -> NOT USED, PULLED UP - //PORTD.7 -> OUT ON LINE - output(PORTD,0xC0); - output(DDRD,0xA6); //*************PORTD*************// + //PORTD.0 -> IN RX_DATA + //PORTD.1 -> OUT TX_DATA/Data + //PORTD.2 -> OUT PU_TRX/PU_REG + //PORTD.3 -> IN RESET LINE + //PORTD.4 -> I/O CLK_REC/Clock + //PORTD.5 -> OUT RXON + //PORTD.6 -> NOT USED, PULLED UP + //PORTD.7 -> OUT ON LINE + output(PORTD, 0xC0); + output(DDRD, 0xA6); + //*************PORTD*************// //***********init-needed-peripherals***************// - output(UBRR0L,0x05); + output(UBRR0L, 0x05); //***********init-needed-peripherals***************// - SPCR=0x40; // Slave - SPSR=0x00; + SPCR = 0x40; // Slave + SPSR = 0x00; // Clear the SPI interrupt flag - asm volatile /* Clear the SPI interrupt flag */ - ( - "in __tmp_reg__, %0" "\n\t" - "in __tmp_reg__, %1" "\n\t" - : - : "I" (_SFR_IO_ADDR(SPSR)), "I" (_SFR_IO_ADDR(SPDR)) - ); + asm volatile /* Clear the SPI interrupt flag */ + ("in __tmp_reg__, %0" "\n\t" "in __tmp_reg__, %1" + "\n\t"::"I" (_SFR_IO_ADDR(SPSR)), "I"(_SFR_IO_ADDR(SPDR))); } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: init_varis * @@ -83,35 +77,35 @@ //***************************************************************************** void init_varis(void) { - uc_8 i; + uc_8 i; - i = input(SPL); - i ^= 0xFF; - extern ui_16 __bss_start; - extern ui_16 __stack; - uc_8 *ptr = (uc_8*)&__bss_start; - while(ptr<(uc_8*)&__stack - i) - {/*sub because of returning of subroutine*/ - *ptr++=0; - } // Reduce 26 bytes + i = input(SPL); + i ^= 0xFF; + extern ui_16 __bss_start; + extern ui_16 __stack; + uc_8 *ptr = (uc_8 *) & __bss_start; - rx_buffer_ready = 0x00; - frameCmpt = 0; // Counter of RF frame - frequencyIndex = 0; // Pointer for the table of frequency - FHAState = INIT; // Init of status of FHA state machine - statisticPointer = 0; // Pointer for the table with statistic for FHA - spi_enable = 0; // Flag to start spi transaction - errorFrame = 0; // Detect error in transmission - commandStatus = 0; // Status of the command - ACKmode = 0; // Wait an ACK + while (ptr < (uc_8 *) & __stack - i) + { /*sub because of returning of subroutine */ + *ptr++ = 0; + } // Reduce 26 bytes - prf_buffer_rx = rf_buffer_rx1; // Init pointer for RF transaction - pspi_buffer_rx = rf_buffer_rx2; // Init pointer for SPI transaction - prf_buffer_tx = rf_buffer_tx1; // Init pointer for RF transaction - pspi_buffer_tx = rf_buffer_tx2; // Init pointer for SPI transaction + rx_buffer_ready = 0x00; + frameCmpt = 0; // Counter of RF frame + frequencyIndex = 0; // Pointer for the table of frequency + FHAState = INIT; // Init of status of FHA state machine + statisticPointer = 0; // Pointer for the table with statistic for FHA + spi_enable = 0; // Flag to start spi transaction + errorFrame = 0; // Detect error in transmission + commandStatus = 0; // Status of the command + ACKmode = 0; // Wait an ACK + + prf_buffer_rx = rf_buffer_rx1; // Init pointer for RF transaction + pspi_buffer_rx = rf_buffer_rx2; // Init pointer for SPI transaction + prf_buffer_tx = rf_buffer_tx1; // Init pointer for RF transaction + pspi_buffer_tx = rf_buffer_tx2; // Init pointer for SPI transaction } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: init_frame_RF * @@ -123,48 +117,48 @@ //* Date: 26.06.07 * //* Description: Init the TX buffers with the starting values * //***************************************************************************** -void init_frame_RF (void) +void init_frame_RF(void) { - unsigned char i, header_rf; + unsigned char i, header_rf; - header_rf = SMALLFRAME; // First byte header of the frame - header_rf |= MASTERH; + header_rf = SMALLFRAME; // First byte header of the frame + header_rf |= MASTERH; - if (spiConfigFrame[1] == 0xFF) // Special mode + if (spiConfigFrame[1] == 0xFF) // Special mode + { + if (spiConfigFrame[3] == 0xFF) // Request ID { - if (spiConfigFrame[3] == 0xFF) // Request ID - { - header_rf |= REQUESTID; - } - else // Change ID - { - header_rf |= CHANGEID; - } + header_rf |= REQUESTID; } - - for (i = 0; i < 11; i++) + else // Change ID { - rf_buffer_tx1[i] = 0x55; // Preamble - rf_buffer_tx2[i] = 0x55; // Preamble + header_rf |= CHANGEID; } + } - for (i = 11; i < 13; i++) - { - rf_buffer_tx1[i] = 0xFF; // Synchro - rf_buffer_tx2[i] = 0xFF; // Synchro - } + for (i = 0; i < 11; i++) + { + rf_buffer_tx1[i] = 0x55; // Preamble + rf_buffer_tx2[i] = 0x55; // Preamble + } - rf_buffer_tx1[14] = rf_buffer_tx2[14] = sof_ary[1] = spiConfigFrame[0]; // Set ID - rf_buffer_tx1[15] = rf_buffer_tx2[15] = sof_ary[2] = spiConfigFrame[1]; - rf_buffer_tx1[16] = rf_buffer_tx2[16] = header_rf; - if (spiConfigFrame[4] == 0x01) // Wake up from PC - rf_buffer_tx1[17] = rf_buffer_tx2[17] = 0x20; // Second byte header of the frame - else - rf_buffer_tx1[17] = rf_buffer_tx2[17] = 0x00; // Second byte header of the frame + for (i = 11; i < 13; i++) + { + rf_buffer_tx1[i] = 0xFF; // Synchro + rf_buffer_tx2[i] = 0xFF; // Synchro + } - rf_buffer_tx1[18] = rf_buffer_tx2[18] = spiConfigFrame[2]; // Hopping parameters Index (dummy) / Toy ID for init - rf_buffer_tx1[19] = rf_buffer_tx2[19] = spiConfigFrame[3]; // Hopping parameters Channel (dummy) / Toy ID for init - rf_buffer_tx1[20] = rf_buffer_tx2[20] = 0x55; - calc_checksum (rf_buffer_tx1); - calc_checksum (rf_buffer_tx2); + rf_buffer_tx1[14] = rf_buffer_tx2[14] = sof_ary[1] = spiConfigFrame[0]; // Set ID + rf_buffer_tx1[15] = rf_buffer_tx2[15] = sof_ary[2] = spiConfigFrame[1]; + rf_buffer_tx1[16] = rf_buffer_tx2[16] = header_rf; + if (spiConfigFrame[4] == 0x01) // Wake up from PC + rf_buffer_tx1[17] = rf_buffer_tx2[17] = 0x20; // Second byte header of the frame + else + rf_buffer_tx1[17] = rf_buffer_tx2[17] = 0x00; // Second byte header of the frame + + rf_buffer_tx1[18] = rf_buffer_tx2[18] = spiConfigFrame[2]; // Hopping parameters Index (dummy) / Toy ID for init + rf_buffer_tx1[19] = rf_buffer_tx2[19] = spiConfigFrame[3]; // Hopping parameters Channel (dummy) / Toy ID for init + rf_buffer_tx1[20] = rf_buffer_tx2[20] = 0x55; + calc_checksum(rf_buffer_tx1); + calc_checksum(rf_buffer_tx2); } Modified: firmware/fuxrf/trunk/init.h =================================================================== --- firmware/fuxrf/trunk/init.h 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/init.h 2007-10-01 10:38:14 UTC (rev 559) @@ -1,12 +1,10 @@ #ifndef INIT_H #define INIT_H - - #include "defines.h" extern void init_avr(void); extern void init_varis(void); -extern void init_frame_RF (void); +extern void init_frame_RF(void); #endif Modified: firmware/fuxrf/trunk/misc.c =================================================================== --- firmware/fuxrf/trunk/misc.c 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/misc.c 2007-10-01 10:38:14 UTC (rev 559) @@ -4,7 +4,6 @@ #include "misc.h" #include "rf_ctrl.h" - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: wait_n_10us * @@ -18,22 +17,21 @@ //***************************************************************************** void wait_n_10us(uc_8 val) { - uc_8 i,j; + uc_8 i, j; - i = val; - for(i = 0; i < val; i++) + i = val; + for (i = 0; i < val; i++) + { + for (j = 0; j < 16; j++) { - for(j = 0; j < 16; j++) - { - _NIX; - _NIX; - _NIX; - _NIX; - } + _NIX; + _NIX; + _NIX; + _NIX; } + } } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: get_random * @@ -47,38 +45,37 @@ //***************************************************************************** uc_8 get_random(void) { - uc_8 i,random; + uc_8 i, random; - //init of the global variable random, this is done by using the noise - //output of the RF-Chip when settlet up for receive without having - //a transmitter, may check if RSSI is low to be sure there is only noise. - //The RX_DATA pin of the ATR2406 is sampled. + //init of the global variable random, this is done by using the noise + //output of the RF-Chip when settlet up for receive without having + //a transmitter, may check if RSSI is low to be sure there is only noise. + //The RX_DATA pin of the ATR2406 is sampled. - pwr_up_atr2406(); + pwr_up_atr2406(); - set_rxon; // Set ATR2406 in RX mode - for(i = 0;i < 0xFF; i++) - { - random = 0x00; - _NIX; - } + set_rxon; // Set ATR2406 in RX mode + for (i = 0; i < 0xFF; i++) + { + random = 0x00; + _NIX; + } - for(i = 0;i < 0x41; i++) // Calculate random word + for (i = 0; i < 0x41; i++) // Calculate random word + { + if ((i & 0x07) == 0x00) { - if ((i&0x07) == 0x00) - { - random = random << 1; - if ((in_rxd)) - { - random |= 0x01; - } - } + random = random << 1; + if ((in_rxd)) + { + random |= 0x01; + } } - pwr_dwn_atr2406(); - return random; + } + pwr_dwn_atr2406(); + return random; } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: get_random_channel * @@ -90,27 +87,26 @@ //* Date: 10.07.06 * //* Description: Random channel value needed for frequency hopping * //***************************************************************************** -uc_8 get_random_channel (void) +uc_8 get_random_channel(void) { - uc_8 value; + uc_8 value; - while (1) - { - value = get_random (); // Get a random value - value &= 0x7F; // Truncate it to have a correct channel value - if (value >= 93) - value -= 60; - if (value <= 1) - value = 2; + while (1) + { + value = get_random(); // Get a random value + value &= 0x7F; // Truncate it to have a correct channel value + if (value >= 93) + value -= 60; + if (value <= 1) + value = 2; #ifdef WIFI - if ((value < spiConfigFrame[5]) || (value > spiConfigFrame[6])) + if ((value < spiConfigFrame[5]) || (value > spiConfigFrame[6])) #endif - break; - } - return value; + break; + } + return value; } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: calc_checksum * @@ -124,19 +120,19 @@ //***************************************************************************** void calc_checksum(unsigned char *pbuffer) { - uc_8 i,tmp; - uc_8 *ptr; + uc_8 i, tmp; + uc_8 *ptr; - ptr = pbuffer + 16; // Get address of start of RF frame - if (*(pbuffer + 16) & SMALLFRAME) - i = 6; - else - i = 48; - tmp = 0x00; - while (i != 1) - { - i--; - tmp ^= *ptr++; // Calculate CRC - } - *ptr = tmp; + ptr = pbuffer + 16; // Get address of start of RF frame + if (*(pbuffer + 16) & SMALLFRAME) + i = 6; + else + i = 48; + tmp = 0x00; + while (i != 1) + { + i--; + tmp ^= *ptr++; // Calculate CRC + } + *ptr = tmp; } Modified: firmware/fuxrf/trunk/misc.h =================================================================== --- firmware/fuxrf/trunk/misc.h 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/misc.h 2007-10-01 10:38:14 UTC (rev 559) @@ -1,14 +1,11 @@ #ifndef MISC_H #define MISC_H - #include "defines.h" - extern void wait_n_10us(uc_8 val); extern uc_8 get_random(void); -extern uc_8 get_random_channel (void); +extern uc_8 get_random_channel(void); extern void calc_checksum(unsigned char *pbuffer); - #endif Modified: firmware/fuxrf/trunk/prot.c =================================================================== --- firmware/fuxrf/trunk/prot.c 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/prot.c 2007-10-01 10:38:14 UTC (rev 559) @@ -5,7 +5,6 @@ #include "prot.h" #include "rf_ctrl.h" - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: generate_frequency_sequence * @@ -17,34 +16,33 @@ //* Date: 10.07.06 * //* Description: Define a frequency sequence for hopping * //***************************************************************************** -void generate_frequency_sequence (void) +void generate_frequency_sequence(void) { - unsigned char i, j, out; + unsigned char i, j, out; - frequencyTable [0] = get_random_channel (); - for (i = 1; i < 20; i++) + frequencyTable[0] = get_random_channel(); + for (i = 1; i < 20; i++) { out = 1; while (out) { - frequencyTable [i] = get_random_channel (); + frequencyTable[i] = get_random_channel(); j = 0; while (1) { - if (frequencyTable [i] == frequencyTable [j]) - break; - j++; + if (frequencyTable[i] == frequencyTable[j]) + break; + j++; if (i == j) { - out = 0; + out = 0; break; } - } + } } - } + } } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: system_start_up * @@ -58,55 +56,54 @@ //***************************************************************************** void system_start_up(void) { - unsigned char i; - unsigned char RFinitState; // Init state machine variable + unsigned char i; + unsigned char RFinitState; // Init state machine variable - rf_status |= MASTER; // Set rf status like master - channel = 0; // Init start channel - pwr_dwn_atr2406(); - start_rf_timer(); // Start timer 1 interrupt, state machine of the rf link - output(UCSR0A,0x00); - output(UCSR0B,0x00); - output(UCSR0C,0x00); // Enable RX UART - output(OCR1A,0x0020); // Update timer - RFinitState = WAIT_SLAVE; // Init state machine + rf_status |= MASTER; // Set rf status like master + channel = 0; // Init start channel + pwr_dwn_atr2406(); + start_rf_timer(); // Start timer 1 interrupt, state machine of the rf link + output(UCSR0A, 0x00); + output(UCSR0B, 0x00); + output(UCSR0C, 0x00); // Enable RX UART + output(OCR1A, 0x0020); // Update timer + RFinitState = WAIT_SLAVE; // Init state machine - while (1) + while (1) + { + if (rx_buffer_ready) // Valid receive frame { - if (rx_buffer_ready) // Valid receive frame - { - rx_buffer_ready = 0x00; // Reset recieve flag - if (RFinitState == WAIT_SLAVE) // Wait SLAVE not logged - { - if (*(pspi_buffer_rx) == 0x82) // SLAVE not logged + rx_buffer_ready = 0x00; // Reset recieve flag + if (RFinitState == WAIT_SLAVE) // Wait SLAVE not logged + { + if (*(pspi_buffer_rx) == 0x82) // SLAVE not logged { - rf_status |= LOGGED; // Rf status is logged - rf_buffer_tx1[16] = rf_buffer_tx2[16] |= LOGGEDH; // MASTER logged + rf_status |= LOGGED; // Rf status is logged + rf_buffer_tx1[16] = rf_buffer_tx2[16] |= LOGGEDH; // MASTER logged // eeprom_write_byte(&ee_toy_id_h, toy_id_h); // Write toy id into the eeprom // eeprom_write_byte(&ee_toy_id_h, toy_id_l); - rf_buffer_tx1[17] = rf_buffer_tx2[17] &= ~0x20; // Remove wake up command if set - RFinitState = WAIT_LOG; - } - } - else if (RFinitState == WAIT_LOG) - { - if ((*(pspi_buffer_rx) & SLAVEH) && (*(pspi_buffer_rx) & LOGGEDH)) // SLAVE logged - { - rf_buffer_tx1[16] = rf_buffer_tx2[16] &= ~SMALLFRAME; // Use big frame - for (i = 22; i < 63; i++) - { - rf_buffer_tx1[i] = 0x55; // Payload bytes - rf_buffer_tx2[i] = 0x55; // Payload bytes - } - rf_status |= WAIT_HOPPING; - break; - } - } + rf_buffer_tx1[17] = rf_buffer_tx2[17] &= ~0x20; // Remove wake up command if set + RFinitState = WAIT_LOG; } + } + else if (RFinitState == WAIT_LOG) + { + if ((*(pspi_buffer_rx) & SLAVEH) && (*(pspi_buffer_rx) & LOGGEDH)) // SLAVE logged + { + rf_buffer_tx1[16] = rf_buffer_tx2[16] &= ~SMALLFRAME; // Use big frame + for (i = 22; i < 63; i++) + { + rf_buffer_tx1[i] = 0x55; // Payload bytes + rf_buffer_tx2[i] = 0x55; // Payload bytes + } + rf_status |= WAIT_HOPPING; + break; + } + } } + } } - //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: setup_pac * @@ -118,96 +115,96 @@ //* Date: 26.06.07 * //* Description: Build RF packet and manage some protocol function * //***************************************************************************** -void setup_pac (void) +void setup_pac(void) { - unsigned char i; - unsigned char *pbuffer_tx; - unsigned char *pspibuffer_tx; + unsigned char i; + unsigned char *pbuffer_tx; + unsigned char *pspibuffer_tx; - pspibuffer_tx = pspi_buffer_tx; - pbuffer_tx = prf_buffer_tx; - *(pbuffer_tx + 13) = channel; // Save current channel into the frame + pspibuffer_tx = pspi_buffer_tx; + pbuffer_tx = prf_buffer_tx; + *(pbuffer_tx + 13) = channel; // Save current channel into the frame // *(pbuffer_tx + 14) = sof_ary[1]; // Put Toy id into the frame // *(pbuffer_tx + 15) = sof_ary[2]; // Put Toy id into the frame #ifdef HOPPING - if (rf_status & WAIT_HOPPING) + if (rf_status & WAIT_HOPPING) + { + if (FHAState & WAIT_SYNCHRO) // Wait synchro time { - if (FHAState & WAIT_SYNCHRO) // Wait synchro time - { - *(pbuffer_tx + 22) = frameCmpt; // Load frame counter + *(pbuffer_tx + 22) = frameCmpt; // Load frame counter frameCmpt++; - rf_buffer_tx1[16] = rf_buffer_tx2[16] &= ~FHTRSEQ; // Update frame header + rf_buffer_tx1[16] = rf_buffer_tx2[16] &= ~FHTRSEQ; // Update frame header if (frameCmpt & 0x10) { - FHAState = 0; // Reset status to do adaptative frequency hopping + FHAState = 0; // Reset status to do adaptative frequency hopping rf_status &= ~WAIT_HOPPING; - rf_status |= FHA_EFFECTIVE; // FHA is effective + rf_status |= FHA_EFFECTIVE; // FHA is effective // PORTC |= 0x04; // Debug } } - else if (FHAState & INIT) // Send hopping sequence to Slave + else if (FHAState & INIT) // Send hopping sequence to Slave { - for (i = 0; i < 20; i++) - *(pbuffer_tx + 23 + i) = frequencyTable [i]; // Load frequency sequence in the frame - *(pbuffer_tx + 16) |= FHTRSEQ; // Update frame header - *(pbuffer_tx + 22) = frameCmpt; // Load frame counter + for (i = 0; i < 20; i++) + *(pbuffer_tx + 23 + i) = frequencyTable[i]; // Load frequency sequence in the frame + *(pbuffer_tx + 16) |= FHTRSEQ; // Update frame header + *(pbuffer_tx + 22) = frameCmpt; // Load frame counter frameCmpt++; - if (rx_buffer_ready) // Valid receive frame - { - rx_buffer_ready = 0x00; // Reset recieve flag - if (*(pspi_buffer_rx) & FHAACKH) // ACK recieve from Slave - FHAState = WAIT_SYNCHRO; // Go to the next state - } + if (rx_buffer_ready) // Valid receive frame + { + rx_buffer_ready = 0x00; // Reset recieve flag + if (*(pspi_buffer_rx) & FHAACKH) // ACK recieve from Slave + FHAState = WAIT_SYNCHRO; // Go to the next state } } + } #endif #ifdef FHA - if (rf_status & FHA_EFFECTIVE) + if (rf_status & FHA_EFFECTIVE) + { + if (FHAState & WAIT_ACK_CHF) { - if (FHAState & WAIT_ACK_CHF) - { - *(prf_buffer_tx + 16) |= FHTRSEQ; // Update frame header - *(prf_buffer_tx + 18) = tempoIndexFreq; - *(prf_buffer_tx + 19) = replaceFrequency; - *(prf_buffer_tx + 20) = replaceFrequency + tempoIndexFreq; // Must be remove if new CRC + *(prf_buffer_tx + 16) |= FHTRSEQ; // Update frame header + *(prf_buffer_tx + 18) = tempoIndexFreq; + *(prf_buffer_tx + 19) = replaceFrequency; + *(prf_buffer_tx + 20) = replaceFrequency + tempoIndexFreq; // Must be remove if new CRC - if ((rx_buffer_ready) && (*(pspi_buffer_rx) & FHAACKH)) // Valid receive frame + if ((rx_buffer_ready) && (*(pspi_buffer_rx) & FHAACKH)) // Valid receive frame { // PORTC |= 0x04; // Debug - rx_buffer_ready = 0; // Reset recieve flag - *(prf_buffer_tx + 16) &= ~FHTRSEQ; // Update frame header - *(pspi_buffer_tx + 16) &= ~FHTRSEQ; + rx_buffer_ready = 0; // Reset recieve flag + *(prf_buffer_tx + 16) &= ~FHTRSEQ; // Update frame header + *(pspi_buffer_tx + 16) &= ~FHTRSEQ; FHAState = DO_UPDATE; } - } } + } #endif - if (*(pbuffer_tx + 17) & 0x02) // Redundance + if (*(pbuffer_tx + 17) & 0x02) // Redundance + { + for (i = 27; i < 44; i++) // Copy audio for redundance { - for (i = 27 ;i < 44 ; i++) // Copy audio for redundance - { - *(pspibuffer_tx + 18 + i) = *(pbuffer_tx + i); - } - *(pspibuffer_tx + 17) |= 0x04; // Update header + *(pspibuffer_tx + 18 + i) = *(pbuffer_tx + i); } - else - { - *(pspibuffer_tx + 17) &= ~0x04; // Update header - } + *(pspibuffer_tx + 17) |= 0x04; // Update header + } + else + { + *(pspibuffer_tx + 17) &= ~0x04; // Update header + } - if (commandStatus == 0x01) // Command in progress - { - for (i = 0; i < 4; i++) // Copy command into the frame - *(pbuffer_tx + 23 + i) = commandBuffer[i]; - *(pbuffer_tx + 17) |= 0x08; // Update header - commandCmpt++; - if (commandCmpt == 25) - commandStatus = 0x03; // Command fail + if (commandStatus == 0x01) // Command in progress + { + for (i = 0; i < 4; i++) // Copy command into the frame + *(pbuffer_tx + 23 + i) = commandBuffer[i]; + *(pbuffer_tx + 17) |= 0x08; // Update header + commandCmpt++; + if (commandCmpt == 25) + commandStatus = 0x03; // Command fail } - else - *(pbuffer_tx + 17) &= ~0x08; // Update header + else + *(pbuffer_tx + 17) &= ~0x08; // Update header - calc_checksum (pbuffer_tx); // Compute checksum + calc_checksum(pbuffer_tx); // Compute checksum } Modified: firmware/fuxrf/trunk/prot.h =================================================================== --- firmware/fuxrf/trunk/prot.h 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/prot.h 2007-10-01 10:38:14 UTC (rev 559) @@ -1,16 +1,10 @@ #ifndef PROT_H #define PROT_H - - #include "defines.h" - - -extern void generate_frequency_sequence (void); +extern void generate_frequency_sequence(void); extern void system_start_up(void); -extern void setup_pac (void); +extern void setup_pac(void); - - #endif Modified: firmware/fuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 10:29:33 UTC (rev 558) +++ firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 10:38:14 UTC (rev 559) @@ -8,7 +8,8 @@ #include "prot.h" #ifndef WIFI -const unsigned char OffsetTbl[] = { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41 }; +const unsigned char OffsetTbl[] = + { 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41 }; #endif //***************************************************************************** @@ -24,220 +25,218 @@ //* Description: State machine to generate all the needed timings for the * //* RF - Software flow. * //***************************************************************************** -SIGNAL (SIG_OUTPUT_COMPARE1A) +SIGNAL(SIG_OUTPUT_COMPARE1A) { - rfStateCount++; // Increment state machine counter + rfStateCount++; // Increment state machine counter - if (rfStateCount == 0x01) // Start ATR2406 - { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_PWR_UP_TX); // Update timer (40 S) - pwr_up_atr2406(); // Start ATR2406 - // --> End of critical timing section <-- + if (rfStateCount == 0x01) // Start ATR2406 + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, input(OCR1A) + T_PWR_UP_TX); // Update timer (40 S) + pwr_up_atr2406(); // Start ATR2406 + // --> End of critical timing section <-- #ifndef HOPPING - channel = TRX_CHANNEL; // Set the channel + channel = TRX_CHANNEL; // Set the channel #endif #ifdef HOPPING - if (rf_status & FHA_EFFECTIVE) // FHA effective - { - channel = frequencyTable[frequencyIndex]; // Next new channel - frequencyIndex++; // Increment index - if (frequencyIndex == 20) - { - frequencyIndex = 0; // Reset index + if (rf_status & FHA_EFFECTIVE) // FHA effective + { + channel = frequencyTable[frequencyIndex]; // Next new channel + frequencyIndex++; // Increment index + if (frequencyIndex == 20) + { + frequencyIndex = 0; // Reset index #ifdef FHA - if (FHAState & DO_UPDATE) // Update bad channel - { + if (FHAState & DO_UPDATE) // Update bad channel + { // PORTC |= 0x04; // Debug - frequencyTable[tempoIndexFreq] = replaceFrequency; // Replace bad frequency in the table - FHAState = 0; // Reset status - frequencyStatistic[tempoIndexFreq] = 0; // Reset Statistic + frequencyTable[tempoIndexFreq] = replaceFrequency; // Replace bad frequency in the table + FHAState = 0; // Reset status + frequencyStatistic[tempoIndexFreq] = 0; // Reset Statistic // PORTC &= ~0x04; // Debug - } - statisticPointer++; // Calculate static pointer - if (statisticPointer == 1000) - statisticPointer = 0; // Reset static pointer -#endif - } - } - else // FHA start sequence - { - channel += 6; // Next new channel - if (channel > 94) - channel = 0; } + statisticPointer++; // Calculate static pointer + if (statisticPointer == 1000) + statisticPointer = 0; // Reset static pointer #endif + } } - else if (rfStateCount == 0x02) // Config ATR2406 + else // FHA start sequence { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_LOOP_TX); // Update timer (120 S). - init_atr2406(channel,TXEN); // Configure ATR2406 to desired channel. - // --> End of critical timing section <-- - *(prf_buffer_tx + 13) = channel; // Save current channel into the frame - if (rf_status & LOGGED) - setup_pac (); // Build packet - if (*(prf_buffer_tx + 16) & SMALLFRAME) // Calculate packet lenght - tx_pac_len = 23; - else - tx_pac_len = 65; + channel += 6; // Next new channel + if (channel > 94) + channel = 0; } - else if (rfStateCount == 0x03) // Set TX on - { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,(input(OCR1A)+T_START_TX)); // Update timer (34 S) - set_txon; // Set TX on - // --> End of critical timing section <-- - output(UCSR0A,0x40); // // Usart Transmit conplete (interrupt no activated) - output(UCSR0B,0x08); // Transmit enable - } - else if (rfStateCount == 0x04) // Start transmission - { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,(input(OCR1A)+T_TX2RX)); // Update timer (804 S) - rf_tx_counter = 0x00; // Reset the pointer of frame - output(UCSR0C,0x46); // Synchronous usart + 8 bits - output(UCSR0B,0x28); // Interrupt enable if empty + Transmit enable - output(UDR0,0x55); // Start transmission of the packet - output(UDR0,0x55); // Double buffered!! - // --> End of critical timing section <-- - } - else if (rfStateCount == 0x05) // Start ATR2406 - { +#endif + } + else if (rfStateCount == 0x02) // Config ATR2406 + { // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_PWR_UP_RX); // Update timer (40 S) - pwr_up_atr2406(); // Start ATR2406 - // --> End of critical timing section <-- + output(OCR1A, input(OCR1A) + T_LOOP_TX); // Update timer (120 S). + init_atr2406(channel, TXEN); // Configure ATR2406 to desired channel. + // --> End of critical timing section <-- + *(prf_buffer_tx + 13) = channel; // Save current channel into the frame + if (rf_status & LOGGED) + setup_pac(); // Build packet + if (*(prf_buffer_tx + 16) & SMALLFRAME) // Calculate packet lenght + tx_pac_len = 23; + else + tx_pac_len = 65; + } + else if (rfStateCount == 0x03) // Set TX on + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, (input(OCR1A) + T_START_TX)); // Update timer (34 S) + set_txon; // Set TX on + // --> End of critical timing section <-- + output(UCSR0A, 0x40); // // Usart Transmit conplete (interrupt no activated) + output(UCSR0B, 0x08); // Transmit enable + } + else if (rfStateCount == 0x04) // Start transmission + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, (input(OCR1A) + T_TX2RX)); // Update timer (804 S) + rf_tx_counter = 0x00; // Reset the pointer of frame + output(UCSR0C, 0x46); // Synchronous usart + 8 bits + output(UCSR0B, 0x28); // Interrupt enable if empty + Transmit enable + output(UDR0, 0x55); // Start transmission of the packet + output(UDR0, 0x55); // Double buffered!! + // --> End of critical timing section <-- + } + else if (rfStateCount == 0x05) // Start ATR2406 + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, input(OCR1A) + T_PWR_UP_RX); // Update timer (40 S) + pwr_up_atr2406(); // Start ATR2406 + // --> End of critical timing section <-- #ifndef HOPPING - channel = TRX_CHANNEL; // Set the channel + channel = TRX_CHANNEL; // Set the channel #endif - } - else if (rfStateCount == 0x06) // Config ATR2406 - { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_LOOP_RX); // Update timer (80 S) - init_atr2406(channel,RXEN); // Configure ATR2406 to desired channel - output(DDRD,input(DDRD)&0xEF); // XCK PIN set to input!! - // --> End of critical timing section <-- + } + else if (rfStateCount == 0x06) // Config ATR2406 + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, input(OCR1A) + T_LOOP_RX); // Update timer (80 S) + init_atr2406(channel, RXEN); // Configure ATR2406 to desired channel + output(DDRD, input(DDRD) & 0xEF); // XCK PIN set to input!! + // --> End of critical timing section <-- #ifdef FHA - if ((rf_status & FHA_EFFECTIVE) && (statisticPointer == 0)) // Analyse channel statistic - frequencyStatistic[frequencyIndex] = 0; // Reset statistic + if ((rf_status & FHA_EFFECTIVE) && (statisticPointer == 0)) // Analyse channel statistic + frequencyStatistic[frequencyIndex] = 0; // Reset statistic #endif - rf_rx_counter = 0x00; // Reset the pointer of frame - rf_rx_state = 0x00; // Reset RX state machine - rx_buffer_ready = 0x00; // Reset ready rx buffer flag - checksum = 0x00; // Reset checksum - } - else if (rfStateCount == 0x07) // Set RX on + rf_rx_counter = 0x00; // Reset the pointer of frame + rf_rx_state = 0x00; // Reset RX state machine + rx_buffer_ready = 0x00; // Reset ready rx buffer flag + checksum = 0x00; // Reset checksum + } + else if (rfStateCount == 0x07) // Set RX on + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, input(OCR1A) + T_RX_ON); // Update timer (150 S) + set_rxon; // Set RX on + // --> End of critical timing section <-- + sof_ary[0] = channel; // Setup SOFs!! + } + else if (rfStateCount == 0x08) // Start reception + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, input(OCR1A) + T_MAX_PAC_RX); // Update timer (650 S) + output(UCSR0A, 0x00); // Reset usart + output(UCSR0B, 0x90); // Interrupt on RX complete + RX enable + output(UCSR0C, 0x46); // Synchronous usart + 8 bits + // --> End of critical timing section <-- + } + else if (rfStateCount == 0x09) // Wait RX complete and resync + { + // --> Critical timing section. Don't add code! <-- + output(OCR1A, input(OCR1A) + T_RX2TX); // Resync MASTER + output(UCSR0A, 0x00); // Reset Usart + output(UCSR0B, 0x00); + output(UCSR0C, 0x00); + pwr_dwn_atr2406(); // Stop ATR2406 + // --> Critical timing section. Don't add code! <-- + rfStateCount = 0x00; // Reset timer 1 state machine + + if ((rf_rx_state == 0xFF) && (checksum == 0x00)) // Correct recieve { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_RX_ON); // Update timer (150 S) - set_rxon; // Set RX on - // --> End of critical timing section <-- - sof_ary[0] = channel; // Setup SOFs!! + rx_buffer_ready = 0x01; // Set rx_buffer_ready flag + //DEBUG + PORTC ^= 0x08; + //DEBUG + watchdog = 0; // Reset watchdog variable } - else if (rfStateCount == 0x08) // Start reception + else // No correct recieve { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_MAX_PAC_RX); // Update timer (650 S) - output(UCSR0A,0x00); // Reset usart - output(UCSR0B,0x90); // Interrupt on RX complete + RX enable - output(UCSR0C,0x46); // Synchronous usart + 8 bits - // --> End of critical timing section <-- - } - else if (rfStateCount == 0x09) // Wait RX complete and resync - { - // --> Critical timing section. Don't add code! <-- - output(OCR1A,input(OCR1A)+T_RX2TX); // Resync MASTER - output(UCSR0A,0x00); // Reset Usart - output(UCSR0B,0x00); - output(UCSR0C,0x00); - pwr_dwn_atr2406(); // Stop ATR2406 - // --> Critical timing section. Don't add code! <-- - rfStateCount = 0x00; // Reset timer 1 state machine - - - if ((rf_rx_state==0xFF) && (checksum==0x00)) // Correct recieve + errorFrame = 1; // Mark bad frame + if (rf_status & LOGGED) + { + watchdog++; + if (watchdog == 255) { - rx_buffer_ready = 0x01; // Set rx_buffer_ready flag - //DEBUG - PORTC ^= 0x08; - //DEBUG - watchdog = 0; // Reset watchdog variable + PORTD |= 0x80; // Off line radio } - else // No correct recieve - { - errorFrame = 1; // Mark bad frame - if (rf_status & LOGGED) - ... [truncated message content] |
From: jaguarondi <c2m...@c2...> - 2007-10-01 10:29:38
|
Author: jaguarondi Date: 2007-10-01 12:29:33 +0200 (Mon, 01 Oct 2007) New Revision: 558 Added: firmware/fuxrf/trunk/version.h firmware/tuxrf/trunk/version.h Modified: firmware/fuxrf/trunk/ firmware/fuxrf/trunk/default/Makefile firmware/fuxrf/trunk/device.c firmware/tuxrf/trunk/ firmware/tuxrf/trunk/device.aps firmware/tuxrf/trunk/device.c Log: * Fixed the version numbers section. Now fuxrf exceeds the flash space so it doesn't compile anymore, that's why Pascal removed the version section probably. Property changes on: firmware/fuxrf/trunk ___________________________________________________________________ Name: svn:externals + common http://svn.tuxisalive.com/firmware/tuxdefs Modified: firmware/fuxrf/trunk/default/Makefile =================================================================== --- firmware/fuxrf/trunk/default/Makefile 2007-10-01 09:49:25 UTC (rev 557) +++ firmware/fuxrf/trunk/default/Makefile 2007-10-01 10:29:33 UTC (rev 558) @@ -22,7 +22,7 @@ ## Linker flags LDFLAGS = $(COMMON) -LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map +LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map LDFLAGS += -Wl,-section-start=.buffer_tx1=0x800100 LDFLAGS += -Wl,-section-start=.buffer_rx1=0x800140 LDFLAGS += -Wl,-section-start=.sof=0x8001e6 Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-01 09:49:25 UTC (rev 557) +++ firmware/fuxrf/trunk/device.c 2007-10-01 10:29:33 UTC (rev 558) @@ -7,19 +7,30 @@ #include "prot.h" #include "rf_ctrl.h" #include "spi.h" -#include "commands.h" +#include "common/commands.h" #include "version.h" /* * Version number */ -#define CPU_NUMBER DONGLERF_CPU_NUM /* sound CPU */ -const author_t author __attribute__((section(".version"))) = {AUTHOR_CMD, AUTHOR_ID, 0}; -const revision_t svn_revision __attribute__((section(".version"))) = {REVISION_CMD, REVISION_NUMBER, 0}; -const version_t tag_version __attribute__((section(".version"))) = {VERSION_CMD, CPU_NUMBER, VER_MAJOR, VER_MINOR, VER_UPDATE}; +#define CPU_NUMBER FUXRF_CPU_NUM /* sound CPU */ +/* XXX Add the linker script to have fixed version positions once the project will compile with latest gcc under linux. */ +const author_t author __attribute__ ((section("version"))) = +{ + AUTHOR_CMD, AUTHOR_ID, 0, +}; +const revision_t svn_revision __attribute__ ((section("version"))) = +{ + REVISION_CMD, SVN_REV, SVN_STATUS, +}; +const version_t tag_version __attribute__ ((section("version"))) = +{ + VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE, +}; + /* Bootloader can be included with the program */ #define BOOTLOADER 1 Added: firmware/fuxrf/trunk/version.h =================================================================== --- firmware/fuxrf/trunk/version.h (rev 0) +++ firmware/fuxrf/trunk/version.h 2007-10-01 10:29:33 UTC (rev 558) @@ -0,0 +1,24 @@ +/* KySoH iTux agent + * + * Behavioural source code + * created on 2005/10/20 David Bourgeois + * -------------------------------------------------------- + * + */ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +/* + * Version number + */ + +#define VER_MAJOR 0 +#define VER_MINOR 2 +#define VER_UPDATE 0 + +#define AUTHOR_ID 0 /* official release */ +#define SVN_REV 0xFFEE /* XXX find a way to define this automatically in the Makefile from SVN */ +#define SVN_STATUS 0 /* XXX also fix this in the Makefile */ + +#endif /* _VERSION_H_ */ Property changes on: firmware/tuxrf/trunk ___________________________________________________________________ Name: svn:externals + common http://svn.tuxisalive.com/firmware/tuxdefs Modified: firmware/tuxrf/trunk/device.aps =================================================================== --- firmware/tuxrf/trunk/device.aps 2007-10-01 09:49:25 UTC (rev 557) +++ firmware/tuxrf/trunk/device.aps 2007-10-01 10:29:33 UTC (rev 558) @@ -1 +1 @@ -<AVRStudio><MANAGEMENT><ProjectName>device</ProjectName><Created>10-Nov-2005 15:17:29</Created><LastEdit>03-Jul-2007 17:14:47</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>10-Nov-2005 15:17:29</Created><Version>4</Version><Build>4, 12, 0, 454</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\device.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>ATmega168</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><Item>580</Item><Item>51</Item><Item>584</Item><Item>634</Item><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>1</WATCHNUM><WATCHNAMES><Pane0><Variables>ts</Variables><Variables>i</Variables><Variables>rf_rx_state</Variables><Variables>checksum</Variables><Variables>protocol_flags</Variables><Variables>rf_buffer_tx</Variables><Variables>channel</Variables><Variables>FHAState</Variables><Variables>frequencyTable</Variables><Variables>commandStatus</Variables></Pane0><Pane1><Variables>sof_ary</Variables><Variables>rf_buffer_rx1</Variables><Variables>rf_buffer_rx2</Variables><Variables>rf_buffer_tx1</Variables><Variables>rf_buffer_tx2</Variables><Variables>headerb</Variables><Variables>commandBuffer</Variables><Variables>sleepMode</Variables></Pane1><Pane2><Variables>spi_count</Variables><Variables>spi_lenght</Variables><Variables>Test</Variables><Variables>sinus</Variables></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module><map private="C:\Documents and Settings\Pascal\Desktop\TUX\MainBoard\RF\branches\New_timing\" public=""/><map private="C:\Documents and Settings\Pascal\Desktop\TUX\MainBoard\RF\branches\RF_test\Branches\" public=""/></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>device.c</SOURCEFILE><SOURCEFILE>init.c</SOURCEFILE><SOURCEFILE>misc.c</SOURCEFILE><SOURCEFILE>prot.c</SOURCEFILE><SOURCEFILE>rf_ctrl.c</SOURCEFILE><SOURCEFILE>varis.c</SOURCEFILE><SOURCEFILE>sleep.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><SOURCEFILE>bootloader.c</SOURCEFILE><HEADERFILE>varis.h</HEADERFILE><HEADERFILE>init.h</HEADERFILE><HEADERFILE>misc.h</HEADERFILE><HEADERFILE>prot.h</HEADERFILE><HEADERFILE>rf_ctrl.h</HEADERFILE><HEADERFILE>defines.h</HEADERFILE><HEADERFILE>bootloader.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><HEADERFILE>sleep.h</HEADERFILE><HEADERFILE>commands.h</HEADERFILE><HEADERFILE>version.h</HEADERFILE><OTHERFILE>default\device.map</OTHERFILE><OTHERFILE>default\device.lss</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega48</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>device.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS><OPTION><FILE>bootloader.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>device.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>init.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>misc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>prot.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>rf_ctrl.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>sleep.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>spi.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>varis.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=13824000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS>-Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0</LINKEROPTIONS><SEGMENTS><SEGMENT><NAME>.buffer_tx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x100</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x140</ADDRESS></SEGMENT><SEGMENT><NAME>.sof</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1e6</ADDRESS></SEGMENT><SEGMENT><NAME>.globals</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1ea</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_tx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x173</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1b3</ADDRESS></SEGMENT></SEGMENTS></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20060421\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20060421\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><Files><File00000><FileId>00000</FileId><FileName>device.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>rf_ctrl.c</FileName><Status>258</Status></File00001><File00002><FileId>00002</FileId><FileName>init.c</FileName><Status>258</Status></File00002><File00003><FileId>00003</FileId><FileName>misc.c</FileName><Status>258</Status></File00003><File00004><FileId>00004</FileId><FileName>sleep.c</FileName><Status>258</Status></File00004><File00005><FileId>00005</FileId><FileName>spi.c</FileName><Status>258</Status></File00005></Files><Workspace><File00000><Position>303 72 1381 502</Position><LineCol>0 0</LineCol><State>Maximized</State></File00000></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> +<AVRStudio><MANAGEMENT><ProjectName>device</ProjectName><Created>10-Nov-2005 15:17:29</Created><LastEdit>01-Oct-2007 12:29:22</LastEdit><ICON>241</ICON><ProjectType>0</ProjectType><Created>10-Nov-2005 15:17:29</Created><Version>4</Version><Build>4, 12, 0, 454</Build><ProjectTypeName>AVR GCC</ProjectTypeName></MANAGEMENT><CODE_CREATION><ObjectFile>default\device.elf</ObjectFile><EntryFile></EntryFile><SaveFolder>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\</SaveFolder></CODE_CREATION><DEBUG_TARGET><CURRENT_TARGET>JTAGICE mkII</CURRENT_TARGET><CURRENT_PART>ATmega168</CURRENT_PART><BREAKPOINTS></BREAKPOINTS><IO_EXPAND><Item>580</Item><Item>51</Item><Item>584</Item><Item>634</Item><HIDE>false</HIDE></IO_EXPAND><REGISTERNAMES><Register>R00</Register><Register>R01</Register><Register>R02</Register><Register>R03</Register><Register>R04</Register><Register>R05</Register><Register>R06</Register><Register>R07</Register><Register>R08</Register><Register>R09</Register><Register>R10</Register><Register>R11</Register><Register>R12</Register><Register>R13</Register><Register>R14</Register><Register>R15</Register><Register>R16</Register><Register>R17</Register><Register>R18</Register><Register>R19</Register><Register>R20</Register><Register>R21</Register><Register>R22</Register><Register>R23</Register><Register>R24</Register><Register>R25</Register><Register>R26</Register><Register>R27</Register><Register>R28</Register><Register>R29</Register><Register>R30</Register><Register>R31</Register></REGISTERNAMES><COM>Auto</COM><COMType>0</COMType><WATCHNUM>1</WATCHNUM><WATCHNAMES><Pane0><Variables>ts</Variables><Variables>i</Variables><Variables>rf_rx_state</Variables><Variables>checksum</Variables><Variables>protocol_flags</Variables><Variables>rf_buffer_tx</Variables><Variables>channel</Variables><Variables>FHAState</Variables><Variables>frequencyTable</Variables><Variables>commandStatus</Variables></Pane0><Pane1><Variables>sof_ary</Variables><Variables>rf_buffer_rx1</Variables><Variables>rf_buffer_rx2</Variables><Variables>rf_buffer_tx1</Variables><Variables>rf_buffer_tx2</Variables><Variables>headerb</Variables><Variables>commandBuffer</Variables><Variables>sleepMode</Variables></Pane1><Pane2><Variables>spi_count</Variables><Variables>spi_lenght</Variables><Variables>Test</Variables><Variables>sinus</Variables></Pane2><Pane3></Pane3></WATCHNAMES><BreakOnTrcaeFull>0</BreakOnTrcaeFull></DEBUG_TARGET><Debugger><modules><module><map private="C:\Documents and Settings\Pascal\Desktop\TUX\MainBoard\RF\branches\New_timing\" public=""/><map private="C:\Documents and Settings\Pascal\Desktop\TUX\MainBoard\RF\branches\RF_test\Branches\" public=""/></module></modules><Triggers></Triggers></Debugger><AVRGCCPLUGIN><FILES><SOURCEFILE>device.c</SOURCEFILE><SOURCEFILE>init.c</SOURCEFILE><SOURCEFILE>misc.c</SOURCEFILE><SOURCEFILE>prot.c</SOURCEFILE><SOURCEFILE>rf_ctrl.c</SOURCEFILE><SOURCEFILE>varis.c</SOURCEFILE><SOURCEFILE>sleep.c</SOURCEFILE><SOURCEFILE>spi.c</SOURCEFILE><SOURCEFILE>bootloader.c</SOURCEFILE><HEADERFILE>varis.h</HEADERFILE><HEADERFILE>init.h</HEADERFILE><HEADERFILE>misc.h</HEADERFILE><HEADERFILE>prot.h</HEADERFILE><HEADERFILE>rf_ctrl.h</HEADERFILE><HEADERFILE>defines.h</HEADERFILE><HEADERFILE>bootloader.h</HEADERFILE><HEADERFILE>spi.h</HEADERFILE><HEADERFILE>sleep.h</HEADERFILE><HEADERFILE>version.h</HEADERFILE><HEADERFILE>common\commands.h</HEADERFILE><OTHERFILE>default\device.map</OTHERFILE><OTHERFILE>default\device.lss</OTHERFILE></FILES><CONFIGS><CONFIG><NAME>default</NAME><USESEXTERNALMAKEFILE>NO</USESEXTERNALMAKEFILE><EXTERNALMAKEFILE></EXTERNALMAKEFILE><PART>atmega48</PART><HEX>1</HEX><LIST>1</LIST><MAP>1</MAP><OUTPUTFILENAME>device.elf</OUTPUTFILENAME><OUTPUTDIR>default\</OUTPUTDIR><ISDIRTY>1</ISDIRTY><OPTIONS><OPTION><FILE>bootloader.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>device.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>init.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>misc.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>prot.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>rf_ctrl.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>sleep.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>spi.c</FILE><OPTIONLIST></OPTIONLIST></OPTION><OPTION><FILE>varis.c</FILE><OPTIONLIST></OPTIONLIST></OPTION></OPTIONS><INCDIRS/><LIBDIRS/><LIBS/><LINKOBJECTS/><OPTIONSFORALL>-Wall -gdwarf-2 -DF_CPU=13824000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums</OPTIONSFORALL><LINKEROPTIONS>-Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0</LINKEROPTIONS><SEGMENTS><SEGMENT><NAME>.buffer_tx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x100</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx1</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x140</ADDRESS></SEGMENT><SEGMENT><NAME>.sof</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1e6</ADDRESS></SEGMENT><SEGMENT><NAME>.globals</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1ea</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_tx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x173</ADDRESS></SEGMENT><SEGMENT><NAME>.buffer_rx2</NAME><SEGMENT>SRAM</SEGMENT><ADDRESS>0x1b3</ADDRESS></SEGMENT></SEGMENTS></CONFIG></CONFIGS><LASTCONFIG>default</LASTCONFIG><USES_WINAVR>1</USES_WINAVR><GCC_LOC>C:\WinAVR-20060421\bin\avr-gcc.exe</GCC_LOC><MAKE_LOC>C:\WinAVR-20060421\utils\bin\make.exe</MAKE_LOC></AVRGCCPLUGIN><IOView><usergroups/></IOView><ProjectFiles><Files><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\varis.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\init.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\misc.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\prot.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\rf_ctrl.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\defines.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\bootloader.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\spi.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\sleep.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\version.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\common\commands.h</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\device.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\init.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\misc.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\prot.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\rf_ctrl.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\varis.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\sleep.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\spi.c</Name><Name>C:\Documents and Settings\david\My Documents\tux\firmware\tuxrf\trunk\bootloader.c</Name></Files></ProjectFiles><Files><File00000><FileId>00000</FileId><FileName>device.c</FileName><Status>1</Status></File00000><File00001><FileId>00001</FileId><FileName>rf_ctrl.c</FileName><Status>258</Status></File00001><File00002><FileId>00002</FileId><FileName>init.c</FileName><Status>258</Status></File00002><File00003><FileId>00003</FileId><FileName>misc.c</FileName><Status>258</Status></File00003><File00004><FileId>00004</FileId><FileName>sleep.c</FileName><Status>258</Status></File00004><File00005><FileId>00005</FileId><FileName>spi.c</FileName><Status>258</Status></File00005><File00006><FileId>00006</FileId><FileName>version.h</FileName><Status>1</Status></File00006></Files><Workspace><File00000><Position>303 73 1381 503</Position><LineCol>39 2</LineCol></File00000><File00006><Position>303 72 1391 507</Position><LineCol>21 60</LineCol><State>Maximized</State></File00006></Workspace><Events><Bookmarks></Bookmarks></Events><Trace><Filters></Filters></Trace></AVRStudio> Modified: firmware/tuxrf/trunk/device.c =================================================================== --- firmware/tuxrf/trunk/device.c 2007-10-01 09:49:25 UTC (rev 557) +++ firmware/tuxrf/trunk/device.c 2007-10-01 10:29:33 UTC (rev 558) @@ -9,7 +9,7 @@ #include "rf_ctrl.h" #include "spi.h" #include "sleep.h" -#include "commands.h" +#include "common/commands.h" #include "version.h" /* Bootloader can be included with the program */ @@ -24,10 +24,21 @@ */ #define CPU_NUMBER TUXRF_CPU_NUM /* sound CPU */ -const author_t author __attribute__((section(".version"))) = {AUTHOR_CMD, AUTHOR_ID, 0}; -const revision_t svn_revision __attribute__((section(".version"))) = {REVISION_CMD, REVISION_NUMBER, 0}; -const version_t tag_version __attribute__((section(".version"))) = {VERSION_CMD, CPU_NUMBER, VER_MAJOR, VER_MINOR, VER_UPDATE}; +/* XXX Add the linker script to have fixed version positions once the project will compile with latest gcc under linux. */ +const author_t author __attribute__ ((section("version"))) = +{ + AUTHOR_CMD, AUTHOR_ID, 0, +}; +const revision_t svn_revision __attribute__ ((section("version"))) = +{ + REVISION_CMD, SVN_REV, SVN_STATUS, +}; +const version_t tag_version __attribute__ ((section("version"))) = +{ + VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE, +}; + //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: main * Added: firmware/tuxrf/trunk/version.h =================================================================== --- firmware/tuxrf/trunk/version.h (rev 0) +++ firmware/tuxrf/trunk/version.h 2007-10-01 10:29:33 UTC (rev 558) @@ -0,0 +1,24 @@ +/* KySoH iTux agent + * + * Behavioural source code + * created on 2005/10/20 David Bourgeois + * -------------------------------------------------------- + * + */ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +/* + * Version number + */ + +#define VER_MAJOR 0 +#define VER_MINOR 2 +#define VER_UPDATE 0 + +#define AUTHOR_ID 0 /* official release */ +#define SVN_REV 0xFFEE /* XXX find a way to define this automatically in the Makefile from SVN */ +#define SVN_STATUS 0 /* XXX also fix this in the Makefile */ + +#endif /* _VERSION_H_ */ |
From: jaguarondi <c2m...@c2...> - 2007-10-01 09:49:31
|
Author: jaguarondi Date: 2007-10-01 11:49:25 +0200 (Mon, 01 Oct 2007) New Revision: 557 Modified: firmware/fuxrf/trunk/device.c firmware/fuxrf/trunk/init.c firmware/fuxrf/trunk/misc.c firmware/fuxrf/trunk/prot.c firmware/fuxrf/trunk/rf_ctrl.c firmware/fuxrf/trunk/spi.c firmware/tuxrf/trunk/default/Makefile firmware/tuxrf/trunk/device.c firmware/tuxrf/trunk/init.c firmware/tuxrf/trunk/misc.c firmware/tuxrf/trunk/prot.c firmware/tuxrf/trunk/rf_ctrl.c firmware/tuxrf/trunk/sleep.c firmware/tuxrf/trunk/spi.c Log: * Slight changes on comments from the last modifications given by Pascal on 06/2007. Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/device.c 2007-10-01 09:49:25 UTC (rev 557) @@ -40,9 +40,8 @@ //* Action: Main routine of the Device * //* Duration: tbd * //* Size: tbd * -//* Date: 31.01.06 * -//* Description: Get connected to the Basestation, get values from the sensors* -//* and digital I/O * +//* Date: 26.06.07 * +//* Description: Get connected to the tux, manage sleep mode and SPI * //***************************************************************************** //MASTER Modified: firmware/fuxrf/trunk/init.c =================================================================== --- firmware/fuxrf/trunk/init.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/init.c 2007-10-01 09:49:25 UTC (rev 557) @@ -112,6 +112,17 @@ } +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: init_frame_RF * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: init of TX buffer and compute checksum * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Init the TX buffers with the starting values * +//***************************************************************************** void init_frame_RF (void) { unsigned char i, header_rf; Modified: firmware/fuxrf/trunk/misc.c =================================================================== --- firmware/fuxrf/trunk/misc.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/misc.c 2007-10-01 09:49:25 UTC (rev 557) @@ -114,7 +114,7 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: calc_checksum * -//* Parameters: val * +//* Parameters: *pbuffer * //* Returns: NONE * //* Action: calc_checksum * //* Duration: tbd * Modified: firmware/fuxrf/trunk/prot.c =================================================================== --- firmware/fuxrf/trunk/prot.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/prot.c 2007-10-01 09:49:25 UTC (rev 557) @@ -47,14 +47,14 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * -//* Function: get_link * +//* Function: system_start_up * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: connect to tux if possible * //* Duration: tbd * //* Size: tbd * -//* Date: 10.07.06 * -//* Description: Synchronise to the Basestation and get logged into the system* +//* Date: 31.01.06 * +//* Description: Synchronise to the tux and get logged into the system * //***************************************************************************** void system_start_up(void) { @@ -109,14 +109,14 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * -//* Function: get_link * +//* Function: setup_pac * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: Build correct RF frame * //* Duration: tbd * //* Size: tbd * -//* Date: XX.XX.XX * -//* Description: Synchronise to the Basestation and get logged into the system* +//* Date: 26.06.07 * +//* Description: Build RF packet and manage some protocol function * //***************************************************************************** void setup_pac (void) { Modified: firmware/fuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 09:49:25 UTC (rev 557) @@ -14,14 +14,13 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: TIM1_COMPA_IRQ * -//* Parameters: None * -//* Global variable: None * +//* Parameters: NONE * //* Returns: None * //* Action: Generate Timing for ATR2406 * //* Duration:worsest case 31.25us * //* 3.8us to switch case!! * //* Size: tbd * -//* Date: XX.XX.XX * +//* Date: 26.06.07 * //* Description: State machine to generate all the needed timings for the * //* RF - Software flow. * //***************************************************************************** @@ -242,9 +241,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: start_rf_timer * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: init Timer1 * //* Duration: tbd * //* Size: tbd * @@ -268,7 +266,7 @@ //* Function: init_atr2406 * //* Parameters: channel, mode * //* Global variable: gfilter * -//* Returns: None * +//* Returns: NONE * //* Action: Basic setup of ATR2406 * //* Duration: tbd * //* Size: tbd * @@ -330,9 +328,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_up_atr2406 * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power up RF chip * //* Duration: tbd * //* Size: tbd * @@ -356,9 +353,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_dwn_atr2406 * -//* Parameters: None * -//* Global variable : None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power down RF chip * //* Duration: tbd * //* Size: tbd * Modified: firmware/fuxrf/trunk/spi.c =================================================================== --- firmware/fuxrf/trunk/spi.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/spi.c 2007-10-01 09:49:25 UTC (rev 557) @@ -4,6 +4,17 @@ #include "varis.h" +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: spiTransaction * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Manage the SPI transaction * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Send and receive sound / command via the SPI * +//***************************************************************************** void spiTransaction(void) { unsigned char headerb; // Header spi byte Modified: firmware/tuxrf/trunk/default/Makefile =================================================================== --- firmware/tuxrf/trunk/default/Makefile 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/default/Makefile 2007-10-01 09:49:25 UTC (rev 557) @@ -22,7 +22,7 @@ ## Linker flags LDFLAGS = $(COMMON) -LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map +LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map LDFLAGS += -Wl,-section-start=.buffer_tx1=0x800100 LDFLAGS += -Wl,-section-start=.buffer_rx1=0x800140 LDFLAGS += -Wl,-section-start=.sof=0x8001e6 Modified: firmware/tuxrf/trunk/device.c =================================================================== --- firmware/tuxrf/trunk/device.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/device.c 2007-10-01 09:49:25 UTC (rev 557) @@ -37,8 +37,7 @@ //* Duration: tbd * //* Size: tbd * //* Date: 31.01.06 * -//* Description: Get connected to the Basestation, get values from the sensors* -//* and digital I/O * +//* Description: Get connected to the dongle, manage sleep mode and SPI * //***************************************************************************** //SLAVE Modified: firmware/tuxrf/trunk/init.c =================================================================== --- firmware/tuxrf/trunk/init.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/init.c 2007-10-01 09:49:25 UTC (rev 557) @@ -121,7 +121,7 @@ //* Function: init_toy_id * //* Parameters: NONE * //* Returns: NONE * -//* Action: init of the global variables * +//* Action: init or not the toy ID depending of context * //* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * @@ -149,11 +149,11 @@ //* Function: init_frame_RF * //* Parameters: NONE * //* Returns: NONE * -//* Action: init of the global variables * +//* Action: init of TX buffer and compute checksum * //* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * -//* Description: Init frame buffer * +//* Description: Init the TX buffers with the starting values * //***************************************************************************** void init_frame_RF (void) { Modified: firmware/tuxrf/trunk/misc.c =================================================================== --- firmware/tuxrf/trunk/misc.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/misc.c 2007-10-01 09:49:25 UTC (rev 557) @@ -37,7 +37,7 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: calc_checksum * -//* Parameters: val * +//* Parameters: *pbuffer * //* Returns: NONE * //* Action: calc_checksum * //* Duration: tbd * Modified: firmware/tuxrf/trunk/prot.c =================================================================== --- firmware/tuxrf/trunk/prot.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/prot.c 2007-10-01 09:49:25 UTC (rev 557) @@ -12,16 +12,16 @@ //* Function: system_start_up * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: connect to dongle if possible * //* Duration: tbd * //* Size: tbd * //* Date: 31.01.06 * -//* Description: Synchronise to the Basestation and get logged into the system* +//* Description: Synchronise to the dongle and get logged into the system * //***************************************************************************** void system_start_up(void) { unsigned char i, out, sleepCmpt; - unsigned char RFinitState = WAIT_LOG; // Init state machine variable + unsigned char RFinitState; // Init state machine variable ui_16 j; rf_status |= SLAVE; // Set rf status like slave @@ -158,10 +158,10 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * -//* Function: get_link * +//* Function: setup_pac * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: Build correct RF frame * //* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * Modified: firmware/tuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 09:49:25 UTC (rev 557) @@ -11,8 +11,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: TIM1_COMPA_IRQ * -//* Parameters: None * -//* Global variable : None * +//* Parameters: NONE * +//* Global variable : NONE * //* Returns: None * //* Action: Generate Timing for ATR2406 * //* Duration:worsest case 31.25us * @@ -202,9 +202,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: start_rf_timer * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: init Timer1 * //* Duration: tbd * //* Size: tbd * @@ -226,9 +225,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: start_rf_timer_scanning * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: init Timer1 for scanning * //* Duration: tbd * //* Size: tbd * @@ -252,7 +250,7 @@ //* Function: init_atr2406 * //* Parameters: channel, mode * //* Global variable: gfilter * -//* Returns: None * +//* Returns: NONE * //* Action: Basic setup of ATR2406 * //* Duration: tbd * //* Size: tbd * @@ -314,9 +312,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_up_atr2406 * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power up RF chip * //* Duration: tbd * //* Size: tbd * @@ -340,9 +337,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_dwn_atr2406 * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power down RF chip * //* Duration: tbd * //* Size: tbd * Modified: firmware/tuxrf/trunk/sleep.c =================================================================== --- firmware/tuxrf/trunk/sleep.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/sleep.c 2007-10-01 09:49:25 UTC (rev 557) @@ -2,6 +2,18 @@ #include <util/delay.h> #include "varis.h" + +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: resetCPU * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Reset the CPU * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Reset the CPU using the watchdog * +//***************************************************************************** void resetCPU (void) { wdt_reset (); // Reset the watchdog timer @@ -10,6 +22,17 @@ } +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: goToSleep * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Go to sleep mode * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Configure type of sleep mode and execute it * +//***************************************************************************** void goToSleep (void) { if (((sleepMode == 0x01) || (sleepMode == 0x03)) && (commandStatus == 0))// Go to sleep @@ -35,6 +58,17 @@ } +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: WATCHDOG_TIMEOUT * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Disable wathdog timer * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Interrupt to go out of sleep * +//***************************************************************************** SIGNAL (SIG_WATCHDOG_TIMEOUT) { WDTCSR &= ~0x40; // Desactivate watchdog interrupt Modified: firmware/tuxrf/trunk/spi.c =================================================================== --- firmware/tuxrf/trunk/spi.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/spi.c 2007-10-01 09:49:25 UTC (rev 557) @@ -4,6 +4,17 @@ #include "varis.h" +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: spiTransaction * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Manage the SPI transaction * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Send and receive sound / command via the SPI * +//***************************************************************************** void spiTransaction(void) { unsigned char headerb; // Header spi byte |
From: jaguarondi <c2m...@c2...> - 2007-10-01 09:28:07
|
Author: jaguarondi Date: 2007-10-01 11:27:39 +0200 (Mon, 01 Oct 2007) New Revision: 556 Modified: firmware/tuxrf/trunk/bootloader.h Log: * The bootloader I2C of tuxrf address was wrong. Modified: firmware/tuxrf/trunk/bootloader.h =================================================================== --- firmware/tuxrf/trunk/bootloader.h 2007-10-01 09:12:28 UTC (rev 555) +++ firmware/tuxrf/trunk/bootloader.h 2007-10-01 09:27:39 UTC (rev 556) @@ -38,7 +38,7 @@ /** \ingroup tuxRF_firmware Slave address for bootloader mode */ -#define I2C_BL_TWAR (0X33 << 1) +#define I2C_BL_TWAR (0X32 << 1) void bootloader(void) __attribute__ ((section (".bootloader"))) __attribute__ ((naked)); void i2cWaitForComplete(void) __attribute__ ((section (".bootloader"))); |