|
From: Jérémie D. <Ba...@us...> - 2010-02-08 16:08:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "krobot".
The branch, master has been updated
via 47ce2657ec649f47a042dd2bb2dc6d18cdb14d56 (commit)
from dfcfe7e5c9efe6b7648973249ff9b311f74eb3f4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 47ce2657ec649f47a042dd2bb2dc6d18cdb14d56
Author: Jérémie Dimino <je...@di...>
Date: Mon Feb 8 17:07:29 2010 +0100
Add a command to put a card into bootloader mode
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 155affe..02352ac 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -233,6 +233,7 @@ struct
OP_method GetFirmwareBuild : string
OP_method GetBoardInfo : string
+ OP_method Bootloader : unit
let proxy krobot card =
OBus_proxy.make krobot.peer
@@ -243,4 +244,5 @@ struct
let get_firmware_build krobot card = get_firmware_build (proxy krobot card)
let get_board_info krobot card = get_board_info (proxy krobot card)
+ let bootloader krobot card = bootloader (proxy krobot card)
end
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index 4c7046b..065439c 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -93,6 +93,9 @@ module Card : sig
val state : t -> card -> state React.signal
(** Returns the status of one of the card of the krobot *)
+ val bootloader : t -> card -> unit Lwt.t
+ (** Put the card into bootloader mode *)
+
val get_firmware_build : t -> card -> string Lwt.t
val get_board_info : t -> card -> string Lwt.t
end
diff --git a/PC_Mainboard/clients/tools/script.ml b/PC_Mainboard/clients/tools/script.ml
index 3fc468c..69bb06b 100644
--- a/PC_Mainboard/clients/tools/script.ml
+++ b/PC_Mainboard/clients/tools/script.ml
@@ -39,6 +39,8 @@ let commands = [
args = [("motor", Arg_keyword ["left"; "right"; "both"]);
("speed", Arg_int);
("acc", Arg_int)] };
+ { name = "bootloader";
+ args = [("card", Arg_keyword ["interface"; "sensor"; "motor"])] };
]
let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l
@@ -121,6 +123,13 @@ let exec krobot line =
~motor:(motor_of_string (arg_string "motor" "both"))
~speed:(arg_int "speed" 100)
~acc:(arg_int "acc" 800)
+ | "bootloader" ->
+ Krobot.Card.bootloader krobot
+ (match arg_string "card" "" with
+ | "interface" -> `Interface
+ | "motor" -> `Motor
+ | "sensor" -> `Sensor
+ | _ -> failwith "Script.exec: invalid card")
| _ ->
return ()
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 12b2eea..46d8587 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -573,6 +573,9 @@ struct
OL_method GetState : Card.state = fun card ->
return (React.S.value (Card.state card.card))
+ OL_method Bootloader : unit = fun card ->
+ Card.send_command card.card Protocol.cmd_bootloader ""
+
OL_signal StateChanged : Card.state
let make card path =
hooks/post-receive
--
krobot
|