You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(50) |
Feb
(137) |
Mar
(84) |
Apr
(36) |
May
(100) |
Jun
(5) |
Jul
|
Aug
(4) |
Sep
(13) |
Oct
(1) |
Nov
(4) |
Dec
(22) |
2011 |
Jan
(4) |
Feb
(9) |
Mar
(113) |
Apr
(76) |
May
(31) |
Jun
(19) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
(6) |
May
(19) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(22) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jérémie D. <Ba...@us...> - 2011-03-17 17:33:40
|
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 0ef1a91b2e2b76850c49e886509582c29fedca10 (commit) via e45ba7e950de7c8e47e1fb22fe65fe5d70f5c9d0 (commit) via 79daa52c3f1ca70c351dc1e962fdadf65572034a (commit) via e349b0939341e36863161e6ec90fb2e4456aaf54 (commit) via 4507dff68656ad0300ed2138a58f694f7889ee1f (commit) from f5ee1deaeab0135564b27e85f3b72ca253d45831 (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 0ef1a91b2e2b76850c49e886509582c29fedca10 Merge: e349b0939341e36863161e6ec90fb2e4456aaf54 e45ba7e950de7c8e47e1fb22fe65fe5d70f5c9d0 Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 18:32:38 2011 +0100 Merge commit 'e45ba7e950de7c8e47e1fb22fe65fe5d70f5c9d0' commit e45ba7e950de7c8e47e1fb22fe65fe5d70f5c9d0 Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 18:30:45 2011 +0100 [info] add modules Krobot_service and Krobot_init commit 79daa52c3f1ca70c351dc1e962fdadf65572034a Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 10:06:01 2011 +0100 [info] use the environment variable DBUS_KROBOT_BUS_ADDRESS to get the address of the krobot bus commit e349b0939341e36863161e6ec90fb2e4456aaf54 Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 09:58:41 2011 +0100 Revert "[info] do not send back messages comming from the can in the driver" This reverts commit 4507dff68656ad0300ed2138a58f694f7889ee1f. commit 4507dff68656ad0300ed2138a58f694f7889ee1f Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 00:37:16 2011 +0100 [info] do not send back messages comming from the can in the driver ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index 9e15987..ad461ed 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -28,7 +28,9 @@ Library krobot Modules: Krobot_can, Krobot_bus, - Krobot_message + Krobot_message, + Krobot_service, + Krobot_init Library "krobot-can" FindlibName: can diff --git a/info/control2011/krobot-api.odocl b/info/control2011/krobot-api.odocl index eb2e004..c80c72a 100644 --- a/info/control2011/krobot-api.odocl +++ b/info/control2011/krobot-api.odocl @@ -1,7 +1,9 @@ # OASIS_START -# DO NOT EDIT (digest: f5cc533adaa505f8bedbd5bafe08f3f0) +# DO NOT EDIT (digest: 979bfe64930f512bd800c4336aa992aa) src/lib/Krobot_can src/lib/Krobot_bus src/lib/Krobot_message +src/lib/Krobot_service +src/lib/Krobot_init src/can/Krobot_can_bus # OASIS_STOP diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index 51de5db..aa37ba5 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,9 +1,9 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 3c3d5a057069def7d5ccec6bb9cbfeaa) *) +(* DO NOT EDIT (digest: c4a37702729314af3884a7f930148eae) *) (* - Regenerated by OASIS v0.2.0~alpha1 + Regenerated by OASIS v0.2.0 Visit http://oasis.forge.ocamlcore.org for more information and documentation about functions used in this file. *) @@ -5101,7 +5101,13 @@ let setup_t = }, { lib_modules = - ["Krobot_can"; "Krobot_bus"; "Krobot_message"]; + [ + "Krobot_can"; + "Krobot_bus"; + "Krobot_message"; + "Krobot_service"; + "Krobot_init" + ]; lib_internal_modules = []; lib_findlib_parent = None; lib_findlib_name = Some "krobot"; @@ -5299,7 +5305,7 @@ let setup_t = schema_data = PropList.Data.create (); plugin_data = []; }; - version = "0.2.0~alpha1"; + version = "0.2.0"; };; let setup () = BaseSetup.setup setup_t;; diff --git a/info/control2011/src/driver/krobot_driver.ml b/info/control2011/src/driver/krobot_driver.ml index 2883b33..fe7af7f 100644 --- a/info/control2011/src/driver/krobot_driver.ml +++ b/info/control2011/src/driver/krobot_driver.ml @@ -12,17 +12,15 @@ open Lwt open Lwt_react +let device = ref "slcan0" + +let () = Krobot_init.arg "-device" (Arg.Set_string device) "<device> The device to use" + lwt () = - if Array.length Sys.argv <> 2 then begin - print_endline "usage: krobot-driver <interface>"; - exit 2; - end; + lwt bus = Krobot_init.init_service "Driver" in (* Open the CAN bus. *) - lwt can = Krobot_can_bus.open_can Sys.argv.(1) in - - (* Open the D-Bus connection. *) - lwt bus = Krobot_bus.get () in + lwt can = Krobot_can_bus.open_can !device in (* D-Bus --> CAN *) E.keep (E.map_s (Krobot_can_bus.send can) (Krobot_can.recv bus)); diff --git a/info/control2011/src/interfaces/krobot_interface_service.obus b/info/control2011/src/interfaces/krobot_interface_service.obus new file mode 100644 index 0000000..6f5e940 --- /dev/null +++ b/info/control2011/src/interfaces/krobot_interface_service.obus @@ -0,0 +1,20 @@ +(* + * krobot_interface_service.obus + * ----------------------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** Interface for krobot services. *) +interface fr.krobot.Service { + (** Make the service to exit. *) + method kill : () -> () + with { + org.freedesktop.DBus.Method.NoReply = "true" + } + + signal log : (message : string) + (** Signal emitted when the service emit a log message. *) +} diff --git a/info/control2011/src/lib/krobot.mllib b/info/control2011/src/lib/krobot.mllib index b7f4d81..a197c9c 100644 --- a/info/control2011/src/lib/krobot.mllib +++ b/info/control2011/src/lib/krobot.mllib @@ -1,6 +1,8 @@ # OASIS_START -# DO NOT EDIT (digest: b3bccfeb9433d08b24a1724cd101e42d) +# DO NOT EDIT (digest: 28c0fb0dd216f4e31f545770f08d4c64) Krobot_can Krobot_bus Krobot_message +Krobot_service +Krobot_init # OASIS_STOP diff --git a/info/control2011/src/lib/krobot_bus.ml b/info/control2011/src/lib/krobot_bus.ml index 18a1352..f6e6112 100644 --- a/info/control2011/src/lib/krobot_bus.ml +++ b/info/control2011/src/lib/krobot_bus.ml @@ -7,11 +7,27 @@ * This file is a part of [kro]bot. *) +let section = Lwt_log.Section.make "bus" + type t = OBus_bus.t external of_bus : OBus_bus.t -> t = "%identity" external to_bus : t -> OBus_bus.t = "%identity" -let bus = lazy(OBus_bus.of_addresses [OBus_address.make "unix" [("abstract", "krobot")]]) +let address = ref ( + match try Some(Sys.getenv "DBUS_KROBOT_BUS_ADDRESS") with Not_found -> None with + | Some addr -> + addr + | None -> + "unix:abstract=krobot" +) + +let bus = lazy( + try_lwt + OBus_bus.of_addresses (OBus_address.of_string !address) + with exn -> + lwt () = Lwt_log.error_f ~section ~exn "failed to connect to the krobot bus at address '%s'" !address in + raise_lwt exn +) let get () = Lazy.force bus diff --git a/info/control2011/src/lib/krobot_bus.mli b/info/control2011/src/lib/krobot_bus.mli index 3fe3946..4c94893 100644 --- a/info/control2011/src/lib/krobot_bus.mli +++ b/info/control2011/src/lib/krobot_bus.mli @@ -17,3 +17,7 @@ external to_bus : t -> OBus_bus.t = "%identity" val get : unit -> t Lwt.t (** [get ()] returns the krobot bus. *) + +(**/**) + +val address : string ref diff --git a/info/control2011/src/lib/krobot_init.ml b/info/control2011/src/lib/krobot_init.ml new file mode 100644 index 0000000..65ddc81 --- /dev/null +++ b/info/control2011/src/lib/krobot_init.ml @@ -0,0 +1,140 @@ +(* + * krobot_init.ml + * -------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Lwt +open Lwt_react + +let section = Lwt_log.Section.make "init" + +(* +-----------------------------------------------------------------+ + | Misc | + +-----------------------------------------------------------------+ *) + +let () = + Printexc.register_printer + (function + | Unix.Unix_error(error, func, "") -> + Some(Printf.sprintf "%s: %s" func (Unix.error_message error)) + | Unix.Unix_error(error, func, arg) -> + Some(Printf.sprintf "%s(%S): %s" func arg (Unix.error_message error)) + | _ -> + None) + +let program_name = Filename.basename Sys.executable_name +let usage = Printf.sprintf "%s <options>" program_name + +(* +-----------------------------------------------------------------+ + | Command line arguments | + +-----------------------------------------------------------------+ *) + +let arguments = ref [] +let arg key spec doc = arguments := (key, spec, doc) :: !arguments + +let () = arg "-dbus-address" (Arg.Set_string Krobot_bus.address) "<address> The address to connect to the krobot bus" + +(* +-----------------------------------------------------------------+ + | Programs | + +-----------------------------------------------------------------+ *) + +let init_program name = + Arg.parse (Arg.align !arguments) (fun _ -> raise (Arg.Bad "unknown option")) usage; + lwt () = Lwt_log.info ~section "openning the robot bus" in + try_lwt + Krobot_bus.get () + with exn -> + exit 1 + +(* +-----------------------------------------------------------------+ + | Services | + +-----------------------------------------------------------------+ *) + +open Krobot_interface_service.Fr_krobot_Service + +let init_service name = + let no_fork = ref false and kill = ref false in + arg "-no-fork" (Arg.Set no_fork) " Run in foreground"; + arg "-kill" (Arg.Set kill) " Kill any running instance and exit"; + Arg.parse (Arg.align !arguments) (fun _ -> raise (Arg.Bad "unknown option")) usage; + + lwt () = Lwt_log.info ~section "openning the robot bus" in + lwt bus = try_lwt Krobot_bus.get () with exn -> exit 1 in + + let dbus_name = Printf.sprintf "fr.krobot.Service.%s" name in + + (* Kill other instances. *) + lwt () = + if !kill then begin + try_lwt + lwt owner = OBus_bus.get_name_owner (Krobot_bus.to_bus bus) dbus_name in + lwt () = Lwt_log.info_f ~section "killing the running %s service" name in + Krobot_service.kill (Krobot_service.of_proxy (OBus_proxy.make (OBus_peer.make (Krobot_bus.to_bus bus) owner) ["fr"; "krobot"; "Service"])) + with OBus_bus.Name_has_no_owner _ -> + return () + finally + exit 0 + end else + return () + in + + (* Exit the program when we lost the name. *) + lwt () = + OBus_signal.connect (OBus_bus.name_lost (Krobot_bus.to_bus bus)) + >|= E.map (fun lost_name -> if dbus_name = lost_name then exit 0) + >|= E.keep + in + + (* Daemonize or not. *) + lwt () = + if !no_fork then + Lwt_log.notice_f ~section "starting %s in foreground mode" name + else begin + lwt () = Lwt_log.notice_f ~section "starting %s in daemon mode" name in + Lwt_daemon.daemonize (); + return () + end + in + + (* Create the service object and export it. *) + let obj = OBus_object.make ~interfaces:[make { m_kill = (fun obj () -> exit 0) }] ["fr"; "krobot"; "Service"] in + OBus_object.attach obj (); + OBus_object.export (Krobot_bus.to_bus bus) obj; + + (* Send logs over D-Bus. *) + let dbus_logger = + Lwt_log.make + (fun section level lines -> + if level > Lwt_log.Info then + let buf = Buffer.create 42 in + let lines = + List.map + (fun line -> + Buffer.clear buf; + Lwt_log.render ~buffer:buf ~template:"$(level)@$(name)[$(section)]: $(message)" ~section ~level ~message:line; + Buffer.contents buf) + lines + in + OBus_signal.emit s_log obj (String.concat "\n" lines) + else + return ()) + return + in + + Lwt_log.default := Lwt_log.broadcast [!Lwt_log.default; dbus_logger]; + + (* Register the program on the bus. *) + lwt () = + OBus_bus.request_name (Krobot_bus.to_bus bus) ~allow_replacement:true ~replace_existing:true dbus_name >>= function + | `Primary_owner -> + return () + | _ -> + lwt () = Lwt_log.error_f ~section "cannot obtain the name %S on D-Bus" dbus_name in + exit 1 + in + + return bus diff --git a/info/control2011/src/lib/krobot_init.mli b/info/control2011/src/lib/krobot_init.mli new file mode 100644 index 0000000..38457cb --- /dev/null +++ b/info/control2011/src/lib/krobot_init.mli @@ -0,0 +1,24 @@ +(* + * krobot_init.mli + * --------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** Initialization *) + +val arg : Arg.key -> Arg.spec -> Arg.doc -> unit + (** [arg key spec doc] registers the given command line argument. *) + +val init_program : string -> Krobot_bus.t Lwt.t + (** [init_program name] initialises a program. A program always run + in foreground. *) + +val init_service : string -> Krobot_bus.t Lwt.t + (** [init_service name] initialises a service. A service may run in + foreground or in background according to command line arguments. + This module ensure that only one instance of the service is + running at a time. It also export a simple interface over + D-Bus. *) diff --git a/info/control2011/src/lib/krobot_service.ml b/info/control2011/src/lib/krobot_service.ml new file mode 100644 index 0000000..784664d --- /dev/null +++ b/info/control2011/src/lib/krobot_service.ml @@ -0,0 +1,60 @@ +(* + * krobot_service.ml + * ----------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +include OBus_proxy.Private + +open Lwt +open Lwt_react +open Krobot_interface_service.Fr_krobot_Service + +let all bus = + OBus_proxy.make + (OBus_peer.anonymous (Krobot_bus.to_bus bus)) + ["fr"; "krobot"; "Service"] + +let make bus name = + if name = "" then + all bus + else + OBus_proxy.make + (OBus_peer.make + (Krobot_bus.to_bus bus) + (Printf.sprintf "fr.krobot.Service.%s" name)) + ["fr"; "krobot"; "Service"] + +let name service = + let s = OBus_proxy.name service in + let i = String.rindex s '.' in + String.sub s (i + 1) (String.length s - (i + 1)) + +let list bus = + lwt names = OBus_bus.list_names (Krobot_bus.to_bus bus) in + return + (List.map + (fun name -> + OBus_proxy.make + (OBus_peer.make (Krobot_bus.to_bus bus) name) + ["fr"; "krobot"; "Service"]) + (List.sort + String.compare + (List.filter + (fun name -> + String.sub name 0 (String.rindex name '.') = "fr.krobot.Service") + names))) + +let monitor bus = + lwt e = OBus_signal.connect (OBus_bus.name_owner_changed (Krobot_bus.to_bus bus)) in + lwt l = list bus in + return (S.hold l (E.map_s (fun _ -> list bus) e)) + +let kill service = + OBus_method.call_no_reply m_kill service () + +let log service = + OBus_signal.make s_log service diff --git a/info/control2011/src/lib/krobot_service.mli b/info/control2011/src/lib/krobot_service.mli new file mode 100644 index 0000000..e04fac4 --- /dev/null +++ b/info/control2011/src/lib/krobot_service.mli @@ -0,0 +1,34 @@ +(* + * krobot_service.mli + * ------------------ + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +include OBus_proxy.Private + +val make : Krobot_bus.t -> string -> t + (** [make bus name pid] creates a service proxy from its name. *) + +val all : Krobot_bus.t -> t + (** Proxy that represent all running services. You can use it to + receive logs from all services. *) + +val name : t -> string + (** Returns the name of the given service. *) + +val list : Krobot_bus.t -> t list Lwt.t + (** List all available services on the bus. *) + +val monitor : Krobot_bus.t -> t list React.signal Lwt.t + (** Returns the signal holding the sorted list of services on the + bus. *) + +val kill : t -> unit Lwt.t + (** [kill service] kills the given service. *) + +val log : t -> string OBus_signal.t + (** [log service] is the D-Bus signal which occurs when [service] + emit a log message. *) hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2011-03-17 07:35:22
|
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 f5ee1deaeab0135564b27e85f3b72ca253d45831 (commit) from 087bcb371629e47643a859f493b2b461fbd5b47f (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 f5ee1deaeab0135564b27e85f3b72ca253d45831 Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 08:33:56 2011 +0100 [info] krobot plot does not take arguments anymore ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/tools/krobot_plot.ml b/info/control2011/src/tools/krobot_plot.ml index 37a2271..26768b2 100644 --- a/info/control2011/src/tools/krobot_plot.ml +++ b/info/control2011/src/tools/krobot_plot.ml @@ -91,10 +91,6 @@ let draw window graph = +-----------------------------------------------------------------+ *) lwt () = - if Array.length Sys.argv <> 2 then begin - print_endline "usage: krobot-plot <interface>"; - exit 2; - end; ignore (GMain.init ()); Lwt_glib.install (); hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2011-03-17 02:20:57
|
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 087bcb371629e47643a859f493b2b461fbd5b47f (commit) via 15c18273663de7c9afcc0c0a6347eae583b21bee (commit) via 0e31786ef022b67fc39a0da8ab0978d8a9259e9c (commit) via e542c7cc26874ba01147e130419112c977f6938c (commit) via eeabfdaa65f900d7ab9361af498ea125910c7053 (commit) from 7e6d41bbb5241359357c38cde937501c361fc3d0 (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 087bcb371629e47643a859f493b2b461fbd5b47f Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 03:17:19 2011 +0100 [info] typo in _oasis commit 15c18273663de7c9afcc0c0a6347eae583b21bee Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 03:14:13 2011 +0100 [info] add krobot-dump It prints all CAN frames that passes on D-Bus. commit 0e31786ef022b67fc39a0da8ab0978d8a9259e9c Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 03:10:16 2011 +0100 [info] add module Krobot_message for interpretation of CAN frames commit e542c7cc26874ba01147e130419112c977f6938c Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 02:19:34 2011 +0100 [info] add module Krobot_bus commit eeabfdaa65f900d7ab9361af498ea125910c7053 Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 01:54:53 2011 +0100 [info] move tools/ to src/tools ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index 660cd97..9e15987 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -26,10 +26,12 @@ Library krobot Path: src/lib Install: true Modules: - Krobot_can + Krobot_can, + Krobot_bus, + Krobot_message -Library "krobot-can-bus" - FindlibName: can-bus +Library "krobot-can" + FindlibName: can FindlibParent: krobot BuildDepends: krobot, lwt.syntax XMETADescription: CAN interface using SocketCAN @@ -40,7 +42,7 @@ Library "krobot-can-bus" CSources: can_stubs.c Library "krobot-interfaces" - FindlibName: can + FindlibName: interfaces FindlibParent: krobot BuildDepends: obus XMETADescription: [Kro]bot D-Bus interfaces @@ -59,18 +61,25 @@ Executable "krobot-driver" Install: true CompiledObject: best MainIs: krobot_driver.ml - BuildDepends: krobot.can-bus, lwt.syntax + BuildDepends: krobot.can, lwt.syntax # +-------------------------------------------------------------------+ # | Tools | # +-------------------------------------------------------------------+ +Executable "krobot-dump" + Path: src/tools + Install: true + CompiledObject: best + MainIs: krobot_dump.ml + BuildDepends: krobot, lwt.syntax + Executable "krobot-plot" - Path: tools + Path: src/tools Install: true CompiledObject: best MainIs: krobot_plot.ml - BuildDepends: krobot.can-bus, lwt.syntax, cairo.lablgtk2, lwt.glib, threads + BuildDepends: krobot, lwt.syntax, cairo.lablgtk2, lwt.glib, threads # +-------------------------------------------------------------------+ # | Examples | @@ -81,7 +90,7 @@ Executable "dump-can" Install: false CompiledObject: best MainIs: dump_can.ml - BuildDepends: krobot.can-bus, lwt.syntax + BuildDepends: krobot.can, lwt.syntax # +-------------------------------------------------------------------+ # | Doc | @@ -95,7 +104,7 @@ Document "krobot-api" DataFiles: style.css BuildTools: ocamldoc XOCamlbuildPath: ./ - XOCamlbuildLibraries: krobot.can + XOCamlbuildLibraries: krobot, krobot.can # +-------------------------------------------------------------------+ # | Misc | diff --git a/info/control2011/_tags b/info/control2011/_tags index 84b7177..91cf530 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -2,72 +2,76 @@ <src/interfaces/*.ml>: -syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: 0d12bbe4a1abf7768037e82c428ea4fa) +# DO NOT EDIT (digest: 737f6ffc25aca37ee689df337eca3afe) +# Library krobot-interfaces +"src/interfaces": include +<src/interfaces/*.ml{,i}>: pkg_obus # Library krobot "src/lib": include +<src/lib/*.ml{,i}>: use_krobot-interfaces <src/lib/*.ml{,i}>: pkg_obus <src/lib/*.ml{,i}>: pkg_lwt.unix <src/lib/*.ml{,i}>: pkg_lwt.syntax -<src/lib/*.ml{,i}>: pkg_krobot.interfaces -# Library krobot-can-bus +# Library krobot-can "src/can": include -<src/can/krobot-can-bus.{cma,cmxa}>: use_libkrobot-can-bus +<src/can/krobot-can.{cma,cmxa}>: use_libkrobot-can <src/can/*.ml{,i}>: use_krobot +<src/can/*.ml{,i}>: use_krobot-interfaces <src/can/*.ml{,i}>: pkg_obus <src/can/*.ml{,i}>: pkg_lwt.unix <src/can/*.ml{,i}>: pkg_lwt.syntax -<src/can/*.ml{,i}>: pkg_krobot.interfaces "src/can/can_stubs.c": use_krobot +"src/can/can_stubs.c": use_krobot-interfaces "src/can/can_stubs.c": pkg_obus "src/can/can_stubs.c": pkg_lwt.unix "src/can/can_stubs.c": pkg_lwt.syntax -"src/can/can_stubs.c": pkg_krobot.interfaces +# Executable krobot-dump +<src/tools/krobot_dump.{native,byte}>: use_krobot +<src/tools/krobot_dump.{native,byte}>: use_krobot-interfaces +<src/tools/krobot_dump.{native,byte}>: pkg_obus +<src/tools/krobot_dump.{native,byte}>: pkg_lwt.unix +<src/tools/krobot_dump.{native,byte}>: pkg_lwt.syntax # Executable krobot-driver -<src/driver/krobot_driver.{native,byte}>: use_krobot-can-bus +<src/driver/krobot_driver.{native,byte}>: use_krobot-can <src/driver/krobot_driver.{native,byte}>: use_krobot +<src/driver/krobot_driver.{native,byte}>: use_krobot-interfaces <src/driver/krobot_driver.{native,byte}>: pkg_obus <src/driver/krobot_driver.{native,byte}>: pkg_lwt.unix <src/driver/krobot_driver.{native,byte}>: pkg_lwt.syntax -<src/driver/krobot_driver.{native,byte}>: pkg_krobot.interfaces -<src/driver/*.ml{,i}>: use_krobot-can-bus +<src/driver/*.ml{,i}>: use_krobot-can <src/driver/*.ml{,i}>: use_krobot +<src/driver/*.ml{,i}>: use_krobot-interfaces <src/driver/*.ml{,i}>: pkg_obus <src/driver/*.ml{,i}>: pkg_lwt.unix <src/driver/*.ml{,i}>: pkg_lwt.syntax -<src/driver/*.ml{,i}>: pkg_krobot.interfaces -# Library krobot-interfaces -"src/interfaces": include -<src/interfaces/*.ml{,i}>: pkg_obus # Executable dump-can -<examples/dump_can.{native,byte}>: use_krobot-can-bus +<examples/dump_can.{native,byte}>: use_krobot-can <examples/dump_can.{native,byte}>: use_krobot +<examples/dump_can.{native,byte}>: use_krobot-interfaces <examples/dump_can.{native,byte}>: pkg_obus <examples/dump_can.{native,byte}>: pkg_lwt.unix <examples/dump_can.{native,byte}>: pkg_lwt.syntax -<examples/dump_can.{native,byte}>: pkg_krobot.interfaces -<examples/*.ml{,i}>: use_krobot-can-bus +<examples/*.ml{,i}>: use_krobot-can <examples/*.ml{,i}>: use_krobot +<examples/*.ml{,i}>: use_krobot-interfaces <examples/*.ml{,i}>: pkg_obus <examples/*.ml{,i}>: pkg_lwt.unix <examples/*.ml{,i}>: pkg_lwt.syntax -<examples/*.ml{,i}>: pkg_krobot.interfaces # Executable krobot-plot -<tools/krobot_plot.{native,byte}>: use_krobot-can-bus -<tools/krobot_plot.{native,byte}>: use_krobot -<tools/krobot_plot.{native,byte}>: pkg_threads -<tools/krobot_plot.{native,byte}>: pkg_obus -<tools/krobot_plot.{native,byte}>: pkg_lwt.unix -<tools/krobot_plot.{native,byte}>: pkg_lwt.syntax -<tools/krobot_plot.{native,byte}>: pkg_lwt.glib -<tools/krobot_plot.{native,byte}>: pkg_krobot.interfaces -<tools/krobot_plot.{native,byte}>: pkg_cairo.lablgtk2 -<tools/*.ml{,i}>: use_krobot-can-bus -<tools/*.ml{,i}>: use_krobot -<tools/*.ml{,i}>: pkg_threads -<tools/*.ml{,i}>: pkg_obus -<tools/*.ml{,i}>: pkg_lwt.unix -<tools/*.ml{,i}>: pkg_lwt.syntax -<tools/*.ml{,i}>: pkg_lwt.glib -<tools/*.ml{,i}>: pkg_krobot.interfaces -<tools/*.ml{,i}>: pkg_cairo.lablgtk2 +<src/tools/krobot_plot.{native,byte}>: use_krobot +<src/tools/krobot_plot.{native,byte}>: use_krobot-interfaces +<src/tools/krobot_plot.{native,byte}>: pkg_threads +<src/tools/krobot_plot.{native,byte}>: pkg_obus +<src/tools/krobot_plot.{native,byte}>: pkg_lwt.unix +<src/tools/krobot_plot.{native,byte}>: pkg_lwt.syntax +<src/tools/krobot_plot.{native,byte}>: pkg_lwt.glib +<src/tools/krobot_plot.{native,byte}>: pkg_cairo.lablgtk2 +<src/tools/*.ml{,i}>: use_krobot +<src/tools/*.ml{,i}>: use_krobot-interfaces +<src/tools/*.ml{,i}>: pkg_threads +<src/tools/*.ml{,i}>: pkg_obus +<src/tools/*.ml{,i}>: pkg_lwt.unix +<src/tools/*.ml{,i}>: pkg_lwt.syntax +<src/tools/*.ml{,i}>: pkg_lwt.glib +<src/tools/*.ml{,i}>: pkg_cairo.lablgtk2 # OASIS_STOP diff --git a/info/control2011/krobot-api.odocl b/info/control2011/krobot-api.odocl index 9436993..eb2e004 100644 --- a/info/control2011/krobot-api.odocl +++ b/info/control2011/krobot-api.odocl @@ -1,4 +1,7 @@ # OASIS_START -# DO NOT EDIT (digest: c46f7c116cbb13ebe71e2f42643fde6d) -src/interfaces/Krobot_interface_can +# DO NOT EDIT (digest: f5cc533adaa505f8bedbd5bafe08f3f0) +src/lib/Krobot_can +src/lib/Krobot_bus +src/lib/Krobot_message +src/can/Krobot_can_bus # OASIS_STOP diff --git a/info/control2011/myocamlbuild.ml b/info/control2011/myocamlbuild.ml index e8c9828..5037c7d 100644 --- a/info/control2011/myocamlbuild.ml +++ b/info/control2011/myocamlbuild.ml @@ -1,5 +1,5 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: c1fbc9a81674247e1022c94dba267b98) *) +(* DO NOT EDIT (digest: 570b31c8f48685aca9662d28e560f425) *) module OASISGettext = struct # 21 "/home/dim/sources/oasis/src/oasis/OASISGettext.ml" @@ -453,11 +453,11 @@ let package_default = { MyOCamlbuildBase.lib_ocaml = [ + ("src/interfaces/krobot-interfaces", ["src/interfaces"]); ("src/lib/krobot", ["src/lib"]); - ("src/can/krobot-can-bus", ["src/can"]); - ("src/interfaces/krobot-interfaces", ["src/interfaces"]) + ("src/can/krobot-can", ["src/can"]) ]; - lib_c = [("krobot-can-bus", "src/can", [])]; + lib_c = [("krobot-can", "src/can", [])]; flags = []; } ;; diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index ced1ec2..51de5db 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,9 +1,9 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: c25983b62a9af39916294c75cf318f50) *) +(* DO NOT EDIT (digest: 3c3d5a057069def7d5ccec6bb9cbfeaa) *) (* - Regenerated by OASIS v0.2.0 + Regenerated by OASIS v0.2.0~alpha1 Visit http://oasis.forge.ocamlcore.org for more information and documentation about functions used in this file. *) @@ -5044,6 +5044,35 @@ let setup_t = [ Library ({ + cs_name = "krobot-interfaces"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "src/interfaces"; + bs_compiled_object = Best; + bs_build_depends = [FindlibPackage ("obus", None)]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + { + lib_modules = ["Krobot_interface_can"]; + lib_internal_modules = []; + lib_findlib_parent = Some "krobot"; + lib_findlib_name = Some "interfaces"; + lib_findlib_containers = []; + }); + Library + ({ cs_name = "krobot"; cs_data = PropList.Data.create (); cs_plugin_data = []; @@ -5058,7 +5087,7 @@ let setup_t = FindlibPackage ("lwt.unix", None); FindlibPackage ("lwt.syntax", None); FindlibPackage ("obus", None); - FindlibPackage ("krobot.interfaces", None) + InternalLibrary "krobot-interfaces" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; @@ -5071,7 +5100,8 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { - lib_modules = ["Krobot_can"]; + lib_modules = + ["Krobot_can"; "Krobot_bus"; "Krobot_message"]; lib_internal_modules = []; lib_findlib_parent = None; lib_findlib_name = Some "krobot"; @@ -5079,7 +5109,7 @@ let setup_t = }); Library ({ - cs_name = "krobot-can-bus"; + cs_name = "krobot-can"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, @@ -5107,9 +5137,36 @@ let setup_t = lib_modules = ["Krobot_can_bus"]; lib_internal_modules = []; lib_findlib_parent = Some "krobot"; - lib_findlib_name = Some "can-bus"; + lib_findlib_name = Some "can"; lib_findlib_containers = []; }); + Executable + ({ + cs_name = "krobot-dump"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "src/tools"; + bs_compiled_object = Best; + bs_build_depends = + [ + InternalLibrary "krobot"; + FindlibPackage ("lwt.syntax", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + {exec_custom = false; exec_main_is = "krobot_dump.ml"; }); SrcRepo ({ cs_name = "head"; @@ -5165,7 +5222,7 @@ let setup_t = bs_compiled_object = Best; bs_build_depends = [ - InternalLibrary "krobot-can-bus"; + InternalLibrary "krobot-can"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; @@ -5179,35 +5236,6 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "krobot_driver.ml"; }); - Library - ({ - cs_name = "krobot-interfaces"; - cs_data = PropList.Data.create (); - cs_plugin_data = []; - }, - { - bs_build = [(OASISExpr.EBool true, true)]; - bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "src/interfaces"; - bs_compiled_object = Best; - bs_build_depends = [FindlibPackage ("obus", None)]; - bs_build_tools = [ExternalTool "ocamlbuild"]; - bs_c_sources = []; - bs_data_files = []; - bs_ccopt = [(OASISExpr.EBool true, [])]; - bs_cclib = [(OASISExpr.EBool true, [])]; - bs_dlllib = [(OASISExpr.EBool true, [])]; - bs_dllpath = [(OASISExpr.EBool true, [])]; - bs_byteopt = [(OASISExpr.EBool true, [])]; - bs_nativeopt = [(OASISExpr.EBool true, [])]; - }, - { - lib_modules = ["Krobot_interface_can"]; - lib_internal_modules = []; - lib_findlib_parent = Some "krobot"; - lib_findlib_name = Some "can"; - lib_findlib_containers = []; - }); Executable ({ cs_name = "dump-can"; @@ -5221,7 +5249,7 @@ let setup_t = bs_compiled_object = Best; bs_build_depends = [ - InternalLibrary "krobot-can-bus"; + InternalLibrary "krobot-can"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; @@ -5244,11 +5272,11 @@ let setup_t = { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "tools"; + bs_path = "src/tools"; bs_compiled_object = Best; bs_build_depends = [ - InternalLibrary "krobot-can-bus"; + InternalLibrary "krobot"; FindlibPackage ("lwt.syntax", None); FindlibPackage ("cairo.lablgtk2", None); FindlibPackage ("lwt.glib", None); @@ -5271,7 +5299,7 @@ let setup_t = schema_data = PropList.Data.create (); plugin_data = []; }; - version = "0.2.0"; + version = "0.2.0~alpha1"; };; let setup () = BaseSetup.setup setup_t;; diff --git a/info/control2011/src/can/krobot-can-bus.mllib b/info/control2011/src/can/krobot-can-bus.mllib deleted file mode 100644 index 198bccd..0000000 --- a/info/control2011/src/can/krobot-can-bus.mllib +++ /dev/null @@ -1,4 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: 05e2413cff140c2f298af6bff05bd866) -Krobot_can_bus -# OASIS_STOP diff --git a/info/control2011/src/can/krobot-can.mllib b/info/control2011/src/can/krobot-can.mllib new file mode 100644 index 0000000..198bccd --- /dev/null +++ b/info/control2011/src/can/krobot-can.mllib @@ -0,0 +1,4 @@ +# OASIS_START +# DO NOT EDIT (digest: 05e2413cff140c2f298af6bff05bd866) +Krobot_can_bus +# OASIS_STOP diff --git a/info/control2011/src/can/libkrobot-can-bus.clib b/info/control2011/src/can/libkrobot-can-bus.clib deleted file mode 100644 index 0c062e7..0000000 --- a/info/control2011/src/can/libkrobot-can-bus.clib +++ /dev/null @@ -1,4 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: c331c7eb709b41509f57de577257bebd) -can_stubs.o -# OASIS_STOP diff --git a/info/control2011/src/can/libkrobot-can.clib b/info/control2011/src/can/libkrobot-can.clib new file mode 100644 index 0000000..0c062e7 --- /dev/null +++ b/info/control2011/src/can/libkrobot-can.clib @@ -0,0 +1,4 @@ +# OASIS_START +# DO NOT EDIT (digest: c331c7eb709b41509f57de577257bebd) +can_stubs.o +# OASIS_STOP diff --git a/info/control2011/src/driver/krobot_driver.ml b/info/control2011/src/driver/krobot_driver.ml index 5ab3ea7..2883b33 100644 --- a/info/control2011/src/driver/krobot_driver.ml +++ b/info/control2011/src/driver/krobot_driver.ml @@ -22,14 +22,10 @@ lwt () = lwt can = Krobot_can_bus.open_can Sys.argv.(1) in (* Open the D-Bus connection. *) - lwt bus = OBus_bus.of_addresses [OBus_address.make "unix" [("abstract", "krobot")]] in + lwt bus = Krobot_bus.get () in (* D-Bus --> CAN *) - lwt () = - OBus_signal.connect (Krobot_can.frames bus) - >|= E.map_s (Krobot_can_bus.send can) - >|= E.keep - in + E.keep (E.map_s (Krobot_can_bus.send can) (Krobot_can.recv bus)); (* CAN --> D-Bus *) while_lwt true do diff --git a/info/control2011/src/lib/META b/info/control2011/src/lib/META index dd5ae28..8cab18d 100644 --- a/info/control2011/src/lib/META +++ b/info/control2011/src/lib/META @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: 0d94e89d9f084a95ee7ffaabb7600006) +# DO NOT EDIT (digest: 6d4fe02a501933ad8464e70af7fcf3b1) version = "1.0" description = "The [Kro]bot library" requires = "lwt.unix obus krobot.interfaces" @@ -8,20 +8,20 @@ archive(native) = "krobot.cmxa" exists_if = "krobot.cma" package "can" ( version = "1.0" + description = "CAN interface using SocketCAN" + requires = "krobot" + archive(byte) = "krobot-can.cma" + archive(native) = "krobot-can.cmxa" + exists_if = "krobot-can.cma" +) + +package "interfaces" ( + version = "1.0" description = "[Kro]bot D-Bus interfaces" requires = "obus" archive(byte) = "krobot-interfaces.cma" archive(native) = "krobot-interfaces.cmxa" exists_if = "krobot-interfaces.cma" ) - -package "can-bus" ( - version = "1.0" - description = "CAN interface using SocketCAN" - requires = "krobot" - archive(byte) = "krobot-can-bus.cma" - archive(native) = "krobot-can-bus.cmxa" - exists_if = "krobot-can-bus.cma" -) # OASIS_STOP diff --git a/info/control2011/src/lib/krobot.mllib b/info/control2011/src/lib/krobot.mllib index c9dc889..b7f4d81 100644 --- a/info/control2011/src/lib/krobot.mllib +++ b/info/control2011/src/lib/krobot.mllib @@ -1,4 +1,6 @@ # OASIS_START -# DO NOT EDIT (digest: e8b05244aefe4716ab01c3db2a2ca413) +# DO NOT EDIT (digest: b3bccfeb9433d08b24a1724cd101e42d) Krobot_can +Krobot_bus +Krobot_message # OASIS_STOP diff --git a/info/control2011/src/lib/krobot_bus.ml b/info/control2011/src/lib/krobot_bus.ml new file mode 100644 index 0000000..18a1352 --- /dev/null +++ b/info/control2011/src/lib/krobot_bus.ml @@ -0,0 +1,17 @@ +(* + * krobot_bus.ml + * ------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +type t = OBus_bus.t + +external of_bus : OBus_bus.t -> t = "%identity" +external to_bus : t -> OBus_bus.t = "%identity" + +let bus = lazy(OBus_bus.of_addresses [OBus_address.make "unix" [("abstract", "krobot")]]) + +let get () = Lazy.force bus diff --git a/info/control2011/src/lib/krobot_bus.mli b/info/control2011/src/lib/krobot_bus.mli new file mode 100644 index 0000000..3fe3946 --- /dev/null +++ b/info/control2011/src/lib/krobot_bus.mli @@ -0,0 +1,19 @@ +(* + * krobot_bus.mli + * -------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** The krobot bus. *) + +type t = private OBus_bus.t + (** Type of the krobot bus. *) + +external of_bus : OBus_bus.t -> t = "%identity" +external to_bus : t -> OBus_bus.t = "%identity" + +val get : unit -> t Lwt.t + (** [get ()] returns the krobot bus. *) diff --git a/info/control2011/src/lib/krobot_can.ml b/info/control2011/src/lib/krobot_can.ml index ba50ba8..5565804 100644 --- a/info/control2011/src/lib/krobot_can.ml +++ b/info/control2011/src/lib/krobot_can.ml @@ -7,6 +7,8 @@ * This file is a part of [kro]bot. *) +open Lwt_react + (* +-----------------------------------------------------------------+ | CAN Frames | +-----------------------------------------------------------------+ *) @@ -49,6 +51,17 @@ let frame ~identifier ~kind ~remote ~format ~data = raise (Invalid_frame "identifier is too big"); { identifier; kind; remote; format; data } +let string_of_frame frame = + let buf = Buffer.create (String.length frame.data * 4) in + String.iter (fun ch -> Printf.bprintf buf "\\x%02x" (Char.code ch)) frame.data; + Printf.sprintf + "{ identifier = %d; kind = %s; remote = %B; format = %s; data = \"%s\" }" + frame.identifier + (match frame.kind with Data -> "Data" | Error -> "Error") + frame.remote + (match frame.format with F11bits -> "F11bits" | F29bits -> "F29bits") + (Buffer.contents buf) + (* +-----------------------------------------------------------------+ | Reading/writing numbers | +-----------------------------------------------------------------+ *) @@ -160,13 +173,24 @@ let frame_of_value v = let send bus frame = OBus_connection.send_message - bus + (Krobot_bus.to_bus bus) (OBus_message.signal ~path:["fr"; "krobot"; "CAN"] ~interface:"fr.krobot.CAN" ~member:"message" [value_of_frame frame]) -let frames bus = - let proxy = OBus_proxy.make (OBus_peer.anonymous bus) ["fr"; "krobot"; "CAN"] in - OBus_signal.map frame_of_values (OBus_signal.make Krobot_interface_can.Fr_krobot_CAN.s_message proxy) +let recv bus = + let proxy = OBus_proxy.make (OBus_peer.anonymous (Krobot_bus.to_bus bus)) ["fr"; "krobot"; "CAN"] in + E.fmap + (fun (ctx, frame) -> + (* Filter messages comming from us. *) + if OBus_peer.name (OBus_context.sender ctx) = OBus_bus.name (Krobot_bus.to_bus bus) then + None + else + Some frame) + (E.delay + (OBus_signal.connect + (OBus_signal.with_context + (OBus_signal.map frame_of_values + (OBus_signal.make Krobot_interface_can.Fr_krobot_CAN.s_message proxy))))) diff --git a/info/control2011/src/lib/krobot_can.mli b/info/control2011/src/lib/krobot_can.mli index fee6dd7..3e26ec5 100644 --- a/info/control2011/src/lib/krobot_can.mli +++ b/info/control2011/src/lib/krobot_can.mli @@ -62,6 +62,9 @@ val frame : (** Create a frame. It raises {!Invalid_frame} if the frame is not valid. *) +val string_of_frame : frame -> string + (** Returns the string representation of a frame. *) + (** {6 Reading/writing numbers} *) val get_sint8 : string -> int -> int @@ -92,9 +95,9 @@ val frame_of_value : OBus_value.V.single -> frame (** {6 Sending/receiving frames} *) -val send : OBus_bus.t -> frame -> unit Lwt.t +val send : Krobot_bus.t -> frame -> unit Lwt.t (** [send bus frame] sends the given frame over D-Bus. *) -val frames : OBus_bus.t -> frame OBus_signal.t - (** [frames bus] returns is the D-Bus signal which receive CAN - frames. *) +val recv : Krobot_bus.t -> frame React.event + (** [recv bus] returns is the event which occurs whan a CAN frame is + received. *) diff --git a/info/control2011/src/lib/krobot_message.ml b/info/control2011/src/lib/krobot_message.ml new file mode 100644 index 0000000..bd424fb --- /dev/null +++ b/info/control2011/src/lib/krobot_message.ml @@ -0,0 +1,100 @@ +(* + * krobot_message.ml + * ----------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Krobot_can +open Printf +open Lwt_react + +(* +-----------------------------------------------------------------+ + | Types | + +-----------------------------------------------------------------+ *) + +type direction = Forward | Backward + +type encoder_state = { + es_position : int; + es_direction : direction; +} + +type t = + | Encoder_state_1_2 of encoder_state * encoder_state + | Encoder_state_3_4 of encoder_state * encoder_state + | Unknown of frame + +(* +-----------------------------------------------------------------+ + | Message --> string | + +-----------------------------------------------------------------+ *) + +let string_of_encoder_state es = + sprintf "{ es_position = %d; es_direction = %s }" es.es_position (match es.es_direction with Forward -> "Forward" | Backward -> "Backward") + +let to_string = function + | Encoder_state_1_2(c1, c2) -> sprintf "Encoder_state_1_2(%s, %s)" (string_of_encoder_state c1) (string_of_encoder_state c2) + | Encoder_state_3_4(c3, c4) -> sprintf "Encoder_state_1_2(%s, %s)" (string_of_encoder_state c3) (string_of_encoder_state c4) + | Unknown frame -> Krobot_can.string_of_frame frame + +(* +-----------------------------------------------------------------+ + | Encoding | + +-----------------------------------------------------------------+ *) + +let encode = function + | Encoder_state_1_2(c1, c2) -> + let data = String.create 6 in + put_uint16 data 0 c1.es_position; + put_uint16 data 2 c2.es_position; + put_uint8 data 4 (match c1.es_direction with Forward -> 0 | Backward -> 1); + put_uint8 data 5 (match c2.es_direction with Forward -> 0 | Backward -> 1); + frame + ~identifier:100 + ~kind:Data + ~remote:false + ~format:F11bits + ~data + | Encoder_state_3_4(c3, c4) -> + let data = String.create 6 in + put_uint16 data 0 c3.es_position; + put_uint16 data 2 c4.es_position; + put_uint8 data 4 (match c3.es_direction with Forward -> 0 | Backward -> 1); + put_uint8 data 5 (match c4.es_direction with Forward -> 0 | Backward -> 1); + frame + ~identifier:101 + ~kind:Data + ~remote:false + ~format:F11bits + ~data + | Unknown frame -> + frame + +(* +-----------------------------------------------------------------+ + | Decoding | + +-----------------------------------------------------------------+ *) + +let decode frame = + match frame.identifier with + | 100 -> + Encoder_state_1_2 + ({ es_position = get_uint16 frame.data 0; + es_direction = if get_uint8 frame.data 4 = 0 then Forward else Backward }, + { es_position = get_uint16 frame.data 2; + es_direction = if get_uint8 frame.data 5 = 0 then Forward else Backward }) + | 101 -> + Encoder_state_3_4 + ({ es_position = get_uint16 frame.data 0; + es_direction = if get_uint8 frame.data 4 = 0 then Forward else Backward }, + { es_position = get_uint16 frame.data 2; + es_direction = if get_uint8 frame.data 5 = 0 then Forward else Backward }) + | _ -> + Unknown frame + +(* +-----------------------------------------------------------------+ + | Sending/receiving messages | + +-----------------------------------------------------------------+ *) + +let send bus msg = Krobot_can.send bus (encode msg) +let recv bus = E.map decode (Krobot_can.recv bus) diff --git a/info/control2011/src/lib/krobot_message.mli b/info/control2011/src/lib/krobot_message.mli new file mode 100644 index 0000000..c8f5c63 --- /dev/null +++ b/info/control2011/src/lib/krobot_message.mli @@ -0,0 +1,45 @@ +(* + * krobot_message.mli + * ------------------ + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** Krobot messages. *) + +type direction = Forward | Backward + (** Type of directions. *) + +(** Type of state of an encoder. *) +type encoder_state = { + es_position : int; + (** The position of the encoder. *) + es_direction : direction; + (** The direction of the encoder. *) +} + +(** Type of messages. *) +type t = + | Encoder_state_1_2 of encoder_state * encoder_state + (** State of the encoder 1 and 2. *) + | Encoder_state_3_4 of encoder_state * encoder_state + (** State of the encoder 3 and 4. *) + | Unknown of Krobot_can.frame + (** An unknown can frame. *) + +val to_string : t -> string + (** Returns the string representation of the given message. *) + +val encode : t -> Krobot_can.frame + (** Encode the given message into a CAN frame. *) + +val decode : Krobot_can.frame -> t + (** Decode the given CAN frame into a message. *) + +val send : Krobot_bus.t -> t -> unit Lwt.t + (** [send bus message] sends the given message over D-Bus. *) + +val recv : Krobot_bus.t -> t React.event + (** [recv bus] is the event which receive messages. *) diff --git a/info/control2011/src/tools/krobot_dump.ml b/info/control2011/src/tools/krobot_dump.ml new file mode 100644 index 0000000..fd0e339 --- /dev/null +++ b/info/control2011/src/tools/krobot_dump.ml @@ -0,0 +1,24 @@ +(* + * krobot_dump.ml + * -------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* Print CAN frames that passes on D-Bus. *) + +open Lwt +open Lwt_react + +lwt () = + lwt bus = Krobot_bus.get () in + + E.keep + (E.map_s + (fun msg -> + Lwt_io.printl (Krobot_message.to_string msg)) + (Krobot_message.recv bus)); + + fst (wait ()) diff --git a/info/control2011/src/tools/krobot_plot.ml b/info/control2011/src/tools/krobot_plot.ml new file mode 100644 index 0000000..37a2271 --- /dev/null +++ b/info/control2011/src/tools/krobot_plot.ml @@ -0,0 +1,135 @@ +(* + * krobot_plot.ml + * -------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Lwt +open Lwt_react +open Krobot_message + +(* +-----------------------------------------------------------------+ + | Graphs | + +-----------------------------------------------------------------+ *) + +let graph_duration = 10.0 + (* Which amount of data to keep in graphs. *) + +(* Type of graphs. *) +type graph = { + points : (float * int) Queue.t array; + (* Queue of points with their time. They are ordered by increasing + date. *) + mutable max : int; + (* The maximum reached. *) +} + +(* Remove old points. *) +let update_graph graph time = + Array.iter + (fun q -> + while not (Queue.is_empty q) && fst (Queue.top q) +. graph_duration < time do + ignore (Queue.take q) + done) + graph.points + +(* +-----------------------------------------------------------------+ + | Plotting | + +-----------------------------------------------------------------+ *) + +let rec colors = (1., 0., 0.) :: (0., 1., 0.) :: (0., 0., 1.) :: (1., 1., 0.) :: colors + +let plot ctx width height graph time = + Cairo.set_source_rgb ctx 1. 1. 1.; + Cairo.rectangle ctx 0. 0. width height; + Cairo.fill ctx; + let colors = ref colors in + Array.iter + (fun q -> + let r, g, b = List.hd !colors in + colors := List.tl !colors; + Cairo.set_source_rgb ctx r g b; + let prev = ref None in + Queue.iter + (fun (date, position) -> + let x = (date -. (time -. graph_duration)) /. graph_duration *. width + and y = height -. height *. (float position /. float graph.max) in + match !prev with + | None -> + prev := Some(x, y) + | Some(x', y') -> + prev := Some(x, y); + Cairo.move_to ctx x' y'; + Cairo.line_to ctx x y; + Cairo.stroke ctx) + q) + graph.points + +(* +-----------------------------------------------------------------+ + | Drawing | + +-----------------------------------------------------------------+ *) + +let draw window graph = + while true do + let { Gtk.width; Gtk.height } = window#misc#allocation in + let surface = Cairo.image_surface_create Cairo.FORMAT_ARGB32 width height in + let ctx = Cairo.create surface in + plot ctx (float width) (float height) graph (Unix.gettimeofday ()); + let ctx = Cairo_lablgtk.create window#misc#window in + Cairo.set_source_surface ctx surface 0. 0.; + Cairo.rectangle ctx 0. 0. (float width) (float height); + Cairo.fill ctx; + Cairo.surface_finish surface; + ignore (Unix.select [] [] [] (1. /. 25.)) + done + +(* +-----------------------------------------------------------------+ + | Main-loop | + +-----------------------------------------------------------------+ *) + +lwt () = + if Array.length Sys.argv <> 2 then begin + print_endline "usage: krobot-plot <interface>"; + exit 2; + end; + ignore (GMain.init ()); + Lwt_glib.install (); + + let waiter, wakener = wait () in + + (* GTK stuff. *) + let window = GWindow.window ~title:"Krobot coders positions" () in + ignore (window#connect#destroy ~callback:(wakeup wakener)); + window#show (); + + (* Create the graph. *) + let graph = { points = Array.init 4 (fun _ -> Queue.create ()); max = 1 } in + + (* Draw in a separate thread. *) + ignore (Thread.create (fun () -> draw window graph) ()); + + lwt bus = Krobot_bus.get () in + + E.keep + (E.map + (function + | Encoder_state_1_2(enc1, enc2) -> + let time = Unix.gettimeofday () in + graph.max <- max graph.max (max enc1.es_position enc2.es_position); + Queue.push (time, enc1.es_position) graph.points.(0); + Queue.push (time, enc2.es_position) graph.points.(1); + update_graph graph time + | Encoder_state_3_4(enc3, enc4) -> + let time = Unix.gettimeofday () in + graph.max <- max graph.max (max enc3.es_position enc4.es_position); + Queue.push (time, enc3.es_position) graph.points.(2); + Queue.push (time, enc4.es_position) graph.points.(3); + update_graph graph time + | _ -> + ()) + (Krobot_message.recv bus)); + + waiter diff --git a/info/control2011/tools/krobot_plot.ml b/info/control2011/tools/krobot_plot.ml deleted file mode 100644 index e610d8f..0000000 --- a/info/control2011/tools/krobot_plot.ml +++ /dev/null @@ -1,143 +0,0 @@ -(* - * krobot_plot.ml - * -------------- - * Copyright : (c) 2011, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -open Lwt -open Krobot_can - -type direction = Forward | Backward - -type point = { time : float; position : int; direction : direction } - -(* +-----------------------------------------------------------------+ - | Graphs | - +-----------------------------------------------------------------+ *) - -let graph_duration = 10.0 - (* Which amount of data to keep in graphs. *) - -(* Type of graphs. *) -type graph = { - points : point Queue.t array; - (* Queue of points with their time. They are ordered by increasing - date. *) - mutable max : int; - (* The maximum reached. *) -} - -(* Remove old points. *) -let update_graph graph time = - Array.iter - (fun q -> - while not (Queue.is_empty q) && (Queue.top q).time +. graph_duration < time do - ignore (Queue.take q) - done) - graph.points - -(* +-----------------------------------------------------------------+ - | Plotting | - +-----------------------------------------------------------------+ *) - -let rec colors = (1., 0., 0.) :: (0., 1., 0.) :: (0., 0., 1.) :: (1., 1., 0.) :: colors - -let plot ctx width height graph time = - Cairo.set_source_rgb ctx 1. 1. 1.; - Cairo.rectangle ctx 0. 0. width height; - Cairo.fill ctx; - let colors = ref colors in - Array.iter - (fun q -> - let r, g, b = List.hd !colors in - colors := List.tl !colors; - Cairo.set_source_rgb ctx r g b; - let prev = ref None in - Queue.iter - (fun point -> - let x = (point.time -. (time -. graph_duration)) /. graph_duration *. width - and y = height -. height *. (float point.position /. float graph.max) in - match !prev with - | None -> - prev := Some(x, y) - | Some(x', y') -> - prev := Some(x, y); - Cairo.move_to ctx x' y'; - Cairo.line_to ctx x y; - Cairo.stroke ctx) - q) - graph.points - -(* +-----------------------------------------------------------------+ - | Decoding frames | - +-----------------------------------------------------------------+ *) - -let decode_frame time frame = - let data = Krobot_can.data frame in - ({ time = time; - position = get_uint16 data 0; - direction = if get_uint8 data 4 = 0 then Forward else Backward }, - { time = time; - position = get_uint16 data 2; - direction = if get_uint8 data 5 = 0 then Forward else Backward }) - -(* +-----------------------------------------------------------------+ - | Drawing | - +-----------------------------------------------------------------+ *) - -let draw window graph = - while true do - let { Gtk.width; Gtk.height } = window#misc#allocation in - let surface = Cairo.image_surface_create Cairo.FORMAT_ARGB32 width height in - let ctx = Cairo.create surface in - plot ctx (float width) (float height) graph (Unix.gettimeofday ()); - let ctx = Cairo_lablgtk.create window#misc#window in - Cairo.set_source_surface ctx surface 0. 0.; - Cairo.rectangle ctx 0. 0. (float width) (float height); - Cairo.fill ctx; - Cairo.surface_finish surface; - ignore (Unix.select [] [] [] (1. /. 25.)) - done - -(* +-----------------------------------------------------------------+ - | Main-loop | - +-----------------------------------------------------------------+ *) - -lwt () = - if Array.length Sys.argv <> 2 then begin - print_endline "usage: krobot-plot <interface>"; - exit 2; - end; - ignore (GMain.init ()); - Lwt_glib.install (); - - let window = GWindow.window ~title:"Krobot coders positions" () in - ignore (window#connect#destroy ~callback:(fun () -> exit 0)); - window#show (); - - let graph = { points = Array.init 4 (fun _ -> Queue.create ()); max = 1 } in - - ignore (Thread.create (fun () -> draw window graph) ()); - - try_lwt - lwt bus = Krobot_can_bus.open_can Sys.argv.(1) in - while_lwt true do - (* Read coder positions. *) - lwt coder1, coder2 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in - lwt coder3, coder4 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in - (* Compute the new maximum. *) - graph.max <- List.fold_left max graph.max [coder1.position; coder2.position; coder3.position; coder4.position]; - (* Add points to the graph. *) - Queue.push coder1 graph.points.(0); - Queue.push coder2 graph.points.(1); - Queue.push coder3 graph.points.(2); - Queue.push coder4 graph.points.(3); - (* Remove old points. *) - update_graph graph (Unix.gettimeofday ()); - return () - done - with Unix.Unix_error(error, func, arg) -> - Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2011-03-16 23:27:14
|
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 7e6d41bbb5241359357c38cde937501c361fc3d0 (commit) via 19eb7b0de211b1fa52109356e607bc510f7a567e (commit) from 6ce1124621e474f08558dac8d8f526973716bb9c (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 7e6d41bbb5241359357c38cde937501c361fc3d0 Author: Xavier Lagorce <Xav...@cr...> Date: Thu Mar 17 00:26:01 2011 +0100 [Controller_Motor_STM32] More realistic CAN monitor commit 19eb7b0de211b1fa52109356e607bc510f7a567e Author: Xavier Lagorce <Xav...@cr...> Date: Thu Mar 17 00:24:17 2011 +0100 [Controller_Motor_STM32] Increased kernel stack to allow more processes ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c index ccbd670..a7369a2 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c @@ -31,7 +31,7 @@ void canMonitorInit(void) { // Configure CAN driver cfg.mcr = CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP; - cfg.btr = CAN_BTR_SJW(0) | CAN_BTR_TS1(8) | CAN_BTR_TS2(1) | CAN_BTR_BRP(6);// | CAN_BTR_LBKM; // Add LBKM for loopback mode + cfg.btr = CAN_BTR_SJW(0) | CAN_BTR_TS1(8) | CAN_BTR_TS2(1) | CAN_BTR_BRP(6); cfg.n_filters = 0; cfg.filters = NULL; @@ -55,7 +55,7 @@ static void NORETURN canMonitor_process(void) { txm.ide = 1; txm.sid = 0; - timer_setDelay(&timer_can, ms_to_ticks(1000)); + timer_setDelay(&timer_can, ms_to_ticks(10)); timer_setEvent(&timer_can); while(1) { @@ -85,14 +85,6 @@ static void NORETURN canMonitor_process(void) { // Wait for the next transmission timer timer_waitEvent(&timer_can); - // blink ! - if (ind == 0) { - LED2_OFF(); - ind = 1; - } else { - LED2_ON(); - ind = 0; - } } } diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/cfg/cfg_proc.h b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/cfg/cfg_proc.h index 5e521e8..382e0d4 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/cfg/cfg_proc.h +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/cfg/cfg_proc.h @@ -86,7 +86,7 @@ * $WIZ$ type = "int" * $WIZ$ min = 0 */ -#define CONFIG_KERN_HEAP_SIZE 2048L +#define CONFIG_KERN_HEAP_SIZE 4096L /** * Module logging level. hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2011-03-16 23:24:41
|
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 6ce1124621e474f08558dac8d8f526973716bb9c (commit) from c8e4360b8d33d3ece5eda6020e207d1ffd4cd71f (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 6ce1124621e474f08558dac8d8f526973716bb9c Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 00:24:02 2011 +0100 [info] draw in a different thread in krobot-plot ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index dd67350..660cd97 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -70,7 +70,7 @@ Executable "krobot-plot" Install: true CompiledObject: best MainIs: krobot_plot.ml - BuildDepends: krobot.can-bus, lwt.syntax, cairo.lablgtk2, lwt.glib + BuildDepends: krobot.can-bus, lwt.syntax, cairo.lablgtk2, lwt.glib, threads # +-------------------------------------------------------------------+ # | Examples | diff --git a/info/control2011/_tags b/info/control2011/_tags index fee2129..84b7177 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -2,7 +2,7 @@ <src/interfaces/*.ml>: -syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: 38a5a55661f6998cf1a3f011ff7ecfd3) +# DO NOT EDIT (digest: 0d12bbe4a1abf7768037e82c428ea4fa) # Library krobot "src/lib": include <src/lib/*.ml{,i}>: pkg_obus @@ -54,6 +54,7 @@ # Executable krobot-plot <tools/krobot_plot.{native,byte}>: use_krobot-can-bus <tools/krobot_plot.{native,byte}>: use_krobot +<tools/krobot_plot.{native,byte}>: pkg_threads <tools/krobot_plot.{native,byte}>: pkg_obus <tools/krobot_plot.{native,byte}>: pkg_lwt.unix <tools/krobot_plot.{native,byte}>: pkg_lwt.syntax @@ -62,6 +63,7 @@ <tools/krobot_plot.{native,byte}>: pkg_cairo.lablgtk2 <tools/*.ml{,i}>: use_krobot-can-bus <tools/*.ml{,i}>: use_krobot +<tools/*.ml{,i}>: pkg_threads <tools/*.ml{,i}>: pkg_obus <tools/*.ml{,i}>: pkg_lwt.unix <tools/*.ml{,i}>: pkg_lwt.syntax diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index 02aa273..ced1ec2 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: a60a31dc8dbfa28c3584c2830b23531f) *) +(* DO NOT EDIT (digest: c25983b62a9af39916294c75cf318f50) *) (* Regenerated by OASIS v0.2.0 Visit http://oasis.forge.ocamlcore.org for more information and @@ -5251,7 +5251,8 @@ let setup_t = InternalLibrary "krobot-can-bus"; FindlibPackage ("lwt.syntax", None); FindlibPackage ("cairo.lablgtk2", None); - FindlibPackage ("lwt.glib", None) + FindlibPackage ("lwt.glib", None); + FindlibPackage ("threads", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; diff --git a/info/control2011/tools/krobot_plot.ml b/info/control2011/tools/krobot_plot.ml index 3e8b1f9..e610d8f 100644 --- a/info/control2011/tools/krobot_plot.ml +++ b/info/control2011/tools/krobot_plot.ml @@ -85,6 +85,24 @@ let decode_frame time frame = direction = if get_uint8 data 5 = 0 then Forward else Backward }) (* +-----------------------------------------------------------------+ + | Drawing | + +-----------------------------------------------------------------+ *) + +let draw window graph = + while true do + let { Gtk.width; Gtk.height } = window#misc#allocation in + let surface = Cairo.image_surface_create Cairo.FORMAT_ARGB32 width height in + let ctx = Cairo.create surface in + plot ctx (float width) (float height) graph (Unix.gettimeofday ()); + let ctx = Cairo_lablgtk.create window#misc#window in + Cairo.set_source_surface ctx surface 0. 0.; + Cairo.rectangle ctx 0. 0. (float width) (float height); + Cairo.fill ctx; + Cairo.surface_finish surface; + ignore (Unix.select [] [] [] (1. /. 25.)) + done + +(* +-----------------------------------------------------------------+ | Main-loop | +-----------------------------------------------------------------+ *) @@ -102,38 +120,24 @@ lwt () = let graph = { points = Array.init 4 (fun _ -> Queue.create ()); max = 1 } in + ignore (Thread.create (fun () -> draw window graph) ()); + try_lwt lwt bus = Krobot_can_bus.open_can Sys.argv.(1) in - join [ - (* Data reading. *) - while_lwt true do - (* Read coder positions. *) - lwt coder1, coder2 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in - lwt coder3, coder4 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in - (* Compute the new maximum. *) - graph.max <- List.fold_left max graph.max [coder1.position; coder2.position; coder3.position; coder4.position]; - (* Add points to the graph. *) - Queue.push coder1 graph.points.(0); - Queue.push coder2 graph.points.(1); - Queue.push coder3 graph.points.(2); - Queue.push coder4 graph.points.(3); - (* Remove old points. *) - update_graph graph (Unix.gettimeofday ()); - return () - done; - (* Drawing. *) - while_lwt true do - let { Gtk.width; Gtk.height } = window#misc#allocation in - let surface = Cairo.image_surface_create Cairo.FORMAT_ARGB32 width height in - let ctx = Cairo.create surface in - plot ctx (float width) (float height) graph (Unix.gettimeofday ()); - let ctx = Cairo_lablgtk.create window#misc#window in - Cairo.set_source_surface ctx surface 0. 0.; - Cairo.rectangle ctx 0. 0. (float width) (float height); - Cairo.fill ctx; - Cairo.surface_finish surface; - Lwt_unix.sleep 0.05 - done; - ] + while_lwt true do + (* Read coder positions. *) + lwt coder1, coder2 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in + lwt coder3, coder4 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in + (* Compute the new maximum. *) + graph.max <- List.fold_left max graph.max [coder1.position; coder2.position; coder3.position; coder4.position]; + (* Add points to the graph. *) + Queue.push coder1 graph.points.(0); + Queue.push coder2 graph.points.(1); + Queue.push coder3 graph.points.(2); + Queue.push coder4 graph.points.(3); + (* Remove old points. *) + update_graph graph (Unix.gettimeofday ()); + return () + done with Unix.Unix_error(error, func, arg) -> Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2011-03-16 23:17:32
|
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 c8e4360b8d33d3ece5eda6020e207d1ffd4cd71f (commit) via ac782540fa94043e31d790e4dd4ad60cd2a00957 (commit) from ee17197988c142797ab6828aebeca793214cb402 (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 c8e4360b8d33d3ece5eda6020e207d1ffd4cd71f Author: Jérémie Dimino <je...@di...> Date: Thu Mar 17 00:15:58 2011 +0100 [info] make krobot-plot display a graph with cairo commit ac782540fa94043e31d790e4dd4ad60cd2a00957 Author: Jérémie Dimino <je...@di...> Date: Wed Mar 16 23:17:20 2011 +0100 [info] replace E.notify_s by E.map_s and E.keep ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index 8c23795..dd67350 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -62,7 +62,7 @@ Executable "krobot-driver" BuildDepends: krobot.can-bus, lwt.syntax # +-------------------------------------------------------------------+ -# | Tools | +# | Tools | # +-------------------------------------------------------------------+ Executable "krobot-plot" @@ -70,7 +70,7 @@ Executable "krobot-plot" Install: true CompiledObject: best MainIs: krobot_plot.ml - BuildDepends: krobot.can-bus, lwt.syntax + BuildDepends: krobot.can-bus, lwt.syntax, cairo.lablgtk2, lwt.glib # +-------------------------------------------------------------------+ # | Examples | diff --git a/info/control2011/_tags b/info/control2011/_tags index fedbe71..fee2129 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -2,7 +2,7 @@ <src/interfaces/*.ml>: -syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: 714f24c8f8cd15c9da08a3b463f1d17c) +# DO NOT EDIT (digest: 38a5a55661f6998cf1a3f011ff7ecfd3) # Library krobot "src/lib": include <src/lib/*.ml{,i}>: pkg_obus @@ -57,11 +57,15 @@ <tools/krobot_plot.{native,byte}>: pkg_obus <tools/krobot_plot.{native,byte}>: pkg_lwt.unix <tools/krobot_plot.{native,byte}>: pkg_lwt.syntax +<tools/krobot_plot.{native,byte}>: pkg_lwt.glib <tools/krobot_plot.{native,byte}>: pkg_krobot.interfaces +<tools/krobot_plot.{native,byte}>: pkg_cairo.lablgtk2 <tools/*.ml{,i}>: use_krobot-can-bus <tools/*.ml{,i}>: use_krobot <tools/*.ml{,i}>: pkg_obus <tools/*.ml{,i}>: pkg_lwt.unix <tools/*.ml{,i}>: pkg_lwt.syntax +<tools/*.ml{,i}>: pkg_lwt.glib <tools/*.ml{,i}>: pkg_krobot.interfaces +<tools/*.ml{,i}>: pkg_cairo.lablgtk2 # OASIS_STOP diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index e003f47..02aa273 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 003c94954a115118c0158a0ee154e6cc) *) +(* DO NOT EDIT (digest: a60a31dc8dbfa28c3584c2830b23531f) *) (* Regenerated by OASIS v0.2.0 Visit http://oasis.forge.ocamlcore.org for more information and @@ -5249,7 +5249,9 @@ let setup_t = bs_build_depends = [ InternalLibrary "krobot-can-bus"; - FindlibPackage ("lwt.syntax", None) + FindlibPackage ("lwt.syntax", None); + FindlibPackage ("cairo.lablgtk2", None); + FindlibPackage ("lwt.glib", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; diff --git a/info/control2011/src/driver/krobot_driver.ml b/info/control2011/src/driver/krobot_driver.ml index 71d36ff..5ab3ea7 100644 --- a/info/control2011/src/driver/krobot_driver.ml +++ b/info/control2011/src/driver/krobot_driver.ml @@ -27,7 +27,8 @@ lwt () = (* D-Bus --> CAN *) lwt () = OBus_signal.connect (Krobot_can.frames bus) - >|= E.notify_s (Krobot_can_bus.send can) + >|= E.map_s (Krobot_can_bus.send can) + >|= E.keep in (* CAN --> D-Bus *) diff --git a/info/control2011/tools/krobot_plot.ml b/info/control2011/tools/krobot_plot.ml index 0629f22..3e8b1f9 100644 --- a/info/control2011/tools/krobot_plot.ml +++ b/info/control2011/tools/krobot_plot.ml @@ -10,53 +10,130 @@ open Lwt open Krobot_can -type data = { - coder_pos : int; - coder_dir : int; +type direction = Forward | Backward + +type point = { time : float; position : int; direction : direction } + +(* +-----------------------------------------------------------------+ + | Graphs | + +-----------------------------------------------------------------+ *) + +let graph_duration = 10.0 + (* Which amount of data to keep in graphs. *) + +(* Type of graphs. *) +type graph = { + points : point Queue.t array; + (* Queue of points with their time. They are ordered by increasing + date. *) + mutable max : int; + (* The maximum reached. *) } -let decode_frame frame = +(* Remove old points. *) +let update_graph graph time = + Array.iter + (fun q -> + while not (Queue.is_empty q) && (Queue.top q).time +. graph_duration < time do + ignore (Queue.take q) + done) + graph.points + +(* +-----------------------------------------------------------------+ + | Plotting | + +-----------------------------------------------------------------+ *) + +let rec colors = (1., 0., 0.) :: (0., 1., 0.) :: (0., 0., 1.) :: (1., 1., 0.) :: colors + +let plot ctx width height graph time = + Cairo.set_source_rgb ctx 1. 1. 1.; + Cairo.rectangle ctx 0. 0. width height; + Cairo.fill ctx; + let colors = ref colors in + Array.iter + (fun q -> + let r, g, b = List.hd !colors in + colors := List.tl !colors; + Cairo.set_source_rgb ctx r g b; + let prev = ref None in + Queue.iter + (fun point -> + let x = (point.time -. (time -. graph_duration)) /. graph_duration *. width + and y = height -. height *. (float point.position /. float graph.max) in + match !prev with + | None -> + prev := Some(x, y) + | Some(x', y') -> + prev := Some(x, y); + Cairo.move_to ctx x' y'; + Cairo.line_to ctx x y; + Cairo.stroke ctx) + q) + graph.points + +(* +-----------------------------------------------------------------+ + | Decoding frames | + +-----------------------------------------------------------------+ *) + +let decode_frame time frame = let data = Krobot_can.data frame in - ({ coder_pos = get_uint16 data 0; - coder_dir = get_uint8 data 4 }, - { coder_pos = get_uint16 data 2; - coder_dir = get_uint8 data 5 }) - -let rec loop bus oc = - let time = Unix.gettimeofday () in - lwt coder1, coder2 = Krobot_can_bus.recv bus >|= decode_frame in - lwt coder3, coder4 = Krobot_can_bus.recv bus >|= decode_frame in - lwt () = - Lwt_io.fprintlf oc - "%f %d %d %d %d %d %d %d %d" - time - coder1.coder_pos coder1.coder_dir - coder2.coder_pos coder2.coder_dir - coder3.coder_pos coder3.coder_dir - coder4.coder_pos coder4.coder_dir - in - lwt () = - Lwt_io.printlf "time: %f - coder1: pos = %d, dir = %d - coder2: pos = %d, dir = %d - coder3: pos = %d, dir = %d - coder4: pos = %d, dir = %d -" - time - coder1.coder_pos coder1.coder_dir - coder2.coder_pos coder2.coder_dir - coder3.coder_pos coder3.coder_dir - coder4.coder_pos coder4.coder_dir - in - loop bus oc + ({ time = time; + position = get_uint16 data 0; + direction = if get_uint8 data 4 = 0 then Forward else Backward }, + { time = time; + position = get_uint16 data 2; + direction = if get_uint8 data 5 = 0 then Forward else Backward }) + +(* +-----------------------------------------------------------------+ + | Main-loop | + +-----------------------------------------------------------------+ *) lwt () = if Array.length Sys.argv <> 2 then begin print_endline "usage: krobot-plot <interface>"; exit 2; end; + ignore (GMain.init ()); + Lwt_glib.install (); + + let window = GWindow.window ~title:"Krobot coders positions" () in + ignore (window#connect#destroy ~callback:(fun () -> exit 0)); + window#show (); + + let graph = { points = Array.init 4 (fun _ -> Queue.create ()); max = 1 } in + try_lwt - lwt bus = Krobot_can_bus.open_can Sys.argv.(1) and oc = Lwt_io.open_file ~mode:Lwt_io.output "data" in - loop bus oc + lwt bus = Krobot_can_bus.open_can Sys.argv.(1) in + join [ + (* Data reading. *) + while_lwt true do + (* Read coder positions. *) + lwt coder1, coder2 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in + lwt coder3, coder4 = Krobot_can_bus.recv bus >|= (fun frame -> decode_frame (Unix.gettimeofday ()) frame) in + (* Compute the new maximum. *) + graph.max <- List.fold_left max graph.max [coder1.position; coder2.position; coder3.position; coder4.position]; + (* Add points to the graph. *) + Queue.push coder1 graph.points.(0); + Queue.push coder2 graph.points.(1); + Queue.push coder3 graph.points.(2); + Queue.push coder4 graph.points.(3); + (* Remove old points. *) + update_graph graph (Unix.gettimeofday ()); + return () + done; + (* Drawing. *) + while_lwt true do + let { Gtk.width; Gtk.height } = window#misc#allocation in + let surface = Cairo.image_surface_create Cairo.FORMAT_ARGB32 width height in + let ctx = Cairo.create surface in + plot ctx (float width) (float height) graph (Unix.gettimeofday ()); + let ctx = Cairo_lablgtk.create window#misc#window in + Cairo.set_source_surface ctx surface 0. 0.; + Cairo.rectangle ctx 0. 0. (float width) (float height); + Cairo.fill ctx; + Cairo.surface_finish surface; + Lwt_unix.sleep 0.05 + done; + ] with Unix.Unix_error(error, func, arg) -> Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) hooks/post-receive -- krobot |
From: Benjamin A. <Ba...@us...> - 2011-03-16 21:13:40
|
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 ee17197988c142797ab6828aebeca793214cb402 (commit) from 97b5a33582c1410fddb53a02dbc33529c8aa01b9 (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 ee17197988c142797ab6828aebeca793214cb402 Author: Benjamin Aupetit <au...@cr...> Date: Wed Mar 16 22:12:54 2011 +0100 adding stl version of clamp ----------------------------------------------------------------------- Changes: diff --git a/meca/2011_Senior/Arbre moteur.CATPart b/meca/2011_Senior/Arbre moteur.CATPart index 2655f02..9913b0d 100644 Binary files a/meca/2011_Senior/Arbre moteur.CATPart and b/meca/2011_Senior/Arbre moteur.CATPart differ diff --git a/meca/2011_Senior/BH0102-40-606.CATPart b/meca/2011_Senior/BH0102-40-606.CATPart index afab2db..220ce74 100644 Binary files a/meca/2011_Senior/BH0102-40-606.CATPart and b/meca/2011_Senior/BH0102-40-606.CATPart differ diff --git a/meca/2011_Senior/Encodeur HEDL 55__.CATPart b/meca/2011_Senior/Encodeur HEDL 55__.CATPart index b38712b..93b4058 100644 Binary files a/meca/2011_Senior/Encodeur HEDL 55__.CATPart and b/meca/2011_Senior/Encodeur HEDL 55__.CATPart differ diff --git a/meca/2011_Senior/Moteur.CATPart b/meca/2011_Senior/Moteur.CATPart index 8a54f13..ed0031b 100644 Binary files a/meca/2011_Senior/Moteur.CATPart and b/meca/2011_Senior/Moteur.CATPart differ diff --git a/meca/2011_Senior/P20 Arbre.CATPart b/meca/2011_Senior/P20 Arbre.CATPart index 7cc3529..30beb0e 100644 Binary files a/meca/2011_Senior/P20 Arbre.CATPart and b/meca/2011_Senior/P20 Arbre.CATPart differ diff --git a/meca/2011_Senior/P20 Boitier.CATPart b/meca/2011_Senior/P20 Boitier.CATPart index 31baa09..6245810 100644 Binary files a/meca/2011_Senior/P20 Boitier.CATPart and b/meca/2011_Senior/P20 Boitier.CATPart differ diff --git a/meca/2011_Senior/P20 Sortie.CATPart b/meca/2011_Senior/P20 Sortie.CATPart index 3f4d57b..2b2cf00 100644 Binary files a/meca/2011_Senior/P20 Sortie.CATPart and b/meca/2011_Senior/P20 Sortie.CATPart differ diff --git a/meca/2011_Senior/Roulement a billes 606ZZ.CATPart b/meca/2011_Senior/Roulement a billes 606ZZ.CATPart index cffecf0..2420e54 100644 Binary files a/meca/2011_Senior/Roulement a billes 606ZZ.CATPart and b/meca/2011_Senior/Roulement a billes 606ZZ.CATPart differ diff --git a/meca/2011_Senior/aupetit/GuideCodeur.CATPart b/meca/2011_Senior/aupetit/GuideCodeur.CATPart index 5b115e5..47a80d4 100644 Binary files a/meca/2011_Senior/aupetit/GuideCodeur.CATPart and b/meca/2011_Senior/aupetit/GuideCodeur.CATPart differ diff --git a/meca/2011_Senior/aupetit/ModuleRoue.CATProduct b/meca/2011_Senior/aupetit/ModuleRoue.CATProduct index 96ddd4c..821f89c 100644 Binary files a/meca/2011_Senior/aupetit/ModuleRoue.CATProduct and b/meca/2011_Senior/aupetit/ModuleRoue.CATProduct differ diff --git a/meca/2011_Senior/aupetit/RoueCodeuse.CATPart b/meca/2011_Senior/aupetit/RoueCodeuse.CATPart index 37fb9e1..f8a607f 100644 Binary files a/meca/2011_Senior/aupetit/RoueCodeuse.CATPart and b/meca/2011_Senior/aupetit/RoueCodeuse.CATPart differ diff --git a/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart b/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart index 05ba3f4..6dac518 100644 Binary files a/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart and b/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart differ diff --git a/meca/2011_Senior/aupetit/SupportRoue.CATPart b/meca/2011_Senior/aupetit/SupportRoue.CATPart index e6c2f77..b77d18a 100644 Binary files a/meca/2011_Senior/aupetit/SupportRoue.CATPart and b/meca/2011_Senior/aupetit/SupportRoue.CATPart differ diff --git a/meca/2011_Senior/aupetit/base.CATPart b/meca/2011_Senior/aupetit/base.CATPart index 6957c4e..b4c417a 100644 Binary files a/meca/2011_Senior/aupetit/base.CATPart and b/meca/2011_Senior/aupetit/base.CATPart differ diff --git a/meca/2011_Senior/aupetit/codeur.CATPart b/meca/2011_Senior/aupetit/codeur.CATPart index 0799856..c779b98 100644 Binary files a/meca/2011_Senior/aupetit/codeur.CATPart and b/meca/2011_Senior/aupetit/codeur.CATPart differ diff --git a/meca/2011_Senior/aupetit/pince/pince.stl b/meca/2011_Senior/aupetit/pince/pince.stl new file mode 100644 index 0000000..5d0a33a Binary files /dev/null and b/meca/2011_Senior/aupetit/pince/pince.stl differ diff --git a/meca/2011_Senior/aupetit/pince2.CATPart b/meca/2011_Senior/aupetit/pince2.CATPart index 6586b6c..f047797 100644 Binary files a/meca/2011_Senior/aupetit/pince2.CATPart and b/meca/2011_Senior/aupetit/pince2.CATPart differ hooks/post-receive -- krobot |
From: Benjamin A. <Ba...@us...> - 2011-03-16 20:18:02
|
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 97b5a33582c1410fddb53a02dbc33529c8aa01b9 (commit) from 6a35fe365f0169d9d31db87a93009462de40f286 (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 97b5a33582c1410fddb53a02dbc33529c8aa01b9 Author: Benjamin Aupetit <au...@cr...> Date: Wed Mar 16 21:13:19 2011 +0100 update & first version of adapted clamp ----------------------------------------------------------------------- Changes: diff --git a/meca/2011_Senior/BH0102-40-606.CATPart b/meca/2011_Senior/BH0102-40-606.CATPart index 209bb17..afab2db 100644 Binary files a/meca/2011_Senior/BH0102-40-606.CATPart and b/meca/2011_Senior/BH0102-40-606.CATPart differ diff --git a/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart b/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart index d14c892..a3a363a 100644 Binary files a/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart and b/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart differ diff --git a/meca/2011_Senior/aupetit/Bille3.CATPart b/meca/2011_Senior/aupetit/Bille3.CATPart index 9875bc7..4cece39 100644 Binary files a/meca/2011_Senior/aupetit/Bille3.CATPart and b/meca/2011_Senior/aupetit/Bille3.CATPart differ diff --git a/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart b/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart index f710225..4ac3877 100644 Binary files a/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart and b/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart differ diff --git a/meca/2011_Senior/aupetit/Etage1.CATPart b/meca/2011_Senior/aupetit/Etage1.CATPart index 3519168..c254bf7 100644 Binary files a/meca/2011_Senior/aupetit/Etage1.CATPart and b/meca/2011_Senior/aupetit/Etage1.CATPart differ diff --git a/meca/2011_Senior/aupetit/GuideCodeur.CATPart b/meca/2011_Senior/aupetit/GuideCodeur.CATPart index 5b86cbc..5b115e5 100644 Binary files a/meca/2011_Senior/aupetit/GuideCodeur.CATPart and b/meca/2011_Senior/aupetit/GuideCodeur.CATPart differ diff --git a/meca/2011_Senior/aupetit/ModuleRoue.CATProduct b/meca/2011_Senior/aupetit/ModuleRoue.CATProduct index bcba8e7..96ddd4c 100644 Binary files a/meca/2011_Senior/aupetit/ModuleRoue.CATProduct and b/meca/2011_Senior/aupetit/ModuleRoue.CATProduct differ diff --git a/meca/2011_Senior/aupetit/OF-12SH.CATPart b/meca/2011_Senior/aupetit/OF-12SH.CATPart new file mode 100644 index 0000000..117838b Binary files /dev/null and b/meca/2011_Senior/aupetit/OF-12SH.CATPart differ diff --git a/meca/2011_Senior/aupetit/Robot.CATProduct b/meca/2011_Senior/aupetit/Robot.CATProduct index 3d5a0ad..3704b00 100644 Binary files a/meca/2011_Senior/aupetit/Robot.CATProduct and b/meca/2011_Senior/aupetit/Robot.CATProduct differ diff --git a/meca/2011_Senior/aupetit/RoueCodeuse.CATPart b/meca/2011_Senior/aupetit/RoueCodeuse.CATPart index 9cb2228..37fb9e1 100644 Binary files a/meca/2011_Senior/aupetit/RoueCodeuse.CATPart and b/meca/2011_Senior/aupetit/RoueCodeuse.CATPart differ diff --git a/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart b/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart index baa977e..05ba3f4 100644 Binary files a/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart and b/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart differ diff --git a/meca/2011_Senior/aupetit/SupportRoue.CATPart b/meca/2011_Senior/aupetit/SupportRoue.CATPart index 6058e1e..e6c2f77 100644 Binary files a/meca/2011_Senior/aupetit/SupportRoue.CATPart and b/meca/2011_Senior/aupetit/SupportRoue.CATPart differ diff --git a/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart b/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart index 79715fe..5fadc90 100644 Binary files a/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart and b/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart differ diff --git a/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart b/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart index e26cc1b..2b99057 100644 Binary files a/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart and b/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc-plaque.CATPart b/meca/2011_Senior/aupetit/asc-plaque.CATPart index f6a77e6..16a5cdc 100644 Binary files a/meca/2011_Senior/aupetit/asc-plaque.CATPart and b/meca/2011_Senior/aupetit/asc-plaque.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/AX-12.CATPart b/meca/2011_Senior/aupetit/asc/AX-12.CATPart index 890efd6..ae98ebd 100644 Binary files a/meca/2011_Senior/aupetit/asc/AX-12.CATPart and b/meca/2011_Senior/aupetit/asc/AX-12.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart b/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart index 131b385..bea8e12 100644 Binary files a/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart and b/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/OF-12S.CATPart b/meca/2011_Senior/aupetit/asc/OF-12S.CATPart index 7029f65..e67b7fd 100644 Binary files a/meca/2011_Senior/aupetit/asc/OF-12S.CATPart and b/meca/2011_Senior/aupetit/asc/OF-12S.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/pince.CATPart b/meca/2011_Senior/aupetit/asc/pince.CATPart index b3da7aa..5592b76 100644 Binary files a/meca/2011_Senior/aupetit/asc/pince.CATPart and b/meca/2011_Senior/aupetit/asc/pince.CATPart differ diff --git a/meca/2011_Senior/aupetit/base.CATPart b/meca/2011_Senior/aupetit/base.CATPart index 53ebea3..6957c4e 100644 Binary files a/meca/2011_Senior/aupetit/base.CATPart and b/meca/2011_Senior/aupetit/base.CATPart differ diff --git a/meca/2011_Senior/aupetit/codeur.CATPart b/meca/2011_Senior/aupetit/codeur.CATPart index e0e935e..0799856 100644 Binary files a/meca/2011_Senior/aupetit/codeur.CATPart and b/meca/2011_Senior/aupetit/codeur.CATPart differ diff --git a/meca/2011_Senior/aupetit/pince2.CATPart b/meca/2011_Senior/aupetit/pince2.CATPart new file mode 100644 index 0000000..6586b6c Binary files /dev/null and b/meca/2011_Senior/aupetit/pince2.CATPart differ diff --git a/meca/2011_Table/Elements/Pion-base.CATPart b/meca/2011_Table/Elements/Pion-base.CATPart index 777fede..3105d04 100644 Binary files a/meca/2011_Table/Elements/Pion-base.CATPart and b/meca/2011_Table/Elements/Pion-base.CATPart differ diff --git a/meca/2011_Table/Pion.CATProduct b/meca/2011_Table/Pion.CATProduct index 0e4e4e6..5de2f76 100644 Binary files a/meca/2011_Table/Pion.CATProduct and b/meca/2011_Table/Pion.CATProduct differ hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2011-03-16 15:34:04
|
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 6a35fe365f0169d9d31db87a93009462de40f286 (commit) from d67edc588cdf218373b4dfeab3453c77e2242a36 (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 6a35fe365f0169d9d31db87a93009462de40f286 Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 16 16:32:46 2011 +0100 [Controller_Motor_STM32] New motor controller This controller has the following features : * Can control any motor with respect to any encoder * One process by controller * Can start and stop controllers during runtime * State space control * Full state estimation ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk index beb4002..408ef8f 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk @@ -13,6 +13,7 @@ controller_motor_stm32_USER_CSRC = \ $(controller_motor_stm32_SRC_PATH)/stm32lib/stm32f10x_tim.c \ $(controller_motor_stm32_SRC_PATH)/motor.c \ $(controller_motor_stm32_SRC_PATH)/encoder.c \ + $(controller_motor_stm32_SRC_PATH)/motor_controller.c \ $(controller_motor_stm32_SRC_PATH)/can_monitor.c \ $(controller_motor_stm32_SRC_PATH)/main.c \ # diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c index 4ea7657..89df632 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c @@ -13,7 +13,7 @@ #include "hw/hw_led.h" #include "motor.h" -#include "encoder.h" +#include "motor_controller.h" #include "can_monitor.h" static void init(void) @@ -31,11 +31,8 @@ static void init(void) */ proc_init(); - // Initialize MOTOR driver - motorsInit(); - - // Initialize ENCODER driver - encodersInit(); + // Initialize CONTROL driver (will initialize MOTOR and ENCODER subsystems) + speedControlInit(); // Initialize CAN_MONITOR canMonitorInit(); diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c new file mode 100644 index 0000000..cd19110 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.c @@ -0,0 +1,237 @@ +/* + * Motor controller + * Xavier Lagorce + */ + +#include "motor_controller.h" +#include <kern/proc.h> +#include <drv/timer.h> +#include <math.h> + +#ifndef MAX + #define MAX(x,y) ((x) > (y) ? (x) : (y)) +#endif +#ifndef MIN + #define MIN(x,y) ((x) > (y) ? (y) : (x)) +#endif + +typedef struct +{ + uint8_t enable; // Is this controller enabled ? + uint8_t motor; // Motor ID to control + uint8_t encoder; // Encoder ID to measure motor position from + float encoder_gain; // Gain to convert encoder value unit to reference unit + float reference; // Goal position + float tau; // DC motor time constant + float k[2]; // State control gain + float l; // Reference factoring gain + float l0[2]; // State observer gain + float last_command; // Last applyed command + float last_estimate[2]; // Last state estimate + float last_output; // Last measured output + uint16_t last_encoder_pos; // Last encoder position measured + float F[4]; // evolution matrix + float G[2]; // command application matrix + ticks_t T; // sampling period in systicks +} control_params_t; + +control_params_t controllers[4]; + +static inline uint8_t get_motor_index(uint8_t motor_id) { + uint8_t motor_ind; + + for (motor_ind = 0; (motor_id >> (motor_ind+1)) != 0; motor_ind++) ; + + return motor_ind; +} + +// Callback for control +static void NORETURN motorController_process(void); + +float mc_getSpeed(uint8_t motor) { + + switch(motor) { + case MOTOR1: + return controllers[0].last_estimate[1]; + break; + case MOTOR2: + return controllers[1].last_estimate[1]; + break; + case MOTOR3: + return controllers[2].last_estimate[1]; + break; + case MOTOR4: + return controllers[3].last_estimate[1]; + break; + default: + return 0; + } +} + +float mc_getPosition(uint8_t motor) { + + switch(motor) { + case MOTOR1: + return controllers[0].last_output; + break; + case MOTOR2: + return controllers[1].last_output; + break; + case MOTOR3: + return controllers[2].last_output; + break; + case MOTOR4: + return controllers[3].last_output; + break; + default: + return 0; + } +} + +void mc_gotoPosition(uint8_t motor, float position) { + + switch(motor) { + case MOTOR1: + controllers[0].reference = position; + break; + case MOTOR2: + controllers[1].reference = position; + break; + case MOTOR3: + controllers[2].reference = position; + break; + case MOTOR4: + controllers[3].reference = position; + break; + } +} + +// Controller process +// this process will control one DC motor in state space with state estimation +static void NORETURN motorController_process(void) { + control_params_t *params; + float estimate[2], encoder_pos, delta; + Timer timer; + + // get data + params = (control_params_t *) proc_currentUserData(); + + // configure timer + timer_setDelay(&timer, ms_to_ticks(params->T)); + timer_setEvent(&timer); + + while (1) { + if (params->enable == 0) { + proc_exit(); + } else { + timer_add(&timer); + + // Measure motor rotation + encoder_pos = (float)getEncoderPosition(params->encoder); + delta = encoder_pos - params->last_encoder_pos; + if (getEncoderDirection(params->encoder) == ENCODER_DIR_UP) { + if (delta < 0) + delta = delta + 65535; + } else { + if (delta > 0) + delta = delta - 65535; + } + + // New state vector estimation + estimate[0] = (params->F[0]-params->l0[0])*params->last_estimate[0] + params->F[1]*params->last_estimate[1] + + params->G[0]*params->last_command + params->l0[0]*params->last_output; + estimate[1] = (params->F[2]-params->l0[1])*params->last_estimate[0] + params->F[3]*params->last_estimate[1] + + params->G[1]*params->last_command + params->l0[1]*params->last_output; + + // Compute motor rotation + params->last_output += params->encoder_gain*delta; + + // Command computation + params->last_command = params->l*params->reference + params->k[0]*estimate[0] + params->k[1]*estimate[1]; + + // Keep estimate and data + params->last_estimate[0] = estimate[0]; + params->last_estimate[1] = estimate[1]; + params->last_encoder_pos = encoder_pos; + + // Apply command + motorSetSpeed(params->motor, (int32_t)params->last_command); + } + timer_waitEvent(&timer); // Wait for the remaining of the sample period + } +} + +void speedControlInit() { + uint8_t motor_ind; + + for (motor_ind = 0; motor_ind < 4; motor_ind++) + controllers[motor_ind].enable = 0; + + encodersInit(); + motorsInit(); +} + +uint8_t mc_new_controller(uint8_t motor, uint8_t encoder, float encoder_gain, float G0, float tau, float T, float *k, float l, float *l0) { + uint8_t motor_ind; + control_params_t *params; + + // Find the motor index + motor_ind = get_motor_index(motor); + params = &(controllers[motor_ind]); + + if (params->enable == 0) { + // define user parameters + params->motor = motor; + params->encoder = encoder; + params->encoder_gain = encoder_gain; + params->tau = tau; + params->T = ms_to_ticks((mtime_t)(T*1000)); + params->k[0] = k[0]; params->k[1] = k[1]; + params->l = l; + params->l0[0] = l0[0]; params->l0[1] = l0[1]; + + // compute other parameters + params->last_command = 0; + params->last_estimate[0] = 0; params->last_estimate[1] = 0; + params->last_output = params->last_estimate[0]; + params->last_encoder_pos = getEncoderPosition(encoder); + + params->F[0] = 1; + params->F[1] = tau*(1-exp(-T/tau)); + params->F[2] = 0; + params->F[3] = exp(-T/tau); + params->G[0] = G0*(T+tau*exp(-T/tau)-tau); + params->G[1] = G0*(1-exp(-T/tau)); + + // enable the controller + params->enable = 1; + enableMotor(motor); + motorSetSpeed(motor, 0); + + // start the controller + proc_new(motorController_process, params, KERN_MINSTACKSIZE * 8, NULL); + + return CONTROLLER_OK; + } else { + // Motor already controlled, return an error + return CONTROLLER_ALREADY_USED; + } + + // Should never be here + return CONTROLLER_ALREADY_USED; +} + +void mc_delete_controller(uint8_t motor) { + uint8_t motor_ind; + control_params_t *params; + + // Find the motor index + motor_ind = get_motor_index(motor); + params = &(controllers[motor_ind]); + + // Disable the controller and the power output + if (params->enable != 0) { + params->enable = 0; + disableMotor(motor); + } +} diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.h b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.h new file mode 100644 index 0000000..9a1334b --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor_controller.h @@ -0,0 +1,23 @@ +/* + * Motor controller + * Xavier Lagorce + */ + +#ifndef HEADER__MOTORCONTROLLER +#define HEADER__MOTORCONTROLLER + +#include "motor.h" +#include "encoder.h" + +#define CONTROLLER_OK 0 +#define CONTROLLER_ALREADY_USED 1 + +void speedControlInit(void); +float mc_getSpeed(uint8_t motor); +float mc_getPosition(uint8_t motor); +void mc_gotoPosition(uint8_t motor, float position); + + +uint8_t mc_new_controller(uint8_t motor, uint8_t encoder, float encoder_gain, float G0, float tau, float T, float *k, float l, float *l0); +void mc_delete_controller(uint8_t motor); +#endif hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2011-03-16 15:13:20
|
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 d67edc588cdf218373b4dfeab3453c77e2242a36 (commit) via 85de23d27522edc5162dfbd3c75713163963cfec (commit) via 2cd2334d1be8b5d90e38c45c6f6250f9e41e9050 (commit) via eb637d931a5f01f8ca74d54fd44a5a116f4505b2 (commit) via 8f295e48a1048325ac191b996632bf73301a0363 (commit) from 22cfcc212fc0274b07ea35f20f3fe87943b245d9 (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 d67edc588cdf218373b4dfeab3453c77e2242a36 Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 16 16:01:52 2011 +0100 [Controller_Motor_STM32] Little changes in test firmware main function * Blink LEDs at the end of initialization sequence to show we are alive * More friendly speed test sequence for repeated testing commit 85de23d27522edc5162dfbd3c75713163963cfec Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 16 16:00:11 2011 +0100 [Controller_Motor_STM32] Refactored can_monitor to use Events instead of callbacks commit 2cd2334d1be8b5d90e38c45c6f6250f9e41e9050 Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 16 15:40:11 2011 +0100 [Controller_Motor_STM32] Add Signal support to used kernel features commit eb637d931a5f01f8ca74d54fd44a5a116f4505b2 Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 16 15:39:35 2011 +0100 [Controller_Motor_STM32] Added LEDs indicator on motor command saturation commit 8f295e48a1048325ac191b996632bf73301a0363 Author: Xavier Lagorce <Xav...@cr...> Date: Sat Mar 12 16:31:12 2011 +0100 [Controller_Motor_STM32] Added a simple CAN monitor for motor identification ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c index b92fb9f..f47e99a 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c @@ -137,14 +137,13 @@ void can_hw_init(void) can_drv_init(CAND1); CAND1->can = CAN1; - // Set the pins to the right mode for CAN. - stm32_gpioRemap(GPIO_REMAP1_CAN1, GPIO_REMAP_ENABLE); - stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(8), GPIO_MODE_IPU, GPIO_SPEED_50MHZ); - stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(9), GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); - // Enable the clocks RCC->APB2ENR |= RCC_APB2_AFIO; - RCC->APB2ENR |= RCC_APB2_GPIOB; + RCC->APB2ENR |= RCC_APB2_GPIOA; + + // Set the pins to the right mode for CAN. + stm32_gpioPinConfig((struct stm32_gpio *)GPIOA_BASE, BV(11), GPIO_MODE_IN_FLOATING, GPIO_SPEED_50MHZ); + stm32_gpioPinConfig((struct stm32_gpio *)GPIOA_BASE, BV(12), GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); } void can_hw_start(can_driver *drv) { diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c new file mode 100644 index 0000000..ccbd670 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/can_monitor.c @@ -0,0 +1,98 @@ +/* + * can_monitor.c + * ------------- + * Copyright : (c) 2011, Xavier Lagorce <Xav...@cr...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + */ + +#include "can_monitor.h" +#include "hw/hw_led.h" + +typedef struct { + uint16_t encoder1_pos __attribute__((__packed__)); + uint16_t encoder2_pos __attribute__((__packed__)); + uint8_t encoder1_dir; + uint8_t encoder2_dir; + uint16_t padding __attribute__((__packed__)); +} encoder_msg_t; + +typedef union { + encoder_msg_t data_f; + uint32_t data32[2]; +} encoder_can_msg_t; + +// Process for communication +static void NORETURN canMonitor_process(void); + +void canMonitorInit(void) { + can_config cfg; + + // Configure CAN driver + cfg.mcr = CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP; + cfg.btr = CAN_BTR_SJW(0) | CAN_BTR_TS1(8) | CAN_BTR_TS2(1) | CAN_BTR_BRP(6);// | CAN_BTR_LBKM; // Add LBKM for loopback mode + cfg.n_filters = 0; + cfg.filters = NULL; + + // Initialize CAN driver + can_init(); + can_start(CAND1, &cfg); + + // Start communication process + proc_new(canMonitor_process, NULL, KERN_MINSTACKSIZE * 8, NULL); +} + +static void NORETURN canMonitor_process(void) { + encoder_can_msg_t msg; + can_tx_frame txm; + Timer timer_can; + uint8_t ind = 0; + + // Initialize constant parameters of TX frame + txm.dlc = 6; + txm.rtr = 0; + txm.ide = 1; + txm.sid = 0; + + timer_setDelay(&timer_can, ms_to_ticks(1000)); + timer_setEvent(&timer_can); + while(1) { + + timer_add(&timer_can); + + // Sending ENCODER1 and ENCODER2 data + msg.data_f.encoder1_pos = getEncoderPosition(ENCODER1); + msg.data_f.encoder2_pos = getEncoderPosition(ENCODER2); + msg.data_f.encoder1_dir = getEncoderDirection(ENCODER1); + msg.data_f.encoder2_dir = getEncoderDirection(ENCODER2); + + txm.data32[0] = msg.data32[0]; + txm.data32[1] = msg.data32[1]; + txm.eid = 100; + can_transmit(CAND1, &txm, ms_to_ticks(10)); + + // Sending ENCODER3 and ENCODER4 data + msg.data_f.encoder1_pos = getEncoderPosition(ENCODER3); + msg.data_f.encoder2_pos = getEncoderPosition(ENCODER4); + msg.data_f.encoder1_dir = getEncoderDirection(ENCODER3); + msg.data_f.encoder2_dir = getEncoderDirection(ENCODER4); + + txm.data32[0] = msg.data32[0]; + txm.data32[1] = msg.data32[1]; + txm.eid = 101; + can_transmit(CAND1, &txm, ms_to_ticks(10)); + + // Wait for the next transmission timer + timer_waitEvent(&timer_can); + // blink ! + if (ind == 0) { + LED2_OFF(); + ind = 1 |
From: Nicolas D. <Ba...@us...> - 2011-03-13 22:40:36
|
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 22cfcc212fc0274b07ea35f20f3fe87943b245d9 (commit) via a2dcffb971908f823cf8668a44a322944748fb17 (commit) via d8b211dfabcfa9669af863d0aac1eb22b6e64d3f (commit) via daf1cd94f91f3c1db2be57e02179ece1898419c5 (commit) via c2ae9864dbd788fbba61d4fcc843473fb8f9e4a1 (commit) via f7d4e1a34fe5f8d370995d9d00af86b1ed91b652 (commit) from 4e54c2a25cca9ff42042dce62420deea8545d6b7 (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 22cfcc212fc0274b07ea35f20f3fe87943b245d9 Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Mar 13 23:39:42 2011 +0100 [USB_CAN/Firmware] Silence warnings commit a2dcffb971908f823cf8668a44a322944748fb17 Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Mar 13 20:53:24 2011 +0100 [USB_CAN/Firmware] Remove unneeded file commit d8b211dfabcfa9669af863d0aac1eb22b6e64d3f Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Mar 13 20:52:37 2011 +0100 [USB_CAN/Firmware] Implement part of the slcan protocol commit daf1cd94f91f3c1db2be57e02179ece1898419c5 Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Mar 13 20:46:47 2011 +0100 [USB_CAN/Firmware] Fix bertos serial module #define screwup commit c2ae9864dbd788fbba61d4fcc843473fb8f9e4a1 Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Mar 13 20:51:12 2011 +0100 [USB_CAN/Firmware] Enable the bertos serial driver commit f7d4e1a34fe5f8d370995d9d00af86b1ed91b652 Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Mar 13 20:47:46 2011 +0100 [USB_CAN/Firmware] Set the CAN device to the right pins ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/USB_CAN/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c b/elec/boards/USB_CAN/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c index b92fb9f..8f7f194 100644 --- a/elec/boards/USB_CAN/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c +++ b/elec/boards/USB_CAN/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c @@ -137,14 +137,13 @@ void can_hw_init(void) can_drv_init(CAND1); CAND1->can = CAN1; - // Set the pins to the right mode for CAN. - stm32_gpioRemap(GPIO_REMAP1_CAN1, GPIO_REMAP_ENABLE); - stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(8), GPIO_MODE_IPU, GPIO_SPEED_50MHZ); - stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(9), GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); - // Enable the clocks RCC->APB2ENR |= RCC_APB2_AFIO; - RCC->APB2ENR |= RCC_APB2_GPIOB; + RCC->APB2ENR |= RCC_APB2_GPIOA; + + // Set the pins to the right mode for CAN. + stm32_gpioPinConfig((struct stm32_gpio *)GPIOA_BASE, BV(11), GPIO_MODE_IN_FLOATING, GPIO_SPEED_10MHZ); + stm32_gpioPinConfig((struct stm32_gpio *)GPIOA_BASE, BV(12), GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); } void can_hw_start(can_driver *drv) { diff --git a/elec/boards/USB_CAN/Firmware/bertos/drv/can.c b/elec/boards/USB_CAN/Firmware/bertos/drv/can.c index 036769d..a131c30 100644 --- a/elec/boards/USB_CAN/Firmware/bertos/drv/can.c +++ b/elec/boards/USB_CAN/Firmware/bertos/drv/can.c @@ -108,9 +108,9 @@ void can_stop(can_driver *drv) { /** * Transmit a CAN frame */ -bool can_transmit(can_driver *drv, can_tx_frame *frame, ticks_t timeout) { +bool can_transmit(can_driver *drv, can_tx_frame *frame, UNUSED_ARG(ticks_t, timeout)) { - bool ret; + bool ret = true; proc_forbid(); while ((drv->state == CAN_SLEEP) || !can_hw_can_transmit(drv)) { @@ -121,15 +121,15 @@ bool can_transmit(can_driver *drv, can_tx_frame *frame, ticks_t timeout) { can_hw_transmit(drv, frame); proc_permit(); - return true; + return ret; } /** * Receive a CAN frame */ -bool can_receive(can_driver *drv, can_rx_frame *frame, ticks_t timeout) { +bool can_receive(can_driver *drv, can_rx_frame *frame, UNUSED_ARG(ticks_t, timeout)) { - bool ret; + bool ret = true; proc_forbid(); while ((drv->state == CAN_SLEEP) || !can_hw_can_receive(drv)) { @@ -140,7 +140,7 @@ bool can_receive(can_driver *drv, can_rx_frame *frame, ticks_t timeout) { can_hw_receive(drv, frame); proc_permit(); - return true; + return ret; } /** diff --git a/elec/boards/USB_CAN/Firmware/bertos/io/kfile.h b/elec/boards/USB_CAN/Firmware/bertos/io/kfile.h index 9a750fe..7af3372 100644 --- a/elec/boards/USB_CAN/Firmware/bertos/io/kfile.h +++ b/elec/boards/USB_CAN/Firmware/bertos/io/kfile.h @@ -336,7 +336,7 @@ INLINE int kfile_error(struct KFile *fd) INLINE void kfile_clearerr(struct KFile *fd) { ASSERT(fd->clearerr); - fd->clearerr(fd); + (fd->clearerr)(fd); } int kfile_putc(int c, struct KFile *fd); ///< Generic putc implementation using kfile_write. diff --git a/elec/boards/USB_CAN/Firmware/project.bertos b/elec/boards/USB_CAN/Firmware/project.bertos index d696c58..181c098 100644 --- a/elec/boards/USB_CAN/Firmware/project.bertos +++ b/elec/boards/USB_CAN/Firmware/project.bertos @@ -33,40 +33,44 @@ aS'debug' p16 aS'kernel' p17 -aS'monitor' +aS'ser' p18 aS'kfile' p19 -aS'timer' +aS'sprintf' p20 -aS'formatwr' +aS'monitor' p21 -aS'semaphores' +aS'timer' p22 -aS'heap' +aS'formatwr' p23 -aS'can' +aS'semaphores' p24 -asS'CPU_NAME' +aS'heap' p25 -VSTM32F103RE +aS'can' p26 -sS'PROJECT_HW_PATH' +asS'CPU_NAME' p27 -Vusb_can +VSTM32F103RE p28 -sS'PROJECT_SRC_PATH' +sS'PROJECT_HW_PATH' p29 Vusb_can p30 -sS'PRESET' +sS'PROJECT_SRC_PATH' p31 -NsS'PROJECT_SRC_PATH_FROM_MAKEFILE' +Vusb_can p32 +sS'PRESET' +p33 +NsS'PROJECT_SRC_PATH_FROM_MAKEFILE' +p34 g7 sS'OUTPUT' -p33 -(lp34 -S'codelite' p35 +(lp36 +S'codelite' +p37 as. \ No newline at end of file diff --git a/elec/boards/USB_CAN/Firmware/usb_can.project b/elec/boards/USB_CAN/Firmware/usb_can.project deleted file mode 100644 index ece6b8d..0000000 --- a/elec/boards/USB_CAN/Firmware/usb_can.project +++ /dev/null @@ -1,1241 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<CodeLite_Project Name="usb_can" InternalType=""> -<File Name="Makefile"/> -<VirtualDirectory Name="usb_can"> -<File Name="usb_can/usb_can_user.mk"/> -<File Name="usb_can/main.c"/> -<File Name="usb_can/usb_can.mk"/> -<VirtualDirectory Name="cfg"> -<File Name="usb_can/cfg/cfg_thermo.h"/> -<File Name="usb_can/cfg/cfg_wdt.h"/> -<File Name="usb_can/cfg/cfg_adc.h"/> -<File Name="usb_can/cfg/cfg_tas5706a.h"/> -<File Name="usb_can/cfg/cfg_phase.h"/> -<File Name="usb_can/cfg/cfg_pwm.h"/> -<File Name="usb_can/cfg/cfg_lm75.h"/> -<File Name="usb_can/cfg/cfg_tftp.h"/> -<File Name="usb_can/cfg/cfg_parser.h"/> -<File Name="usb_can/cfg/cfg_ramp.h"/> -<File Name="usb_can/cfg/cfg_ser.h"/> -<File Name="usb_can/cfg/cfg_usbkbd.h"/> -<File Name="usb_can/cfg/cfg_hashtable.h"/> -<File Name="usb_can/cfg/cfg_lwip.h"/> -<File Name="usb_can/cfg/cfg_debug.h"/> -<File Name="usb_can/cfg/cfg_sd.h"/> -<File Name="usb_can/cfg/cfg_ini_reader.h"/> -<File Name="usb_can/cfg/cfg_fat.h"/> -<File Name="usb_can/cfg/cfg_dc_motor.h"/> -<File Name="usb_can/cfg/cfg_usbser.h"/> -<File Name="usb_can/cfg/cfg_xmodem.h"/> -<File Name="usb_can/cfg/cfg_ax25.h"/> -<File Name="usb_can/cfg/cfg_usb.h"/> -<File Name="usb_can/cfg/cfg_lcd_32122a.h"/> -<File Name="usb_can/cfg/cfg_battfs.h"/> -<File Name="usb_can/cfg/cfg_heap.h"/> -<File Name="usb_can/cfg/cfg_spi_bitbang.h"/> -<File Name="usb_can/cfg/cfg_flash25.h"/> -<File Name="usb_can/cfg/cfg_i2c.h"/> -<File Name="usb_can/cfg/cfg_context_switch.h"/> -<File Name="usb_can/cfg/cfg_signal.h"/> -<File Name="usb_can/cfg/cfg_sem.h"/> -<File Name="usb_can/cfg/cfg_dataflash.h"/> -<File Name="usb_can/cfg/cfg_gfx.h"/> -<File Name="usb_can/cfg/cfg_kfile.h"/> -<File Name="usb_can/cfg/cfg_timer.h"/> -<File Name="usb_can/cfg/cfg_eeprom.h"/> -<File Name="usb_can/cfg/cfg_usbmouse.h"/> -<File Name="usb_can/cfg/cfg_formatwr.h"/> -<File Name="usb_can/cfg/cfg_i2s.h"/> -<File Name="usb_can/cfg/cfg_kbd.h"/> -<File Name="usb_can/cfg/cfg_stepper.h"/> -<File Name="usb_can/cfg/cfg_monitor.h"/> -<File Name="usb_can/cfg/cfg_nmea.h"/> -<File Name="usb_can/cfg/cfg_random.h"/> -<File Name="usb_can/cfg/cfg_eth.h"/> -<File Name="usb_can/cfg/cfg_md2.h"/> -<File Name="usb_can/cfg/cfg_can.h"/> -<File Name="usb_can/cfg/cfg_randpool.h"/> -<File Name="usb_can/cfg/cfg_pocketbus.h"/> -<File Name="usb_can/cfg/cfg_keytag.h"/> -<File Name="usb_can/cfg/cfg_emb_flash.h"/> -<File Name="usb_can/cfg/cfg_lcd_hd44.h"/> -<File Name="usb_can/cfg/cfg_afsk.h"/> -<File Name="usb_can/cfg/cfg_proc.h"/> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -<File Name="usb_can/hw/hw_tmp123.h"/> -<File Name="usb_can/hw/phase_map.h"/> -<File Name="usb_can/hw/hw_ntc.h"/> -<File Name="usb_can/hw/hw_led.h"/> -<File Name="usb_can/hw/hw_afsk.h"/> -<File Name="usb_can/hw/hw_mcp41.h"/> -<File Name="usb_can/hw/hw_ft245rl.h"/> -<File Name="usb_can/hw/hw_rit128x96.h"/> -<File Name="usb_can/hw/hw_hx8347.h"/> -<File Name="usb_can/hw/hw_buzzer.h"/> -<File Name="usb_can/hw/hw_sd.h"/> -<File Name="usb_can/hw/ntc_map.h"/> -<File Name="usb_can/hw/hw_lcd_32122a.h"/> -<File Name="usb_can/hw/hw_spi.h"/> -<File Name="usb_can/hw/hw_dataflash.c"/> -<File Name="usb_can/hw/hw_lcd_hd44.h"/> -<File Name="usb_can/hw/hw_phase.c"/> -<File Name="usb_can/hw/kbd_map.h"/> -<File Name="usb_can/hw/hw_lm75.h"/> -<File Name="usb_can/hw/hw_mcp41.c"/> -<File Name="usb_can/hw/hw_tas5706a.h"/> -<File Name="usb_can/hw/pwm_map.h"/> -<File Name="usb_can/hw/hw_kbd.h"/> -<File Name="usb_can/hw/hw_tlv5618.h"/> -<File Name="usb_can/hw/hw_stepper.h"/> -<File Name="usb_can/hw/hw_ili9225.h"/> -<File Name="usb_can/hw/hw_i2c_bitbang.h"/> -<File Name="usb_can/hw/hw_ntc.c"/> -<File Name="usb_can/hw/hw_dc_motor.h"/> -<File Name="usb_can/hw/hw_phase.h"/> -<File Name="usb_can/hw/hw_dataflash.h"/> -<File Name="usb_can/hw/hw_thermo.h"/> -<File Name="usb_can/hw/hw_ser.h"/> -<File Name="usb_can/hw/mcp41_map.h"/> -<File Name="usb_can/hw/hw_sipo.h"/> -<File Name="usb_can/hw/thermo_map.h"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="jtag"> -<File Name="jtag/flash.mk"/> -</VirtualDirectory> -<VirtualDirectory Name="bertos"> -<File Name="bertos/rules.mk"/> -<File Name="bertos/config.mk"/> -<File Name="bertos/verstag.h"/> -<File Name="bertos/verstag.c"/> -<VirtualDirectory Name="kern"> -<File Name="bertos/kern/monitor.c"/> -<File Name="bertos/kern/coop.c"/> -<File Name="bertos/kern/sem.c"/> -<File Name="bertos/kern/signal.h"/> -<File Name="bertos/kern/signal_test.c"/> -<File Name="bertos/kern/sem.h"/> -<File Name="bertos/kern/signal.c"/> -<File Name="bertos/kern/kfile.h"/> -<File Name="bertos/kern/proc.c"/> -<File Name="bertos/kern/monitor.h"/> -<File Name="bertos/kern/irq.c"/> -<File Name="bertos/kern/proc.h"/> -<File Name="bertos/kern/irq.h"/> -<File Name="bertos/kern/msg_test.c"/> -<File Name="bertos/kern/proc_p.h"/> -<File Name="bertos/kern/preempt.c"/> -<File Name="bertos/kern/sem_test.c"/> -<File Name="bertos/kern/msg.h"/> -<File Name="bertos/kern/proc_test.c"/> -<VirtualDirectory Name="proc_test"> -<File Name="bertos/kern/proc_test/preempt_msg_test.c"/> -<File Name="bertos/kern/proc_test/coop_pri_heap_test.c"/> -<File Name="bertos/kern/proc_test/coop_heap_test.c"/> -<File Name="bertos/kern/proc_test/preempt_pri_test.c"/> -<File Name="bertos/kern/proc_test/preempt_test.c"/> -<File Name="bertos/kern/proc_test/coop_pri_test.c"/> -<File Name="bertos/kern/proc_test/preempt_sem_test.c"/> -<File Name="bertos/kern/proc_test/coop_test.c"/> -<File Name="bertos/kern/proc_test/coop_sem_test.c"/> -<File Name="bertos/kern/proc_test/coop_signal_test.c"/> -<File Name="bertos/kern/proc_test/preempt_heap_test.c"/> -<File Name="bertos/kern/proc_test/preempt_signal_test.c"/> -<File Name="bertos/kern/proc_test/coop_msg_test.c"/> -<File Name="bertos/kern/proc_test/preempt_pri_heap_test.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="icons"> -<File Name="bertos/icons/flipimage.cpp"/> -<File Name="bertos/icons/Makefile"/> -<File Name="bertos/icons/logo.c"/> -<File Name="bertos/icons/logo.h"/> -</VirtualDirectory> -<VirtualDirectory Name="mware"> -<File Name="bertos/mware/event.c"/> -<File Name="bertos/mware/formatwr.h"/> -<File Name="bertos/mware/ini_reader.c"/> -<File Name="bertos/mware/observer.h"/> -<File Name="bertos/mware/ini_reader_test.c"/> -<File Name="bertos/mware/observer.c"/> -<File Name="bertos/mware/sprintf_test.c"/> -<File Name="bertos/mware/readline.c"/> -<File Name="bertos/mware/rle.h"/> -<File Name="bertos/mware/sprintf.c"/> -<File Name="bertos/mware/blanker.c"/> -<File Name="bertos/mware/messages.c"/> -<File Name="bertos/mware/hex.h"/> -<File Name="bertos/mware/except.h"/> -<File Name="bertos/mware/hex.c"/> -<File Name="bertos/mware/formatwr.c"/> -<File Name="bertos/mware/resource.h"/> -<File Name="bertos/mware/strtol10.h"/> -<File Name="bertos/mware/pgm.h"/> -<File Name="bertos/mware/parser.c"/> -<File Name="bertos/mware/blanker.h"/> -<File Name="bertos/mware/byteorder.h"/> -<File Name="bertos/mware/resource.c"/> -<File Name="bertos/mware/parser.h"/> -<File Name="bertos/mware/messages.h"/> -<File Name="bertos/mware/readline.h"/> -<File Name="bertos/mware/strtol10.c"/> -<File Name="bertos/mware/cmd_hunk.h"/> -<File Name="bertos/mware/event.h"/> -<File Name="bertos/mware/ini_reader.h"/> -</VirtualDirectory> -<VirtualDirectory Name="gfx"> -<File Name="bertos/gfx/font.h"/> -<File Name="bertos/gfx/text.c"/> -<File Name="bertos/gfx/font_10x20.c"/> -<File Name="bertos/gfx/gfx_p.h"/> -<File Name="bertos/gfx/win.c"/> -<File Name="bertos/gfx/text.h"/> -<File Name="bertos/gfx/bitmap.c"/> -<File Name="bertos/gfx/charts.c"/> -<File Name="bertos/gfx/fillpoly.cpp"/> -<File Name="bertos/gfx/charts.h"/> -<File Name="bertos/gfx/line.c"/> -<File Name="bertos/gfx/text_format.c"/> -<File Name="bertos/gfx/win.h"/> -<File Name="bertos/gfx/gfx.h"/> -</VirtualDirectory> -<VirtualDirectory Name="io"> -<File Name="bertos/io/kfile_test.c"/> -<File Name="bertos/io/kblock.h"/> -<File Name="bertos/io/kblock_posix.h"/> -<File Name="bertos/io/kfile_block.h"/> -<File Name="bertos/io/kblock_ram.h"/> -<File Name="bertos/io/kfile.h"/> -<File Name="bertos/io/kfile_block.c"/> -<File Name="bertos/io/kblock_posix.c"/> -<File Name="bertos/io/kfile.c"/> -<File Name="bertos/io/kblock.c"/> -<File Name="bertos/io/kblock_ram.c"/> -</VirtualDirectory> -<VirtualDirectory Name="algo"> -<File Name="bertos/algo/crc_ccitt.h"/> -<File Name="bertos/algo/ramp.c"/> -<File Name="bertos/algo/randpool.h"/> -<File Name="bertos/algo/rle.c"/> -<File Name="bertos/algo/mean.h"/> -<File Name="bertos/algo/ramp_test.c"/> -<File Name="bertos/algo/md2.h"/> -<File Name="bertos/algo/tea.h"/> -<File Name="bertos/algo/reverse_test.c"/> -<File Name="bertos/algo/rle.h"/> -<File Name="bertos/algo/rand.h"/> -<File Name="bertos/algo/crc.h"/> -<File Name="bertos/algo/tea.c"/> -<File Name="bertos/algo/md2.c"/> -<File Name="bertos/algo/rand.c"/> -<File Name="bertos/algo/crc_ccitt.c"/> -<File Name="bertos/algo/ramp.h"/> -<File Name="bertos/algo/rotating_hash.h"/> -<File Name="bertos/algo/pid_control.h"/> -<File Name="bertos/algo/crc_test.c"/> -<File Name="bertos/algo/randpool.c"/> -<File Name="bertos/algo/crc.c"/> -<File Name="bertos/algo/pid_control.c"/> -</VirtualDirectory> -<VirtualDirectory Name="sec"> -<File Name="bertos/sec/benchmarks.c"/> -<File Name="bertos/sec/entropy.h"/> -<File Name="bertos/sec/util.c"/> -<File Name="bertos/sec/cipher.c"/> -<File Name="bertos/sec/random.c"/> -<File Name="bertos/sec/random.h"/> -<File Name="bertos/sec/util.h"/> -<File Name="bertos/sec/mac.h"/> -<File Name="bertos/sec/kdf.h"/> -<File Name="bertos/sec/prng.h"/> -<File Name="bertos/sec/cipher.h"/> -<File Name="bertos/sec/random_p.h"/> -<File Name="bertos/sec/hash.h"/> -<File Name="bertos/sec/benchmarks.h"/> -<VirtualDirectory Name="prng"> -<File Name="bertos/sec/prng/x917.c"/> -<File Name="bertos/sec/prng/isaac.c"/> -<File Name="bertos/sec/prng/x917.h"/> -<File Name="bertos/sec/prng/yarrow.h"/> -<File Name="bertos/sec/prng/yarrow.c"/> -<File Name="bertos/sec/prng/isaac.h"/> -</VirtualDirectory> -<VirtualDirectory Name="cipher"> -<File Name="bertos/sec/cipher/blowfish.c"/> -<File Name="bertos/sec/cipher/aes_f8.h"/> -<File Name="bertos/sec/cipher/blowfish_test.c"/> -<File Name="bertos/sec/cipher/aes_test.c"/> -<File Name="bertos/sec/cipher/blowfish.h"/> -<File Name="bertos/sec/cipher/aes.c"/> -<File Name="bertos/sec/cipher/aes_f32.h"/> -<File Name="bertos/sec/cipher/aes.h"/> -</VirtualDirectory> -<VirtualDirectory Name="mac"> -<File Name="bertos/sec/mac/hmac.c"/> -<File Name="bertos/sec/mac/hmac.h"/> -<File Name="bertos/sec/mac/omac.h"/> -<File Name="bertos/sec/mac/hmac_test.c"/> -<File Name="bertos/sec/mac/omac.c"/> -<File Name="bertos/sec/mac/omac_test.c"/> -</VirtualDirectory> -<VirtualDirectory Name="kdf"> -<File Name="bertos/sec/kdf/pbkdf1.h"/> -<File Name="bertos/sec/kdf/pbkdf2.h"/> -<File Name="bertos/sec/kdf/pbkdf2.c"/> -<File Name="bertos/sec/kdf/pbkdf1_test.c"/> -<File Name="bertos/sec/kdf/pbkdf2_test.c"/> -<File Name="bertos/sec/kdf/pbkdf1.c"/> -</VirtualDirectory> -<VirtualDirectory Name="entropy"> -<File Name="bertos/sec/entropy/yarrow_pool.c"/> -<File Name="bertos/sec/entropy/yarrow_pool.h"/> -</VirtualDirectory> -<VirtualDirectory Name="hash"> -<File Name="bertos/sec/hash/sha1.c"/> -<File Name="bertos/sec/hash/sha1_test.c"/> -<File Name="bertos/sec/hash/ripemd_test.c"/> -<File Name="bertos/sec/hash/sha1.h"/> -<File Name="bertos/sec/hash/ripemd.h"/> -<File Name="bertos/sec/hash/md5.h"/> -<File Name="bertos/sec/hash/ripemd.c"/> -<File Name="bertos/sec/hash/md5_test.c"/> -<File Name="bertos/sec/hash/md5.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="gui"> -<File Name="bertos/gui/leveledit.c"/> -<File Name="bertos/gui/leveledit.h"/> -<File Name="bertos/gui/levelbar.c"/> -<File Name="bertos/gui/menubar.c"/> -<File Name="bertos/gui/menu.c"/> -<File Name="bertos/gui/levelbar.h"/> -<File Name="bertos/gui/menu.h"/> -<File Name="bertos/gui/menubar.h"/> -</VirtualDirectory> -<VirtualDirectory Name="os"> -<File Name="bertos/os/hptime.h"/> -<File Name="bertos/os/hptime.c"/> -</VirtualDirectory> -<VirtualDirectory Name="dt"> -<File Name="bertos/dt/dnotifier.c"/> -<File Name="bertos/dt/dnotifier.h"/> -<File Name="bertos/dt/editbool.c"/> -<File Name="bertos/dt/editbool.h"/> -<File Name="bertos/dt/dwidget.c"/> -<File Name="bertos/dt/editint.h"/> -<File Name="bertos/dt/editint.c"/> -<File Name="bertos/dt/dtag.h"/> -<File Name="bertos/dt/dwidget.h"/> -</VirtualDirectory> -<VirtualDirectory Name="net"> -<File Name="bertos/net/tftp.h"/> -<File Name="bertos/net/afsk.h"/> -<File Name="bertos/net/afsk.c"/> -<File Name="bertos/net/keytag.c"/> -<File Name="bertos/net/keytag.h"/> -<File Name="bertos/net/nmea.c"/> -<File Name="bertos/net/pocketbus.h"/> -<File Name="bertos/net/pocketcmd.h"/> -<File Name="bertos/net/ax25.c"/> -<File Name="bertos/net/pocketcmd.c"/> -<File Name="bertos/net/lwip.h"/> -<File Name="bertos/net/tftp.c"/> -<File Name="bertos/net/lwip.c"/> -<File Name="bertos/net/nmea.h"/> -<File Name="bertos/net/pocketbus.c"/> -<File Name="bertos/net/nmea_test.c"/> -<File Name="bertos/net/ax25_test.c"/> -<File Name="bertos/net/xmodem.c"/> -<File Name="bertos/net/xmodem.h"/> -<File Name="bertos/net/ax25.h"/> -<File Name="bertos/net/afsk_test.c"/> -<VirtualDirectory Name="lwip"> -<VirtualDirectory Name="src"> -<VirtualDirectory Name="arch"> -<File Name="bertos/net/lwip/src/arch/sys_arch.c"/> -</VirtualDirectory> -<VirtualDirectory Name="core"> -<File Name="bertos/net/lwip/src/core/stats.c"/> -<File Name="bertos/net/lwip/src/core/raw.c"/> -<File Name="bertos/net/lwip/src/core/mem.c"/> -<File Name="bertos/net/lwip/src/core/dns.c"/> -<File Name="bertos/net/lwip/src/core/memp.c"/> -<File Name="bertos/net/lwip/src/core/tcp.c"/> -<File Name="bertos/net/lwip/src/core/pbuf.c"/> -<File Name="bertos/net/lwip/src/core/dhcp.c"/> -<File Name="bertos/net/lwip/src/core/netif.c"/> -<File Name="bertos/net/lwip/src/core/tcp_in.c"/> -<File Name="bertos/net/lwip/src/core/sys.c"/> -<File Name="bertos/net/lwip/src/core/udp.c"/> -<File Name="bertos/net/lwip/src/core/init.c"/> -<File Name="bertos/net/lwip/src/core/tcp_out.c"/> -<VirtualDirectory Name="ipv4"> -<File Name="bertos/net/lwip/src/core/ipv4/autoip.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/ip_frag.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/igmp.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/inet.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/ip_addr.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/inet_chksum.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/icmp.c"/> -<File Name="bertos/net/lwip/src/core/ipv4/ip.c"/> -</VirtualDirectory> -<VirtualDirectory Name="ipv6"> -<File Name="bertos/net/lwip/src/core/ipv6/inet6.c"/> -<File Name="bertos/net/lwip/src/core/ipv6/ip6.c"/> -<File Name="bertos/net/lwip/src/core/ipv6/ip6_addr.c"/> -<File Name="bertos/net/lwip/src/core/ipv6/icmp6.c"/> -</VirtualDirectory> -<VirtualDirectory Name="snmp"> -<File Name="bertos/net/lwip/src/core/snmp/asn1_dec.c"/> -<File Name="bertos/net/lwip/src/core/snmp/msg_in.c"/> -<File Name="bertos/net/lwip/src/core/snmp/asn1_enc.c"/> -<File Name="bertos/net/lwip/src/core/snmp/mib_structs.c"/> -<File Name="bertos/net/lwip/src/core/snmp/msg_out.c"/> -<File Name="bertos/net/lwip/src/core/snmp/mib2.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="include"> -<File Name="bertos/net/lwip/src/include/lwipopts.h"/> -<VirtualDirectory Name="arch"> -<File Name="bertos/net/lwip/src/include/arch/perf.h"/> -<File Name="bertos/net/lwip/src/include/arch/cc.h"/> -<File Name="bertos/net/lwip/src/include/arch/sys_arch.h"/> -</VirtualDirectory> -<VirtualDirectory Name="lwip"> -<File Name="bertos/net/lwip/src/include/lwip/sys.h"/> -<File Name="bertos/net/lwip/src/include/lwip/netdb.h"/> -<File Name="bertos/net/lwip/src/include/lwip/netbuf.h"/> -<File Name="bertos/net/lwip/src/include/lwip/api_msg.h"/> -<File Name="bertos/net/lwip/src/include/lwip/stats.h"/> -<File Name="bertos/net/lwip/src/include/lwip/netif.h"/> -<File Name="bertos/net/lwip/src/include/lwip/memp.h"/> -<File Name="bertos/net/lwip/src/include/lwip/snmp_msg.h"/> -<File Name="bertos/net/lwip/src/include/lwip/dhcp.h"/> -<File Name="bertos/net/lwip/src/include/lwip/snmp.h"/> -<File Name="bertos/net/lwip/src/include/lwip/sockets.h"/> -<File Name="bertos/net/lwip/src/include/lwip/arch.h"/> -<File Name="bertos/net/lwip/src/include/lwip/opt.h"/> -<File Name="bertos/net/lwip/src/include/lwip/snmp_asn1.h"/> -<File Name="bertos/net/lwip/src/include/lwip/snmp_structs.h"/> -<File Name="bertos/net/lwip/src/include/lwip/udp.h"/> -<File Name="bertos/net/lwip/src/include/lwip/init.h"/> -<File Name="bertos/net/lwip/src/include/lwip/netifapi.h"/> -<File Name="bertos/net/lwip/src/include/lwip/raw.h"/> -<File Name="bertos/net/lwip/src/include/lwip/mem.h"/> -<File Name="bertos/net/lwip/src/include/lwip/def.h"/> -<File Name="bertos/net/lwip/src/include/lwip/sio.h"/> -<File Name="bertos/net/lwip/src/include/lwip/debug.h"/> -<File Name="bertos/net/lwip/src/include/lwip/api.h"/> -<File Name="bertos/net/lwip/src/include/lwip/pbuf.h"/> -<File Name="bertos/net/lwip/src/include/lwip/dns.h"/> -<File Name="bertos/net/lwip/src/include/lwip/err.h"/> -<File Name="bertos/net/lwip/src/include/lwip/tcp.h"/> -<File Name="bertos/net/lwip/src/include/lwip/tcpip.h"/> -<File Name="bertos/net/lwip/src/include/lwip/memp_std.h"/> -</VirtualDirectory> -<VirtualDirectory Name="netif"> -<File Name="bertos/net/lwip/src/include/netif/etharp.h"/> -<File Name="bertos/net/lwip/src/include/netif/ppp_oe.h"/> -<File Name="bertos/net/lwip/src/include/netif/loopif.h"/> -<File Name="bertos/net/lwip/src/include/netif/slipif.h"/> -<File Name="bertos/net/lwip/src/include/netif/ethernetif.h"/> -</VirtualDirectory> -<VirtualDirectory Name="ipv4"> -<VirtualDirectory Name="lwip"> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/ip.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/inet.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/igmp.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/icmp.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/ip_addr.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/inet_chksum.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/autoip.h"/> -<File Name="bertos/net/lwip/src/include/ipv4/lwip/ip_frag.h"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="ipv6"> -<VirtualDirectory Name="lwip"> -<File Name="bertos/net/lwip/src/include/ipv6/lwip/ip.h"/> -<File Name="bertos/net/lwip/src/include/ipv6/lwip/inet.h"/> -<File Name="bertos/net/lwip/src/include/ipv6/lwip/icmp.h"/> -<File Name="bertos/net/lwip/src/include/ipv6/lwip/ip_addr.h"/> -</VirtualDirectory> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="netif"> -<File Name="bertos/net/lwip/src/netif/etharp.c"/> -<File Name="bertos/net/lwip/src/netif/loopif.c"/> -<File Name="bertos/net/lwip/src/netif/slipif.c"/> -<File Name="bertos/net/lwip/src/netif/ethernetif.c"/> -<VirtualDirectory Name="ppp"> -<File Name="bertos/net/lwip/src/netif/ppp/chpms.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/pap.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/ipcp.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/fsm.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/magic.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/lcp.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/ppp_oe.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/ppp.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/pap.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/vj.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/vj.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/fsm.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/chap.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/ppp.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/auth.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/md5.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/pppdebug.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/randm.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/auth.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/magic.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/ipcp.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/vjbsdhdr.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/chpms.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/lcp.h"/> -<File Name="bertos/net/lwip/src/netif/ppp/randm.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/md5.c"/> -<File Name="bertos/net/lwip/src/netif/ppp/chap.h"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="api"> -<File Name="bertos/net/lwip/src/api/api_lib.c"/> -<File Name="bertos/net/lwip/src/api/tcpip.c"/> -<File Name="bertos/net/lwip/src/api/err.c"/> -<File Name="bertos/net/lwip/src/api/netbuf.c"/> -<File Name="bertos/net/lwip/src/api/sockets.c"/> -<File Name="bertos/net/lwip/src/api/netdb.c"/> -<File Name="bertos/net/lwip/src/api/api_msg.c"/> -<File Name="bertos/net/lwip/src/api/netifapi.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="test"> -<VirtualDirectory Name="unit"> -<File Name="bertos/net/lwip/test/unit/lwip_check.h"/> -<File Name="bertos/net/lwip/test/unit/lwip_unittests.c"/> -<VirtualDirectory Name="udp"> -<File Name="bertos/net/lwip/test/unit/udp/test_udp.c"/> -<File Name="bertos/net/lwip/test/unit/udp/test_udp.h"/> -</VirtualDirectory> -<VirtualDirectory Name="tcp"> -<File Name="bertos/net/lwip/test/unit/tcp/test_tcp.h"/> -<File Name="bertos/net/lwip/test/unit/tcp/tcp_helper.h"/> -<File Name="bertos/net/lwip/test/unit/tcp/test_tcp.c"/> -<File Name="bertos/net/lwip/test/unit/tcp/test_tcp_oos.h"/> -<File Name="bertos/net/lwip/test/unit/tcp/tcp_helper.c"/> -<File Name="bertos/net/lwip/test/unit/tcp/test_tcp_oos.c"/> -</VirtualDirectory> -</VirtualDirectory> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="nmeap"> -<File Name="bertos/net/nmeap/Makefile"/> -<VirtualDirectory Name="lib"> -</VirtualDirectory> -<VirtualDirectory Name="src"> -<File Name="bertos/net/nmeap/src/nmeap01.c"/> -<File Name="bertos/net/nmeap/src/Makefile"/> -</VirtualDirectory> -<VirtualDirectory Name="inc"> -<File Name="bertos/net/nmeap/inc/nmeap.h"/> -<File Name="bertos/net/nmeap/inc/nmeap_def.h"/> -</VirtualDirectory> -<VirtualDirectory Name="tst"> -<File Name="bertos/net/nmeap/tst/wingps.c"/> -<File Name="bertos/net/nmeap/tst/test3.c"/> -<File Name="bertos/net/nmeap/tst/test1.c"/> -<File Name="bertos/net/nmeap/tst/test2.c"/> -<File Name="bertos/net/nmeap/tst/Makefile"/> -</VirtualDirectory> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="cpu"> -<File Name="bertos/cpu/detect.h"/> -<File Name="bertos/cpu/pgm.h"/> -<File Name="bertos/cpu/power.h"/> -<File Name="bertos/cpu/byteorder_test.c"/> -<File Name="bertos/cpu/irq.h"/> -<File Name="bertos/cpu/byteorder.h"/> -<File Name="bertos/cpu/attr.h"/> -<File Name="bertos/cpu/types.h"/> -<File Name="bertos/cpu/frame.h"/> -<VirtualDirectory Name="msp430"> -<VirtualDirectory Name="info"> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/cpu/msp430/drv/kdebug_msp430.c"/> -<File Name="bertos/cpu/msp430/drv/kdebug_msp430.h"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="cortex-m3"> -<VirtualDirectory Name="io"> -<File Name="bertos/cpu/cortex-m3/io/lm3s_sysctl.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_can.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_smc.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_nvic.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_pio.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_adc.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_wdt.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_usart.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_gpio.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_memmap.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3n.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_i2c.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_pwm.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_ints.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_adc.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_nvic.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_ssi.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_memmap.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_sysctl.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_com.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_uart.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_spi.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_ints.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_pmc.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_flash.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_i2c.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32.h"/> -<File Name="bertos/cpu/cortex-m3/io/cm3.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_types.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_uart.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_pwr.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_ints.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3.h"/> -<File Name="bertos/cpu/cortex-m3/io/lm3s_nvic.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_uart.h"/> -<File Name="bertos/cpu/cortex-m3/io/sam3_flash.h"/> -<File Name="bertos/cpu/cortex-m3/io/stm32_gpio.h"/> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -<File Name="bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld"/> -<File Name="bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld"/> -</VirtualDirectory> -<VirtualDirectory Name="info"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -<File Name="bertos/cpu/cortex-m3/hw/switch_ctx_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/hw/crt_cm3.S"/> -<File Name="bertos/cpu/cortex-m3/hw/switch_ctx_cm3.c"/> -<File Name="bertos/cpu/cortex-m3/hw/vectors_cm3.S"/> -<File Name="bertos/cpu/cortex-m3/hw/init_cm3.c"/> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/cpu/cortex-m3/drv/flash_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/random_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_sam3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/can_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/random_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/flash_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/irq_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/irq_cm3.c"/> -<File Name="bertos/cpu/cortex-m3/drv/can_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/adc_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/adc_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_sam3.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/gpio_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/adc_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/kdebug_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_sam3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/flash_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/gpio_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/gpio_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/adc_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/timer_cm3.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/can_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/kdebug_sam3.c"/> -<File Name="bertos/cpu/cortex-m3/drv/kdebug_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/ssi_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/flash_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/timer_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/i2c_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ssi_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/rtc_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/usb_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/i2c_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/adc_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/kdebug_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/kdebug_lm3s.c"/> -<File Name="bertos/cpu/cortex-m3/drv/i2c_cm3.h"/> -<File Name="bertos/cpu/cortex-m3/drv/kdebug_cm3.c"/> -<File Name="bertos/cpu/cortex-m3/drv/i2c_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/gpio_lm3s.h"/> -<File Name="bertos/cpu/cortex-m3/drv/usb_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/clock_sam3.c"/> -<File Name="bertos/cpu/cortex-m3/drv/flash_stm32.c"/> -<File Name="bertos/cpu/cortex-m3/drv/ser_stm32.h"/> -<File Name="bertos/cpu/cortex-m3/drv/i2c_stm32.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="i196"> -<VirtualDirectory Name="io"> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/cpu/i196/drv/timer_i196.h"/> -<File Name="bertos/cpu/i196/drv/ser_i196.c"/> -<File Name="bertos/cpu/i196/drv/kdebug_i196.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="avr"> -<VirtualDirectory Name="io"> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -</VirtualDirectory> -<VirtualDirectory Name="info"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -<File Name="bertos/cpu/avr/hw/switch_ctx_avr.S"/> -<File Name="bertos/cpu/avr/hw/switch_avr.S"/> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/cpu/avr/drv/timer_avr.c"/> -<File Name="bertos/cpu/avr/drv/ser_avr.c"/> -<File Name="bertos/cpu/avr/drv/ser_avr.h"/> -<File Name="bertos/cpu/avr/drv/timer_simple_avr.c"/> -<File Name="bertos/cpu/avr/drv/i2c_avr.h"/> -<File Name="bertos/cpu/avr/drv/wdt_avr.h"/> -<File Name="bertos/cpu/avr/drv/adc_avr.c"/> -<File Name="bertos/cpu/avr/drv/pwm_avr.c"/> -<File Name="bertos/cpu/avr/drv/ser_simple_avr.h"/> -<File Name="bertos/cpu/avr/drv/pwm_avr.h"/> -<File Name="bertos/cpu/avr/drv/flash_avr.h"/> -<File Name="bertos/cpu/avr/drv/kdebug_avr.c"/> -<File Name="bertos/cpu/avr/drv/ser_simple_avr.c"/> -<File Name="bertos/cpu/avr/drv/i2c_avr.c"/> -<File Name="bertos/cpu/avr/drv/timer_simple_avr.h"/> -<File Name="bertos/cpu/avr/drv/stepper_avr.h"/> -<File Name="bertos/cpu/avr/drv/timer_avr.h"/> -<File Name="bertos/cpu/avr/drv/adc_avr.h"/> -<File Name="bertos/cpu/avr/drv/flash_avr.c"/> -<File Name="bertos/cpu/avr/drv/stepper_avr.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="x86"> -<VirtualDirectory Name="io"> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="ppc"> -<VirtualDirectory Name="io"> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="dsp56k"> -<VirtualDirectory Name="io"> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -<File Name="bertos/cpu/dsp56k/hw/switch_dsp56k.c"/> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/cpu/dsp56k/drv/ser_dsp56k.h"/> -<File Name="bertos/cpu/dsp56k/drv/buzzerled_dsp56k.h"/> -<File Name="bertos/cpu/dsp56k/drv/timer_dsp56k.h"/> -<File Name="bertos/cpu/dsp56k/drv/kdebug_dsp56k.c"/> -<File Name="bertos/cpu/dsp56k/drv/ser_dsp56k.c"/> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="arm"> -<VirtualDirectory Name="io"> -<File Name="bertos/cpu/arm/io/lpc23xx.h"/> -<File Name="bertos/cpu/arm/io/at91_mc.h"/> -<File Name="bertos/cpu/arm/io/at91_aic.h"/> -<File Name="bertos/cpu/arm/io/at91_emac.h"/> -<File Name="bertos/cpu/arm/io/at91.h"/> -<File Name="bertos/cpu/arm/io/at91_pio.h"/> -<File Name="bertos/cpu/arm/io/at91sam7.h"/> -<File Name="bertos/cpu/arm/io/at91_spi.h"/> -<File Name="bertos/cpu/arm/io/at91_ssc.h"/> -<File Name="bertos/cpu/arm/io/at91_rstc.h"/> -<File Name="bertos/cpu/arm/io/at91_us.h"/> -<File Name="bertos/cpu/arm/io/at91_adc.h"/> -<File Name="bertos/cpu/arm/io/at91_dbgu.h"/> -<File Name="bertos/cpu/arm/io/at91_pmc.h"/> -<File Name="bertos/cpu/arm/io/arm.h"/> -<File Name="bertos/cpu/arm/io/at91_twi.h"/> -<File Name="bertos/cpu/arm/io/at91_tc.h"/> -<File Name="bertos/cpu/arm/io/at91_wdt.h"/> -<File Name="bertos/cpu/arm/io/at91_pit.h"/> -<File Name="bertos/cpu/arm/io/at91_pwm.h"/> -</VirtualDirectory> -<VirtualDirectory Name="scripts"> -<File Name="bertos/cpu/arm/scripts/at91sam7_512_rom.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_64_rom.ld"/> -<File Name="bertos/cpu/arm/scripts/lpc2378.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_256_rom.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_256_ram.ld"/> -<File Name="bertos/cpu/arm/scripts/arm7tdmi_rom.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_128_ram.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_512_ram.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_128_rom.ld"/> -<File Name="bertos/cpu/arm/scripts/arm7tdmi_ram.ld"/> -<File Name="bertos/cpu/arm/scripts/at91sam7_64_ram.ld"/> -</VirtualDirectory> -<VirtualDirectory Name="info"> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -<File Name="bertos/cpu/arm/hw/vectors_lpc2.S"/> -<File Name="bertos/cpu/arm/hw/vectors_at91.S"/> -<File Name="bertos/cpu/arm/hw/switch_ctx_arm.S"/> -<File Name="bertos/cpu/arm/hw/init_lpc2.c"/> -<File Name="bertos/cpu/arm/hw/pll_at91.h"/> -<File Name="bertos/cpu/arm/hw/init_at91.c"/> -<File Name="bertos/cpu/arm/hw/switch_arm.S"/> -<File Name="bertos/cpu/arm/hw/crt_arm7tdmi.S"/> -<File Name="bertos/cpu/arm/hw/crtat91sam7_rom.S"/> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/cpu/arm/drv/ser_arm.h"/> -<File Name="bertos/cpu/arm/drv/timer_at91.c"/> -<File Name="bertos/cpu/arm/drv/twi_arm.h"/> -<File Name="bertos/cpu/arm/drv/adc_arm.c"/> -<File Name="bertos/cpu/arm/drv/eth_at91.c"/> -<File Name="bertos/cpu/arm/drv/kdebug_lpc2.c"/> -<File Name="bertos/cpu/arm/drv/stepper_at91.c"/> -<File Name="bertos/cpu/arm/drv/timer_at91.h"/> -<File Name="bertos/cpu/arm/drv/i2c_lpc2.h"/> -<File Name="bertos/cpu/arm/drv/i2s_at91.h"/> -<File Name="bertos/cpu/arm/drv/vic_lpc2.h"/> -<File Name="bertos/cpu/arm/drv/wdt_arm.h"/> -<File Name="bertos/cpu/arm/drv/i2s_at91.c"/> -<File Name="bertos/cpu/arm/drv/twi_arm.c"/> -<File Name="bertos/cpu/arm/drv/sysirq_at91.c"/> -<File Name="bertos/cpu/arm/drv/spi_dma_at91.c"/> -<File Name="bertos/cpu/arm/drv/sysirq_at91.h"/> -<File Name="bertos/cpu/arm/drv/flash_at91.h"/> -<File Name="bertos/cpu/arm/drv/timer_arm.h"/> -<File Name="bertos/cpu/arm/drv/i2c_arm.h"/> -<File Name="bertos/cpu/arm/drv/twi_at91.c"/> -<File Name="bertos/cpu/arm/drv/flash_lpc2.h"/> -<File Name="bertos/cpu/arm/drv/stepper_arm.h"/> -<File Name="bertos/cpu/arm/drv/ser_at91.c"/> -<File Name="bertos/cpu/arm/drv/ser_arm.c"/> -<File Name="bertos/cpu/arm/drv/flash_at91.c"/> -<File Name="bertos/cpu/arm/drv/flash_arm.h"/> -<File Name="bertos/cpu/arm/drv/i2c_at91.h"/> -<File Name="bertos/cpu/arm/drv/timer_arm.c"/> -<File Name="bertos/cpu/arm/drv/flash_lpc2.c"/> -<File Name="bertos/cpu/arm/drv/stepper_arm.c"/> -<File Name="bertos/cpu/arm/drv/kdebug_at91.h"/> -<File Name="bertos/cpu/arm/drv/i2c_lpc2.c"/> -<File Name="bertos/cpu/arm/drv/stepper_at91_hwtest.c"/> -<File Name="bertos/cpu/arm/drv/adc_at91.h"/> -<File Name="bertos/cpu/arm/drv/kdebug_arm.c"/> -<File Name="bertos/cpu/arm/drv/eth_at91.h"/> -<File Name="bertos/cpu/arm/drv/pwm_at91.h"/> -<File Name="bertos/cpu/arm/drv/twi_at91.h"/> -<File Name="bertos/cpu/arm/drv/adc_arm.h"/> -<File Name="bertos/cpu/arm/drv/ser_lpc2.h"/> -<File Name="bertos/cpu/arm/drv/pwm_at91.c"/> -<File Name="bertos/cpu/arm/drv/adc_at91.c"/> -<File Name="bertos/cpu/arm/drv/vic_lpc2.c"/> -<File Name="bertos/cpu/arm/drv/spi_dma_at91.h"/> -<File Name="bertos/cpu/arm/drv/ser_at91.h"/> -<File Name="bertos/cpu/arm/drv/ser_lpc2.c"/> -<File Name="bertos/cpu/arm/drv/pwm_arm.h"/> -<File Name="bertos/cpu/arm/drv/timer_lpc2.c"/> -<File Name="bertos/cpu/arm/drv/pwm_arm.c"/> -<File Name="bertos/cpu/arm/drv/stepper_at91.h"/> -<File Name="bertos/cpu/arm/drv/timer_lpc2.h"/> -<File Name="bertos/cpu/arm/drv/kdebug_at91.c"/> -</VirtualDirectory> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="cfg"> -<File Name="bertos/cfg/cfg_thermo.h"/> -<File Name="bertos/cfg/cfg_wdt.h"/> -<File Name="bertos/cfg/cfg_adc.h"/> -<File Name="bertos/cfg/cfg_tas5706a.h"/> -<File Name="bertos/cfg/cfg_phase.h"/> -<File Name="bertos/cfg/cfg_pwm.h"/> -<File Name="bertos/cfg/cfg_lm75.h"/> -<File Name="bertos/cfg/test.h"/> -<File Name="bertos/cfg/cfg_tftp.h"/> -<File Name="bertos/cfg/module.h"/> -<File Name="bertos/cfg/log.h"/> -<File Name="bertos/cfg/cfg_kern.h"/> -<File Name="bertos/cfg/cfg_parser.h"/> -<File Name="bertos/cfg/cfg_ramp.h"/> -<File Name="bertos/cfg/cfg_ser.h"/> -<File Name="bertos/cfg/cfg_usbkbd.h"/> -<File Name="bertos/cfg/cfg_hashtable.h"/> -<File Name="bertos/cfg/cfg_lwip.h"/> -<File Name="bertos/cfg/cfg_debug.h"/> -<File Name="bertos/cfg/cfg_sd.h"/> -<File Name="bertos/cfg/os.h"/> -<File Name="bertos/cfg/kfile_debug.h"/> -<File Name="bertos/cfg/cfg_ini_reader.h"/> -<File Name="bertos/cfg/cfg_fat.h"/> -<File Name="bertos/cfg/cfg_dc_motor.h"/> -<File Name="bertos/cfg/cfg_attr.h"/> -<File Name="bertos/cfg/cfg_usbser.h"/> -<File Name="bertos/cfg/cfg_buzzerled.h"/> -<File Name="bertos/cfg/cfg_xmodem.h"/> -<File Name="bertos/cfg/cfg_ax25.h"/> -<File Name="bertos/cfg/cfg_arch.h"/> -<File Name="bertos/cfg/cfg_usb.h"/> -<File Name="bertos/cfg/cfg_lcd_32122a.h"/> -<File Name="bertos/cfg/cfg_battfs.h"/> -<File Name="bertos/cfg/cfg_heap.h"/> -<File Name="bertos/cfg/cfg_spi_bitbang.h"/> -<File Name="bertos/cfg/cfg_boot.h"/> -<File Name="bertos/cfg/cfg_flash25.h"/> -<File Name="bertos/cfg/cfg_i2c.h"/> -<File Name="bertos/cfg/debug.h"/> -<File Name="bertos/cfg/cfg_context_switch.h"/> -<File Name="bertos/cfg/compiler.h"/> -<File Name="bertos/cfg/cfg_signal.h"/> -<File Name="bertos/cfg/cfg_pid.h"/> -<File Name="bertos/cfg/cfg_sem.h"/> -<File Name="bertos/cfg/cfg_dataflash.h"/> -<File Name="bertos/cfg/cfg_gfx.h"/> -<File Name="bertos/cfg/cfg_kfile.h"/> -<File Name="bertos/cfg/cfg_timer.h"/> -<File Name="bertos/cfg/cfg_eeprom.h"/> -<File Name="bertos/cfg/cfg_usbmouse.h"/> -<File Name="bertos/cfg/cfg_formatwr.h"/> -<File Name="bertos/cfg/cfg_spi_dma.h"/> -<File Name="bertos/cfg/cfg_i2s.h"/> -<File Name="bertos/cfg/cfg_kbd.h"/> -<File Name="bertos/cfg/cfg_stepper.h"/> -<File Name="bertos/cfg/cfg_monitor.h"/> -<File Name="bertos/cfg/cfg_nmea.h"/> -<File Name="bertos/cfg/cfg_random.h"/> -<File Name="bertos/cfg/cfg_eth.h"/> -<File Name="bertos/cfg/cfg_md2.h"/> -<File Name="bertos/cfg/depend.h"/> -<File Name="bertos/cfg/macros.h"/> -<File Name="bertos/cfg/cfg_can.h"/> -<File Name="bertos/cfg/cfg_ntc.h"/> -<File Name="bertos/cfg/kfile_debug.c"/> -<File Name="bertos/cfg/cfg_randpool.h"/> -<File Name="bertos/cfg/cfg_pocketbus.h"/> -<File Name="bertos/cfg/cfg_keytag.h"/> -<File Name="bertos/cfg/cfg_emb_flash.h"/> -<File Name="bertos/cfg/cfg_lcd_hd44.h"/> -<File Name="bertos/cfg/cfg_menu.h"/> -<File Name="bertos/cfg/cfg_afsk.h"/> -<File Name="bertos/cfg/cfg_proc.h"/> -</VirtualDirectory> -<VirtualDirectory Name="hw"> -<File Name="bertos/hw/hw_spi_dma.h"/> -<File Name="bertos/hw/hw_tmp123.h"/> -<File Name="bertos/hw/hw_sensor.h"/> -<File Name="bertos/hw/hw_timer.h"/> -<File Name="bertos/hw/hw_cpufreq.h"/> -<File Name="bertos/hw/phase_map.h"/> -<File Name="bertos/hw/hw_ntc.h"/> -<File Name="bertos/hw/hw_tc520.h"/> -<File Name="bertos/hw/hw_led.h"/> -<File Name="bertos/hw/hw_afsk.h"/> -<File Name="bertos/hw/hw_mcp41.h"/> -<File Name="bertos/hw/hw_ft245rl.h"/> -<File Name="bertos/hw/hw_rit128x96.h"/> -<File Name="bertos/hw/hw_hx8347.h"/> -<File Name="bertos/hw/hw_buzzer.h"/> -<File Name="bertos/hw/hw_sd.h"/> -<File Name="bertos/hw/ntc_map.h"/> -<File Name="bertos/hw/hw_lcd_32122a.h"/> -<File Name="bertos/hw/hw_buzzerled.h"/> -<File Name="bertos/hw/hw_spi.h"/> -<File Name="bertos/hw/hw_dataflash.c"/> -<File Name="bertos/hw/hw_lcd_hd44.h"/> -<File Name="bertos/hw/hw_phase.c"/> -<File Name="bertos/hw/kbd_map.h"/> -<File Name="bertos/hw/hw_lm75.h"/> -<File Name="bertos/hw/hw_mcp41.c"/> -<File Name="bertos/hw/hw_tas5706a.h"/> -<File Name="bertos/hw/hw_input.h"/> -<File Name="bertos/hw/pwm_map.h"/> -<File Name="bertos/hw/hw_kbd.h"/> -<File Name="bertos/hw/hw_tlv5618.h"/> -<File Name="bertos/hw/hw_lcd.h"/> -<File Name="bertos/hw/hw_stepper.h"/> -<File Name="bertos/hw/hw_ili9225.h"/> -<File Name="bertos/hw/hw_i2c_bitbang.h"/> -<File Name="bertos/hw/hw_boot.h"/> -<File Name="bertos/hw/hw_ntc.c"/> -<File Name="bertos/hw/hw_dc_motor.h"/> -<File Name="bertos/hw/hw_phase.h"/> -<File Name="bertos/hw/hw_dataflash.h"/> -<File Name="bertos/hw/hw_thermo.h"/> -<File Name="bertos/hw/hw_ser.h"/> -<File Name="bertos/hw/mcp41_map.h"/> -<File Name="bertos/hw/hw_sipo.h"/> -<File Name="bertos/hw/thermo_map.h"/> -<File Name="bertos/hw/hw_blanker.h"/> -</VirtualDirectory> -<VirtualDirectory Name="drv"> -<File Name="bertos/drv/lcd_text_hwtest.c"/> -<File Name="bertos/drv/can.h"/> -<File Name="bertos/drv/tmp123.h"/> -<File Name="bertos/drv/tmp123.c"/> -<File Name="bertos/drv/tlv5618.c"/> -<File Name="bertos/drv/kdebug.c"/> -<File Name="bertos/drv/tlv5618.h"/> -<File Name="bertos/drv/usb.h"/> -<File Name="bertos/drv/phase.c"/> -<File Name="bertos/drv/ft245rl.h"/> -<File Name="bertos/drv/wdt.h"/> -<File Name="bertos/drv/adc.h"/> -<File Name="bertos/drv/usb_endpoint.h"/> -<File Name="bertos/drv/usbmouse.c"/> -<File Name="bertos/drv/sd.c"/> -<File Name="bertos/drv/usbmouse.h"/> -<File Name="bertos/drv/tas5706a.c"/> -<File Name="bertos/drv/lm75.c"/> -<File Name="bertos/drv/kbd.c"/> -<File Name="bertos/drv/lcd_text.h"/> -<File Name="bertos/drv/usbkbd.h"/> -<File Name="bertos/drv/stepper.h"/> -<File Name="bertos/drv/lcd_hx8347.h"/> -<File Name="bertos/drv/flash25_hwtest.c"/> -<File Name="bertos/drv/lcd_hd44_hwtest.c"/> -<File Name="bertos/drv/lcd_32122a.c"/> -<File Name="bertos/drv/flash25.h"/> -<File Name="bertos/drv/buzzer.h"/> -<File Name="bertos/drv/timer.c"/> -<File Name="bertos/drv/rtc.h"/> -<File Name="bertos/drv/i2c.c"/> -<File Name="bertos/drv/phase.h"/> -<File Name="bertos/drv/pwm.c"/> -<File Name="bertos/drv/lcd_text.c"/> -<File Name="bertos/drv/eeprom.h"/> -<File Name="bertos/drv/sd.h"/> -<File Name="bertos/drv/lcd_gfx_qt.cpp"/> -<File Name="bertos/drv/thermo.h"/> -<File Name="bertos/drv/buzzerled.h"/> -<File Name="bertos/drv/ser.h"/> -<File Name="bertos/drv/ft245rl.c"/> -<File Name="bertos/drv/lcd_lm44_qt.h"/> -<File Name="bertos/drv/i2c.h"/> -<File Name="bertos/drv/mcp41.h"/> -<File Name="bertos/drv/pcf8574.c"/> -<File Name="bertos/drv/dataflash.c"/> -<File Name="bertos/drv/lcd_ili9225.h"/> -<File Name="bertos/drv/pwm.h"/> -<File Name="bertos/drv/lcd_gfx_qt.h"/> -<File Name="bertos/drv/i2c_bitbang.c"/> -<File Name="bertos/drv/spi_bitbang.c"/> -<File Name="bertos/drv/eth.h"/> -<File Name="bertos/drv/lcd_rit128x96.c"/> -<File Name="bertos/drv/tc520.c"/> -<File Name="bertos/drv/lcd_hd44.c"/> -<File Name="bertos/drv/lcd_32122a.h"/> -<File Name="bertos/drv/pwm_hwtest.c"/> -<File Name="bertos/drv/usbser.h"/> -<File Name="bertos/drv/mcp41.c"/> -<File Name="bertos/drv/buzzerled.c"/> -<File Name="bertos/drv/eeprom.c"/> -<File Name="bertos/drv/lcd_rit128x96.h"/> -<File Name="bertos/drv/sipo.h"/> -<File Name="bertos/drv/pcf8574.h"/> -<File Name="bertos/drv/flash25.c"/> -<File Name="bertos/drv/spi_bitbang.h"/> -<File Name="bertos/drv/dataflash.h"/> -<File Name="bertos/drv/lcd_ili9225.c"/> -<File Name="bertos/drv/dataflash_hwtest.c"/> -<File Name="bertos/drv/stepper.c"/> -<File Name="bertos/drv/dc_motor_hwtest.c"/> -<File Name="bertos/drv/lcd_gfx_hwtest.c"/> -<File Name="bertos/drv/usbkbd.c"/> -<File Name="bertos/drv/lcd_hx8347.c"/> -<File Name="bertos/drv/thermo.c"/> -<File Name="bertos/drv/buzzer.c"/> -<File Name="bertos/drv/ntc.h"/> -<File Name="bertos/drv/lcd_hd44.h"/> -<File Name="bertos/drv/lcd_lm44_qt.cpp"/> -<File Name="bertos/drv/ser.c"/> -<File Name="bertos/drv/adc.c"/> -<File Name="bertos/drv/can.c"/> -<File Name="bertos/drv/ser_p.h"/> -<File Name="bertos/drv/dc_motor.h"/> -<File Name="bertos/drv/lm75.h"/> -<File Name="bertos/drv/timer.h"/> -<File Name="bertos/drv/tc520.h"/> -<File Name="bertos/drv/timer_test.c"/> -<File Name="bertos/drv/mpxx6115a.h"/> -<File Name="bertos/drv/dc_motor.c"/> -<File Name="bertos/drv/ntc.c"/> -<File Name="bertos/drv/sipo.c"/> -<File Name="bertos/drv/kbd.h"/> -<File Name="bertos/drv/usb_hid.h"/> -<File Name="bertos/drv/flash.h"/> -<File Name="bertos/drv/usbser.c"/> -<File Name="bertos/drv/tas5706a.h"/> -</VirtualDirectory> -<VirtualDirectory Name="fonts"> -<File Name="bertos/fonts/helvB10.c"/> -<File Name="bertos/fonts/fonts.mk"/> -<File Name="bertos/fonts/ncenB18.c"/> -<File Name="bertos/fonts/gohu.c"/> -<File Name="bertos/fonts/fixed6x8.c"/> -<File Name="bertos/fonts/luBS14.c"/> -</VirtualDirectory> -<VirtualDirectory Name="emul"> -<File Name="bertos/emul/ser_posix.c"/> -<File Name="bertos/emul/emul.mk"/> -<File Name="bertos/emul/kfile_posix.h"/> -<File Name="bertos/emul/timer_posix.h"/> -<File Name="bertos/emul/emul.h"/> -<File Name="bertos/emul/emulwin.h"/> -<File Name="bertos/emul/timer_qt.h"/> -<File Name="bertos/emul/emul.cpp"/> -<File Name="bertos/emul/diskio_emul.c"/> -<File Name="bertos/emul/timer_qt.c"/> -<File Name="bertos/emul/kfile_posix.c"/> -<File Name="bertos/emul/switch_ctx_emul.S"/> -<File Name="bertos/emul/emulwin.cpp"/> -<File Name="bertos/emul/timer_posix.c"/> -<File Name="bertos/emul/emulkbd.cpp"/> -<File Name="bertos/emul/emulkbd.h"/> -<File Name="bertos/emul/switch.S"/> -<File Name="bertos/emul/switch_ppc.S"/> -<File Name="bertos/emul/switch_i386.S"/> -</VirtualDirectory> -<VirtualDirectory Name="struct"> -<File Name="bertos/struct/hashtable.c"/> -<File Name="bertos/struct/kfile_fifo.h"/> -<File Name="bertos/struct/kfile_mem.h"/> -<File Name="bertos/struct/bitarray_test.c"/> -<File Name="bertos/struct/list.h"/> -<File Name="bertos/struct/kfile_mem.c"/> -<File Name="bertos/struct/fifobuf.h"/> -<File Name="bertos/struct/heap.c"/> -<File Name="bertos/struct/heap.h"/> -<File Name="bertos/struct/kfile_fifo_test.c"/> -<File Name="bertos/struct/kfile_fifo.c"/> -<File Name="bertos/struct/hashtable.h"/> -<File Name="bertos/struct/bitarray.h"/> -<File Name="bertos/struct/hashtable_test.c"/> -<File Name="bertos/struct/heap_test.c"/> -<File Name="bertos/struct/pool.h"/> -</VirtualDirectory> -<VirtualDirectory Name="fs"> -<File Name="bertos/fs/battfs.h"/> -<File Name="bertos/fs/fat.c"/> -<File Name="bertos/fs/fat_test.c"/> -<File Name="bertos/fs/battfs.c"/> -<File Name="bertos/fs/fat.h"/> -<File Name="bertos/fs/battfs_test.c"/> -<VirtualDirectory Name="fatfs"> -<File Name="bertos/fs/fatfs/ff.c"/> -<File Name="bertos/fs/fatfs/diskio.c"/> -<File Name="bertos/fs/fatfs/diskio.h"/> -<File Name="bertos/fs/fatfs/ff.h"/> -<File Name="bertos/fs/fatfs/integer.h"/> -<VirtualDirectory Name="option"> -<File Name="bertos/fs/fatfs/option/ccsbcs.c"/> -<File Name="bertos/fs/fatfs/option/cc932.c"/> -<File Name="bertos/fs/fatfs/option/cc949.c"/> -<File Name="bertos/fs/fatfs/option/cc936.c"/> -<File Name="bertos/fs/fatfs/option/cc950.c"/> -<File Name="bertos/fs/fatfs/option/syncobj.c"/> -</VirtualDirectory> -</VirtualDirectory> -</VirtualDirectory> -<VirtualDirectory Name="benchmark"> -<File Name="bertos/benchmark/context_switch.c"/> -<File Name="bertos/benchmark/context_switch.h"/> -<File Name="bertos/benchmark/kernel_footprint.h"/> -<File Name="bertos/benchmark/kernel_footprint.c"/> -</VirtualDirectory> -</VirtualDirectory> - <Description></Description> - <Dependencies/> - <Settings Type="Dynamic Library"> - <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library"> - <General OutputFile="" IntermediateDirectory="./Debug" Command="./images/usb_can.elf" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> - <Compiler Required="yes" Options="-g"> - <IncludePath Value="."/> - </Compiler> - <Linker Required="yes" Options=""/> - <Debugger IsRemote="yes" RemoteHostName="localhost" RemoteHostPort="3333" DebuggerPath="/home/nicolasd/opt/arm/bin/arm-none-eabi-gdb"> - <PostConnectCommands> -source bertos/prg_scripts/arm/openocd/gdbinit-sam7 - </PostConnectCommands> - <StartupCommands> -shell sleep 2 - </StartupCommands> - </Debugger> - <ResourceCompiler Required="no" Options=""/> - <PreBuild/> - <PostBuild/> - <CustomBuild Enabled="yes"> - <CleanCommand>make clean</CleanCommand> - <BuildCommand>make</BuildCommand> - <PreprocessFileCommand></PreprocessFileCommand> - <SingleFileCommand></SingleFileCommand> - <MakefileGenerationCommand></MakefileGenerationCommand> - <ThirdPartyToolName>None</ThirdPartyToolName> - <WorkingDirectory>$(WorkspacePath)</WorkingDirectory> - </CustomBuild> - <AdditionalRules> - <CustomPostBuild></CustomPostBuild> - <CustomPreBuild></CustomPreBuild> - </AdditionalRules> - </Configuration> - <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library"> - <General OutputFile="" IntermediateDirectory="./Release" Command="" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> - <Compiler Required="yes" Options=""> - <IncludePath Value="."/> - </Compiler> - <Linker Required="yes" Options="-O2"/> - <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath=""> - <PostConnectCommands></PostConnectCommands> - <StartupCommands></StartupCommands> - </Debugger> - <ResourceCompiler Required="no" Options=""/> - <PreBuild/> - <PostBuild/> - <CustomBuild Enabled="yes"> - <CleanCommand>make clean</CleanCommand> - <BuildCommand>make</BuildCommand> - <PreprocessFileCommand></PreprocessFileCommand> - <SingleFileCommand></SingleFileCommand> - <MakefileGenerationCommand></MakefileGenerationCommand> - <ThirdPartyToolName>None</ThirdPartyToolName> - <WorkingDirectory>$(WorkspacePath)</WorkingDirectory> - </CustomBuild> - <AdditionalRules> - <CustomPostBuild></CustomPostBuild> - <CustomPreBuild></CustomPreBuild> - </AdditionalRules> - </Configuration> - </Settings> -</CodeLite_Project> diff --git a/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_kfile.h b/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_kfile.h index 0ebed7b..5f63a1e 100644 --- a/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_kfile.h +++ b/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_kfile.h @@ -56,6 +56,6 @@ * Enable the gets function with echo. * $WIZ$ type = "boolean" */ -#define CONFIG_KFILE_GETS 0 +#define CONFIG_KFILE_GETS 1 #endif /* CFG_KFILE_H */ diff --git a/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_ser.h b/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_ser.h index 91a10e0..03e7b49 100644 --- a/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_ser.h +++ b/elec/boards/USB_CAN/Firmware/usb_can/cfg/cfg_ser.h @@ -214,7 +214,7 @@ * $WIZ$ type = "int" * $WIZ$ min = 0 */ -#define CONFIG_SER_DEFBAUDRATE 0UL +#define CONFIG_SER_DEFBAUDRATE 115200UL /// Enable strobe pin for debugging serial interrupt. $WIZ$ type = "boolean" #define CONFIG_SER_STROBE 0 diff --git a/elec/boards/USB_CAN/Firmware/usb_can/main.c b/elec/boards/USB_CAN/Firmware/usb_can/main.c index fe3bce3..a6ac284 100644 --- a/elec/boards/USB_CAN/Firmware/usb_can/main.c +++ b/elec/boards/USB_CAN/Firmware/usb_can/main.c @@ -48,14 +48,22 @@ #include <drv/gpio_stm32.h> #include <drv/can.h> -#include <drv/can_stm32.h> +#include <drv/ser.h> #include <drv/timer.h> #include <kern/monitor.h> #include <kern/proc.h> +#include <io/kfile.h> -PROC_DEFINE_STACK(stack1, KERN_MINSTACKSIZE * 8); -PROC_DEFINE_STACK(stack2, KERN_MINSTACKSIZE * 8); +#include "usb_can.h" + +#define MAX_CMD_SIZE 64 + +PROC_DEFINE_STACK(stack_ser_recv, KERN_MINSTACKSIZE * 4); +PROC_DEFINE_STACK(stack_can_recv, KERN_MINSTACKSIZE * 4); +PROC_DEFINE_STACK(stack_blinky, KERN_MINSTACKSIZE * 2); + +static struct Serial ser; static void init(void) { @@ -64,79 +72,91 @@ static void init(void) cfg.mcr = CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP; /* CAN driver in loopback mode */ - cfg.btr = CAN_BTR_SJW(0) | CAN_BTR_TS1(8) | CAN_BTR_TS2(1) | CAN_BTR_BRP(6) | CAN_BTR_LBKM; + cfg.btr = CAN_BTR_SJW(0) | CAN_BTR_TS1(8) | CAN_BTR_TS2(1) | CAN_BTR_BRP(6); cfg.n_filters = 0; cfg.filters = NULL; - /* Enable all the interrupts */ - IRQ_ENABLE; + /* Enable all the interrupts */ + IRQ_ENABLE; - /* Initialize debugging module (allow kprintf(), etc.) */ - kdbg_init(); - /* Initialize system timer */ - timer_init(); + /* Initialize debugging module (allow kprintf(), etc.) */ + kdbg_init(); + /* Initialize system timer */ + timer_init(); - /* Initialize CAN driver */ + /* Initialize CAN driver */ can_init(); can_start(CAND1, &cfg); - /* Initialize LED driver */ - LEDS_INIT(); + /* Initialize LED driver */ + LEDS_INIT(); - /* - * Kernel initialization: processes (allow to create and dispatch - * processes using proc_new()). - */ - proc_init(); + LED3_ON(); + + /* Initialize Serial driver */ + ser_init(&ser, SER_UART3); + + /* + * Kernel initialization: processes (allow to create and dispatch + * processes using proc_new()). + */ + proc_init(); } -static void NORETURN ... [truncated message content] |
From: Jérémie D. <Ba...@us...> - 2011-03-12 21:00:35
|
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 4e54c2a25cca9ff42042dce62420deea8545d6b7 (commit) from 7f386be7746f720e4fd46aae6adb0e960870b021 (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 4e54c2a25cca9ff42042dce62420deea8545d6b7 Author: Jérémie Dimino <je...@di...> Date: Sat Mar 12 21:59:31 2011 +0100 [info] implement the driver ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index 42abfbc..8c23795 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -51,6 +51,17 @@ Library "krobot-interfaces" Krobot_interface_can # +-------------------------------------------------------------------+ +# | The driver | +# +-------------------------------------------------------------------+ + +Executable "krobot-driver" + Path: src/driver + Install: true + CompiledObject: best + MainIs: krobot_driver.ml + BuildDepends: krobot.can-bus, lwt.syntax + +# +-------------------------------------------------------------------+ # | Tools | # +-------------------------------------------------------------------+ diff --git a/info/control2011/_tags b/info/control2011/_tags index cc76a51..fedbe71 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -2,7 +2,7 @@ <src/interfaces/*.ml>: -syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: 4facc269f4400da42699b09bf69a0df9) +# DO NOT EDIT (digest: 714f24c8f8cd15c9da08a3b463f1d17c) # Library krobot "src/lib": include <src/lib/*.ml{,i}>: pkg_obus @@ -22,6 +22,19 @@ "src/can/can_stubs.c": pkg_lwt.unix "src/can/can_stubs.c": pkg_lwt.syntax "src/can/can_stubs.c": pkg_krobot.interfaces +# Executable krobot-driver +<src/driver/krobot_driver.{native,byte}>: use_krobot-can-bus +<src/driver/krobot_driver.{native,byte}>: use_krobot +<src/driver/krobot_driver.{native,byte}>: pkg_obus +<src/driver/krobot_driver.{native,byte}>: pkg_lwt.unix +<src/driver/krobot_driver.{native,byte}>: pkg_lwt.syntax +<src/driver/krobot_driver.{native,byte}>: pkg_krobot.interfaces +<src/driver/*.ml{,i}>: use_krobot-can-bus +<src/driver/*.ml{,i}>: use_krobot +<src/driver/*.ml{,i}>: pkg_obus +<src/driver/*.ml{,i}>: pkg_lwt.unix +<src/driver/*.ml{,i}>: pkg_lwt.syntax +<src/driver/*.ml{,i}>: pkg_krobot.interfaces # Library krobot-interfaces "src/interfaces": include <src/interfaces/*.ml{,i}>: pkg_obus diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index 2e91799..e003f47 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 0dc16674bcb1ea7bbf1df154eca87808) *) +(* DO NOT EDIT (digest: 003c94954a115118c0158a0ee154e6cc) *) (* Regenerated by OASIS v0.2.0 Visit http://oasis.forge.ocamlcore.org for more information and @@ -5152,6 +5152,33 @@ let setup_t = doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "ocamldoc"]; }); + Executable + ({ + cs_name = "krobot-driver"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "src/driver"; + bs_compiled_object = Best; + bs_build_depends = + [ + InternalLibrary "krobot-can-bus"; + FindlibPackage ("lwt.syntax", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + {exec_custom = false; exec_main_is = "krobot_driver.ml"; }); Library ({ cs_name = "krobot-interfaces"; diff --git a/info/control2011/src/driver/krobot_driver.ml b/info/control2011/src/driver/krobot_driver.ml new file mode 100644 index 0000000..71d36ff --- /dev/null +++ b/info/control2011/src/driver/krobot_driver.ml @@ -0,0 +1,36 @@ +(* + * krobot_driver.ml + * ---------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* The interface between the CAN and D-Bus *) + +open Lwt +open Lwt_react + +lwt () = + if Array.length Sys.argv <> 2 then begin + print_endline "usage: krobot-driver <interface>"; + exit 2; + end; + + (* Open the CAN bus. *) + lwt can = Krobot_can_bus.open_can Sys.argv.(1) in + + (* Open the D-Bus connection. *) + lwt bus = OBus_bus.of_addresses [OBus_address.make "unix" [("abstract", "krobot")]] in + + (* D-Bus --> CAN *) + lwt () = + OBus_signal.connect (Krobot_can.frames bus) + >|= E.notify_s (Krobot_can_bus.send can) + in + + (* CAN --> D-Bus *) + while_lwt true do + Krobot_can_bus.recv can >>= Krobot_can.send bus + done hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2011-03-12 19:44:56
|
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 7f386be7746f720e4fd46aae6adb0e960870b021 (commit) via 1a99706952209baf94daade758ad6591bc03e614 (commit) via a92aa05e0c4ce3ccded698c46f31d56a11b6fddf (commit) via dcc464c28bd262fbc2b17e033560c58e9f07c612 (commit) from b43cd31f49a7d41d1337700bffa8202a984b6418 (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 7f386be7746f720e4fd46aae6adb0e960870b021 Author: Jérémie Dimino <je...@di...> Date: Sat Mar 12 20:43:40 2011 +0100 [info] add functions to send/receive CAN frames over D-Bus commit 1a99706952209baf94daade758ad6591bc03e614 Author: Jérémie Dimino <je...@di...> Date: Sat Mar 12 20:13:00 2011 +0100 [info] implements conversion between D-Bus structures and CAN frames commit a92aa05e0c4ce3ccded698c46f31d56a11b6fddf Author: Jérémie Dimino <je...@di...> Date: Sat Mar 12 20:02:17 2011 +0100 [info] put CAN frame definition into the module Krobot_can commit dcc464c28bd262fbc2b17e033560c58e9f07c612 Author: Jérémie Dimino <dim@arrakis.(none)> Date: Sat Mar 12 16:23:56 2011 +0100 [info] add a tool for capturing motor positions The tool reads continuously the positions of the motors, prints them on stdout and put them into a file for plotting. ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index 91ee771..42abfbc 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -20,23 +20,47 @@ Description: Control program for the Eurobot robotic cup. Library krobot FindlibName: krobot - BuildDepends: lwt.unix, lwt.syntax + BuildDepends: lwt.unix, lwt.syntax, obus, krobot.interfaces XMETADescription: The [Kro]bot library - XMETARequires: lwt.unix + XMETARequires: lwt.unix, obus, krobot.interfaces Path: src/lib Install: true + Modules: + Krobot_can -Library can - FindlibName: can +Library "krobot-can-bus" + FindlibName: can-bus FindlibParent: krobot - BuildDepends: lwt.unix, lwt.syntax + BuildDepends: krobot, lwt.syntax XMETADescription: CAN interface using SocketCAN - XMETARequires: lwt.unix + XMETARequires: krobot Path: src/can Install: true - Modules: CAN + Modules: Krobot_can_bus CSources: can_stubs.c +Library "krobot-interfaces" + FindlibName: can + FindlibParent: krobot + BuildDepends: obus + XMETADescription: [Kro]bot D-Bus interfaces + XMETARequires: obus + Path: src/interfaces + Install: true + Modules: + Krobot_interface_can + +# +-------------------------------------------------------------------+ +# | Tools | +# +-------------------------------------------------------------------+ + +Executable "krobot-plot" + Path: tools + Install: true + CompiledObject: best + MainIs: krobot_plot.ml + BuildDepends: krobot.can-bus, lwt.syntax + # +-------------------------------------------------------------------+ # | Examples | # +-------------------------------------------------------------------+ @@ -46,7 +70,7 @@ Executable "dump-can" Install: false CompiledObject: best MainIs: dump_can.ml - BuildDepends: krobot.can + BuildDepends: krobot.can-bus, lwt.syntax # +-------------------------------------------------------------------+ # | Doc | diff --git a/info/control2011/_tags b/info/control2011/_tags index 2e33d60..cc76a51 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -1,23 +1,54 @@ <**/*.ml>: syntax_camlp4o +<src/interfaces/*.ml>: -syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: 113a86794ede4d5625a352637c66e020) -# Library can +# DO NOT EDIT (digest: 4facc269f4400da42699b09bf69a0df9) +# Library krobot +"src/lib": include +<src/lib/*.ml{,i}>: pkg_obus +<src/lib/*.ml{,i}>: pkg_lwt.unix +<src/lib/*.ml{,i}>: pkg_lwt.syntax +<src/lib/*.ml{,i}>: pkg_krobot.interfaces +# Library krobot-can-bus "src/can": include -<src/can/can.{cma,cmxa}>: use_libcan +<src/can/krobot-can-bus.{cma,cmxa}>: use_libkrobot-can-bus +<src/can/*.ml{,i}>: use_krobot +<src/can/*.ml{,i}>: pkg_obus <src/can/*.ml{,i}>: pkg_lwt.unix <src/can/*.ml{,i}>: pkg_lwt.syntax +<src/can/*.ml{,i}>: pkg_krobot.interfaces +"src/can/can_stubs.c": use_krobot +"src/can/can_stubs.c": pkg_obus "src/can/can_stubs.c": pkg_lwt.unix "src/can/can_stubs.c": pkg_lwt.syntax -# Library krobot -"src/lib": include -<src/lib/*.ml{,i}>: pkg_lwt.unix -<src/lib/*.ml{,i}>: pkg_lwt.syntax +"src/can/can_stubs.c": pkg_krobot.interfaces +# Library krobot-interfaces +"src/interfaces": include +<src/interfaces/*.ml{,i}>: pkg_obus # Executable dump-can -<examples/dump_can.{native,byte}>: use_can +<examples/dump_can.{native,byte}>: use_krobot-can-bus +<examples/dump_can.{native,byte}>: use_krobot +<examples/dump_can.{native,byte}>: pkg_obus <examples/dump_can.{native,byte}>: pkg_lwt.unix <examples/dump_can.{native,byte}>: pkg_lwt.syntax -<examples/*.ml{,i}>: use_can +<examples/dump_can.{native,byte}>: pkg_krobot.interfaces +<examples/*.ml{,i}>: use_krobot-can-bus +<examples/*.ml{,i}>: use_krobot +<examples/*.ml{,i}>: pkg_obus <examples/*.ml{,i}>: pkg_lwt.unix <examples/*.ml{,i}>: pkg_lwt.syntax +<examples/*.ml{,i}>: pkg_krobot.interfaces +# Executable krobot-plot +<tools/krobot_plot.{native,byte}>: use_krobot-can-bus +<tools/krobot_plot.{native,byte}>: use_krobot +<tools/krobot_plot.{native,byte}>: pkg_obus +<tools/krobot_plot.{native,byte}>: pkg_lwt.unix +<tools/krobot_plot.{native,byte}>: pkg_lwt.syntax +<tools/krobot_plot.{native,byte}>: pkg_krobot.interfaces +<tools/*.ml{,i}>: use_krobot-can-bus +<tools/*.ml{,i}>: use_krobot +<tools/*.ml{,i}>: pkg_obus +<tools/*.ml{,i}>: pkg_lwt.unix +<tools/*.ml{,i}>: pkg_lwt.syntax +<tools/*.ml{,i}>: pkg_krobot.interfaces # OASIS_STOP diff --git a/info/control2011/examples/dump_can.ml b/info/control2011/examples/dump_can.ml index b54c248..37305f2 100644 --- a/info/control2011/examples/dump_can.ml +++ b/info/control2011/examples/dump_can.ml @@ -10,36 +10,30 @@ (* Dump all frames received from the CAN. *) open Lwt -open CAN +open Krobot_can let rec loop bus = - lwt frame = CAN.recv bus in - let data = String.create 8 in - String.blit frame.frame_data 0 data 0 (String.length frame.frame_data); + lwt frame = Krobot_can_bus.recv bus in + let buf = Buffer.create 24 in + String.iter (fun ch -> Printf.bprintf buf " %02x" (Char.code ch)) frame.data; lwt () = Lwt_io.printf "can frame received: id = %d; - type = %s; + kind = %s; remote = %B; format = %d bits; - data = %02x %02x %02x %02x %02x %02x %02x %02x; + data[%d] =%s; " - frame.frame_identifier - (match frame.frame_type with - | Type_data -> "data" - | Type_error -> "error") - frame.frame_remote - (match frame.frame_format with - | Format_11bits -> 11 - | Format_29bits -> 29) - (Char.code data.[0]) - (Char.code data.[1]) - (Char.code data.[2]) - (Char.code data.[3]) - (Char.code data.[4]) - (Char.code data.[5]) - (Char.code data.[6]) - (Char.code data.[7]) + frame.identifier + (match frame.kind with + | Data -> "data" + | Error -> "error") + frame.remote + (match frame.format with + | F11bits -> 11 + | F29bits -> 29) + (String.length frame.data) + (Buffer.contents buf) in loop bus @@ -49,6 +43,6 @@ lwt () = exit 2; end; try_lwt - CAN.open_can Sys.argv.(1) >>= loop + Krobot_can_bus.open_can Sys.argv.(1) >>= loop with Unix.Unix_error(error, func, arg) -> Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) diff --git a/info/control2011/krobot-api.odocl b/info/control2011/krobot-api.odocl index f8c8de8..9436993 100644 --- a/info/control2011/krobot-api.odocl +++ b/info/control2011/krobot-api.odocl @@ -1,4 +1,4 @@ # OASIS_START -# DO NOT EDIT (digest: 58886b9f951fc765b4b70313e7367405) -src/can/CAN +# DO NOT EDIT (digest: c46f7c116cbb13ebe71e2f42643fde6d) +src/interfaces/Krobot_interface_can # OASIS_STOP diff --git a/info/control2011/myocamlbuild.ml b/info/control2011/myocamlbuild.ml index 5084bdd..e8c9828 100644 --- a/info/control2011/myocamlbuild.ml +++ b/info/control2011/myocamlbuild.ml @@ -1,5 +1,5 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: c55b11139c906a1165b22ff2f3e11ddc) *) +(* DO NOT EDIT (digest: c1fbc9a81674247e1022c94dba267b98) *) module OASISGettext = struct # 21 "/home/dim/sources/oasis/src/oasis/OASISGettext.ml" @@ -452,8 +452,12 @@ open Ocamlbuild_plugin;; let package_default = { MyOCamlbuildBase.lib_ocaml = - [("src/can/can", ["src/can"]); ("src/lib/krobot", ["src/lib"])]; - lib_c = [("can", "src/can", [])]; + [ + ("src/lib/krobot", ["src/lib"]); + ("src/can/krobot-can-bus", ["src/can"]); + ("src/interfaces/krobot-interfaces", ["src/interfaces"]) + ]; + lib_c = [("krobot-can-bus", "src/can", [])]; flags = []; } ;; @@ -471,6 +475,12 @@ let () = match hook with | Before_options -> Options.make_links := false + + | After_rules -> + rule "D-Bus interface generation: .obus -> .ml, .mli" + ~dep:"%.obus" ~prods:["%.ml"; "%.mli"] + (fun env _ -> Cmd(S[A"obus-gen-interface"; A"-o"; A(env "%"); A(env "%.obus")])) + | _ -> ()) diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index 022aea8..2e91799 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,9 +1,9 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 1304b079e30d590a78f62965c8e260ab) *) +(* DO NOT EDIT (digest: 0dc16674bcb1ea7bbf1df154eca87808) *) (* - Regenerated by OASIS v0.2.0~alpha1 + Regenerated by OASIS v0.2.0 Visit http://oasis.forge.ocamlcore.org for more information and documentation about functions used in this file. *) @@ -5044,18 +5044,53 @@ let setup_t = [ Library ({ - cs_name = "can"; + cs_name = "krobot"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "src/can"; + bs_path = "src/lib"; bs_compiled_object = Best; bs_build_depends = [ FindlibPackage ("lwt.unix", None); + FindlibPackage ("lwt.syntax", None); + FindlibPackage ("obus", None); + FindlibPackage ("krobot.interfaces", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + { + lib_modules = ["Krobot_can"]; + lib_internal_modules = []; + lib_findlib_parent = None; + lib_findlib_name = Some "krobot"; + lib_findlib_containers = []; + }); + Library + ({ + cs_name = "krobot-can-bus"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "src/can"; + bs_compiled_object = Best; + bs_build_depends = + [ + InternalLibrary "krobot"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; @@ -5069,10 +5104,10 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { - lib_modules = ["CAN"]; + lib_modules = ["Krobot_can_bus"]; lib_internal_modules = []; lib_findlib_parent = Some "krobot"; - lib_findlib_name = Some "can"; + lib_findlib_name = Some "can-bus"; lib_findlib_containers = []; }); SrcRepo @@ -5119,20 +5154,16 @@ let setup_t = }); Library ({ - cs_name = "krobot"; + cs_name = "krobot-interfaces"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "src/lib"; + bs_path = "src/interfaces"; bs_compiled_object = Best; - bs_build_depends = - [ - FindlibPackage ("lwt.unix", None); - FindlibPackage ("lwt.syntax", None) - ]; + bs_build_depends = [FindlibPackage ("obus", None)]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; @@ -5144,10 +5175,10 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { - lib_modules = []; + lib_modules = ["Krobot_interface_can"]; lib_internal_modules = []; - lib_findlib_parent = None; - lib_findlib_name = Some "krobot"; + lib_findlib_parent = Some "krobot"; + lib_findlib_name = Some "can"; lib_findlib_containers = []; }); Executable @@ -5161,7 +5192,38 @@ let setup_t = bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; - bs_build_depends = [InternalLibrary "can"]; + bs_build_depends = + [ + InternalLibrary "krobot-can-bus"; + FindlibPackage ("lwt.syntax", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + {exec_custom = false; exec_main_is = "dump_can.ml"; }); + Executable + ({ + cs_name = "krobot-plot"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "tools"; + bs_compiled_object = Best; + bs_build_depends = + [ + InternalLibrary "krobot-can-bus"; + FindlibPackage ("lwt.syntax", None) + ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; @@ -5172,14 +5234,14 @@ let setup_t = bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, - {exec_custom = false; exec_main_is = "dump_can.ml"; }) + {exec_custom = false; exec_main_is = "krobot_plot.ml"; }) ]; plugins = [(`Extra, "DevFiles", Some "0.2"); (`Extra, "META", Some "0.2")]; schema_data = PropList.Data.create (); plugin_data = []; }; - version = "0.2.0~alpha1"; + version = "0.2.0"; };; let setup () = BaseSetup.setup setup_t;; diff --git a/info/control2011/src/can/CAN.ml b/info/control2011/src/can/CAN.ml deleted file mode 100644 index c2c34ee..0000000 --- a/info/control2011/src/can/CAN.ml +++ /dev/null @@ -1,99 +0,0 @@ -(* - * CAN.ml - * ------ - * Copyright : (c) 2011, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -open Lwt - -(* +-----------------------------------------------------------------+ - | Bus types | - +-----------------------------------------------------------------+ *) - -exception Closed - -class t fd = - let ic = Lwt_io.make ~mode:Lwt_io.input (Lwt_bytes.read fd) - and oc = Lwt_io.make ~mode:Lwt_io.output (Lwt_bytes.write fd) in -object - val mutable up = true - - method ic = - if up then ic else raise Closed - - method oc = - if up then oc else raise Closed - - method close = - if up then begin - up <- false; - lwt () = Lwt_io.close ic and () = Lwt_io.close oc in - Lwt_unix.close fd - end else - return () -end - -(* +-----------------------------------------------------------------+ - | Openning/closing | - +-----------------------------------------------------------------+ *) - -external open_can_file_descr : string -> Unix.file_descr = "ocaml_can_open_can_file_descr" - -let open_can iface = - let fd = open_can_file_descr iface in - return (new t (Lwt_unix.of_unix_file_descr fd)) - -let close bus = bus#close - -(* +-----------------------------------------------------------------+ - | Frames | - +-----------------------------------------------------------------+ *) - -exception Invalid_frame of string - -type frame_type = - | Type_data - | Type_error - -type frame_format = - | Format_11bits - | Format_29bits - -type frame = { - frame_identifier : int; - frame_type : frame_type; - frame_remote : bool; - frame_format : frame_format; - frame_data : string; -} - -external forge_frame : frame -> string = "ocaml_can_forge_frame" -external parse_frame : string -> frame = "ocaml_can_parse_frame" -external get_frame_size : unit -> int = "ocaml_can_get_frame_size" "noalloc" - -let frame_size = get_frame_size () - -let check_frame frame = - if String.length frame.frame_data > 8 then - raise (Invalid_frame "too much data"); - if frame.frame_identifier < 0 then - raise (Invalid_frame "identifier is negative"); - let max_id = - match frame.frame_format with - | Format_11bits -> 1 lsl 11 - 1 - | Format_29bits -> 1 lsl 29 - 1 - in - if frame.frame_identifier > max_id then - raise (Invalid_frame "identifier is too big") - -let send bus frame = - check_frame frame; - Lwt_io.write bus#oc (forge_frame frame) - -let recv bus = - let buffer = String.create frame_size in - lwt () = Lwt_io.read_into_exactly bus#ic buffer 0 frame_size in - return (parse_frame buffer) diff --git a/info/control2011/src/can/CAN.mli b/info/control2011/src/can/CAN.mli deleted file mode 100644 index 7b9a89e..0000000 --- a/info/control2011/src/can/CAN.mli +++ /dev/null @@ -1,60 +0,0 @@ -(* - * CAN.mli - * ------- - * Copyright : (c) 2011, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -(** Bus CAN *) - -type t - (** Type of a CAN bus. *) - -val open_can : string -> t Lwt.t - (** [open_can iface] opens the specified bus CAN. For example - [open_can "can0"]. *) - -val close : t -> unit Lwt.t - (** Closes the given bus CAN. *) - -exception Closed - (** Exception raised when trying to use a closed bus. *) - -exception Invalid_frame of string - (** Exception raised when trying to send an invalid frame. The - argument is an error message. *) - -(** Type of frame. *) -type frame_type = - | Type_data - (** The frame contains data. *) - | Type_error - (** The frame is an error frame. *) - -type frame_format = - | Format_11bits - (** The identifier is on 11 bits. *) - | Format_29bits - (** The identifier is on 29 bits. *) - -(** Type of CAN frames. *) -type frame = { - frame_identifier : int; - (** The CAN identifier. *) - frame_type : frame_type; - (** The type of the frame. *) - frame_remote : bool; - (** [true] iff this is aremote transmission request. *) - frame_format : frame_format; - (** The format of the frame. *) - frame_data : string; - (** The data of the frame. It is a array of [0..8] bytes. *) -} - -val send : t -> frame -> unit Lwt.t - (** [send bus frame] sends [frame] over [bus]. *) - -val recv : t -> frame Lwt.t - (** [recv bus] waits and reads one frame from the given bus. *) diff --git a/info/control2011/src/can/can.mllib b/info/control2011/src/can/can.mllib deleted file mode 100644 index e1902a2..0000000 --- a/info/control2011/src/can/can.mllib +++ /dev/null @@ -1,4 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: 6d5050f7a97e7e2e881a4e09dfbd6087) -CAN -# OASIS_STOP diff --git a/info/control2011/src/can/krobot-can-bus.mllib b/info/control2011/src/can/krobot-can-bus.mllib new file mode 100644 index 0000000..198bccd --- /dev/null +++ b/info/control2011/src/can/krobot-can-bus.mllib @@ -0,0 +1,4 @@ +# OASIS_START +# DO NOT EDIT (digest: 05e2413cff140c2f298af6bff05bd866) +Krobot_can_bus +# OASIS_STOP diff --git a/info/control2011/src/can/krobot_can_bus.ml b/info/control2011/src/can/krobot_can_bus.ml new file mode 100644 index 0000000..688fa3a --- /dev/null +++ b/info/control2011/src/can/krobot_can_bus.ml @@ -0,0 +1,67 @@ +(* + * krobot_can_bus.ml + * ----------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Lwt + +(* +-----------------------------------------------------------------+ + | Bus types | + +-----------------------------------------------------------------+ *) + +exception Closed + +class t fd = + let ic = Lwt_io.make ~mode:Lwt_io.input (Lwt_bytes.read fd) + and oc = Lwt_io.make ~mode:Lwt_io.output (Lwt_bytes.write fd) in +object + val mutable up = true + + method ic = + if up then ic else raise Closed + + method oc = + if up then oc else raise Closed + + method close = + if up then begin + up <- false; + lwt () = Lwt_io.close ic and () = Lwt_io.close oc in + Lwt_unix.close fd + end else + return () +end + +(* +-----------------------------------------------------------------+ + | Openning/closing | + +-----------------------------------------------------------------+ *) + +external open_can_file_descr : string -> Unix.file_descr = "ocaml_can_open_can_file_descr" + +let open_can iface = + let fd = open_can_file_descr iface in + return (new t (Lwt_unix.of_unix_file_descr fd)) + +let close bus = bus#close + +(* +-----------------------------------------------------------------+ + | Sending/receiving frames | + +-----------------------------------------------------------------+ *) + +external forge_frame : Krobot_can.frame -> string = "ocaml_can_forge_frame" +external parse_frame : string -> Krobot_can.frame = "ocaml_can_parse_frame" +external get_frame_size : unit -> int = "ocaml_can_get_frame_size" "noalloc" + +let frame_size = get_frame_size () + +let send bus frame = + Lwt_io.write bus#oc (forge_frame frame) + +let recv bus = + let buffer = String.create frame_size in + lwt () = Lwt_io.read_into_exactly bus#ic buffer 0 frame_size in + return (parse_frame buffer) diff --git a/info/control2011/src/can/krobot_can_bus.mli b/info/control2011/src/can/krobot_can_bus.mli new file mode 100644 index 0000000..c27199b --- /dev/null +++ b/info/control2011/src/can/krobot_can_bus.mli @@ -0,0 +1,29 @@ +(* + * krobot_can_bus.mli + * ------------------ + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** Bus CAN *) + +type t + (** Type of a CAN bus. *) + +val open_can : string -> t Lwt.t + (** [open_can iface] opens the specified bus CAN. For example + [open_can "can0"]. *) + +val close : t -> unit Lwt.t + (** Closes the given bus CAN. *) + +exception Closed + (** Exception raised when trying to use a closed bus. *) + +val send : t -> Krobot_can.frame -> unit Lwt.t + (** [send bus frame] sends [frame] over [bus]. *) + +val recv : t -> Krobot_can.frame Lwt.t + (** [recv bus] waits and reads one frame from the given bus. *) diff --git a/info/control2011/src/can/libcan.clib b/info/control2011/src/can/libcan.clib deleted file mode 100644 index 0c062e7..0000000 --- a/info/control2011/src/can/libcan.clib +++ /dev/null @@ -1,4 +0,0 @@ -# OASIS_START -# DO NOT EDIT (digest: c331c7eb709b41509f57de577257bebd) -can_stubs.o -# OASIS_STOP diff --git a/info/control2011/src/can/libkrobot-can-bus.clib b/info/control2011/src/can/libkrobot-can-bus.clib new file mode 100644 index 0000000..0c062e7 --- /dev/null +++ b/info/control2011/src/can/libkrobot-can-bus.clib @@ -0,0 +1,4 @@ +# OASIS_START +# DO NOT EDIT (digest: c331c7eb709b41509f57de577257bebd) +can_stubs.o +# OASIS_STOP diff --git a/info/control2011/src/interfaces/krobot-interfaces.mllib b/info/control2011/src/interfaces/krobot-interfaces.mllib new file mode 100644 index 0000000..d9a7ba4 --- /dev/null +++ b/info/control2011/src/interfaces/krobot-interfaces.mllib @@ -0,0 +1,4 @@ +# OASIS_START +# DO NOT EDIT (digest: 4c91fe13e6ec5025ba97566f5b8f3875) +Krobot_interface_can +# OASIS_STOP diff --git a/info/control2011/src/interfaces/krobot_interface_can.obus b/info/control2011/src/interfaces/krobot_interface_can.obus new file mode 100644 index 0000000..c12738e --- /dev/null +++ b/info/control2011/src/interfaces/krobot_interface_can.obus @@ -0,0 +1,22 @@ +(* + * krobot_interface_can.obus + * ------------------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** Interface for CAN messages *) +interface fr.krobot.CAN { + (** Signal for CAN frames: + + - when the driver receing a frame from the CAN socket, it send + this signal over D-Bus + - when the driver receive this signal it send it over the CAN + socket + *) + signal message : ( + frame : (uint32 * uint32 * boolean * uint32 * byte array) + ) +} diff --git a/info/control2011/src/lib/META b/info/control2011/src/lib/META index ab01985..dd5ae28 100644 --- a/info/control2011/src/lib/META +++ b/info/control2011/src/lib/META @@ -1,18 +1,27 @@ # OASIS_START -# DO NOT EDIT (digest: b8a3cf2aa3128061e6b14e115c71f269) +# DO NOT EDIT (digest: 0d94e89d9f084a95ee7ffaabb7600006) version = "1.0" description = "The [Kro]bot library" -requires = "lwt.unix" +requires = "lwt.unix obus krobot.interfaces" archive(byte) = "krobot.cma" archive(native) = "krobot.cmxa" exists_if = "krobot.cma" package "can" ( version = "1.0" + description = "[Kro]bot D-Bus interfaces" + requires = "obus" + archive(byte) = "krobot-interfaces.cma" + archive(native) = "krobot-interfaces.cmxa" + exists_if = "krobot-interfaces.cma" +) + +package "can-bus" ( + version = "1.0" description = "CAN interface using SocketCAN" - requires = "lwt.unix" - archive(byte) = "can.cma" - archive(native) = "can.cmxa" - exists_if = "can.cma" + requires = "krobot" + archive(byte) = "krobot-can-bus.cma" + archive(native) = "krobot-can-bus.cmxa" + exists_if = "krobot-can-bus.cma" ) # OASIS_STOP diff --git a/info/control2011/src/lib/krobot.mllib b/info/control2011/src/lib/krobot.mllib index c963e2c..c9dc889 100644 --- a/info/control2011/src/lib/krobot.mllib +++ b/info/control2011/src/lib/krobot.mllib @@ -1,3 +1,4 @@ # OASIS_START -# DO NOT EDIT (digest: d41d8cd98f00b204e9800998ecf8427e) +# DO NOT EDIT (digest: e8b05244aefe4716ab01c3db2a2ca413) +Krobot_can # OASIS_STOP diff --git a/info/control2011/src/lib/krobot_can.ml b/info/control2011/src/lib/krobot_can.ml new file mode 100644 index 0000000..ba50ba8 --- /dev/null +++ b/info/control2011/src/lib/krobot_can.ml @@ -0,0 +1,172 @@ +(* + * krobot_can.ml + * ------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* +-----------------------------------------------------------------+ + | CAN Frames | + +-----------------------------------------------------------------+ *) + +exception Invalid_frame of string + +type kind = + | Data + | Error + +type format = + | F11bits + | F29bits + +type frame = { + identifier : int; + kind : kind; + remote : bool; + format : format; + data : string; +} + +let identifier frame = frame.identifier +let kind frame = frame.kind +let remote frame = frame.remote +let format frame = frame.format +let data frame = frame.data + +let frame ~identifier ~kind ~remote ~format ~data = + if String.length data > 8 then + raise (Invalid_frame "too much data"); + if identifier < 0 then + raise (Invalid_frame "identifier is negative"); + let max_id = + match format with + | F11bits -> 1 lsl 11 - 1 + | F29bits -> 1 lsl 29 - 1 + in + if identifier > max_id then + raise (Invalid_frame "identifier is too big"); + { identifier; kind; remote; format; data } + +(* +-----------------------------------------------------------------+ + | Reading/writing numbers | + +-----------------------------------------------------------------+ *) + +let get_sint8 str ofs = + let v = Char.code str.[ofs] in + if v land 0x80 = 0 then + v + else + v - (1 lsl 8) + +let get_uint8 str ofs = + Char.code str.[ofs] + +let get_sint16 str ofs = + let v0 = Char.code str.[ofs + 0] + and v1 = Char.code str.[ofs + 1] in + let v = v0 lor (v1 lsl 8) in + if v1 land 0x80 = 0 then + v + else + v - (1 lsl 16) + +let get_uint16 str ofs = + let v0 = Char.code str.[ofs + 0] + and v1 = Char.code str.[ofs + 1] in + v0 lor (v1 lsl 8) + +let get_sint32 str ofs = + let v0 = Char.code str.[ofs + 0] + and v1 = Char.code str.[ofs + 1] + and v2 = Char.code str.[ofs + 2] + and v3 = Char.code str.[ofs + 3] in + let v = v0 lor (v1 lsl 8) lor (v2 lsl 16) lor (v3 lsl 24) in + if v3 land 0x80 = 0 then + v + else + v - (1 lsl 32) + +let get_uint32 str ofs = + let v0 = Char.code str.[ofs + 0] + and v1 = Char.code str.[ofs + 1] + and v2 = Char.code str.[ofs + 2] + and v3 = Char.code str.[ofs + 3] in + v0 lor (v1 lsl 8) lor (v2 lsl 16) lor (v3 lsl 24) + +let put_sint8 str ofs v = + str.[ofs] <- Char.unsafe_chr v + +let put_uint8 = put_sint8 + +let put_sint16 str ofs v = + str.[ofs + 0] <- Char.unsafe_chr v; + str.[ofs + 1] <- Char.unsafe_chr (v lsr 8) + +let put_uint16 = put_sint16 + +let put_sint32 str ofs v = + str.[ofs + 0] <- Char.unsafe_chr v; + str.[ofs + 1] <- Char.unsafe_chr (v lsr 8); + str.[ofs + 1] <- Char.unsafe_chr (v lsr 16); + str.[ofs + 1] <- Char.unsafe_chr (v lsr 24) + +let put_uint32 = put_sint32 + +(* +-----------------------------------------------------------------+ + | D-Bus value conversion | + +-----------------------------------------------------------------+ *) + +open OBus_value + +let typ = C.structure (C.seq5 C.basic_uint32 C.basic_uint32 C.basic_boolean C.basic_uint32 C.byte_array) + +let value_of_frame frame = + C.make_single + typ + (Int32.of_int frame.identifier, + (match frame.kind with + | Data -> 0l + | Error -> 1l), + frame.remote, + (match frame.format with + | F11bits -> 0l + | F29bits -> 1l), + frame.data) + +let frame_of_values (identifier, kind, remote, format, data) = + let identifier = Int32.to_int identifier in + let kind = + match kind with + | 0l -> Data + | 1l -> Error + | n -> Printf.ksprintf failwith "Krobot_can.frame_of_value: invalid frame kind (%ld)" n + in + let format = + match format with + | 0l -> F11bits + | 1l -> F29bits + | n -> Printf.ksprintf failwith "Krobot_can.frame_of_value: invalid frame format (%ld)" n + in + frame ~identifier ~kind ~remote ~format ~data + +let frame_of_value v = + frame_of_values (C.cast_single typ v) + +(* +-----------------------------------------------------------------+ + | Sending/receiving frames | + +-----------------------------------------------------------------+ *) + +let send bus frame = + OBus_connection.send_message + bus + (OBus_message.signal + ~path:["fr"; "krobot"; "CAN"] + ~interface:"fr.krobot.CAN" + ~member:"message" + [value_of_frame frame]) + +let frames bus = + let proxy = OBus_proxy.make (OBus_peer.anonymous bus) ["fr"; "krobot"; "CAN"] in + OBus_signal.map frame_of_values (OBus_signal.make Krobot_interface_can.Fr_krobot_CAN.s_message proxy) diff --git a/info/control2011/src/lib/krobot_can.mli b/info/control2011/src/lib/krobot_can.mli new file mode 100644 index 0000000..fee6dd7 --- /dev/null +++ b/info/control2011/src/lib/krobot_can.mli @@ -0,0 +1,100 @@ +(* + * krobot_can.mli + * -------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** CAN frames *) + +(** {6 CAN frames} *) + +exception Invalid_frame of string + (** Exception raised when trying to make an invalid frame. The + argument is an error message. Reasons why may not be valid are: + + - the identifier is too large for the frame format, + - there is more that 8 bytes of data. + *) + +(** Type of frame kinds. *) +type kind = + | Data + (** The frame contains data. *) + | Error + (** The frame is an error frame. *) + +(** Frame formats. *) +type format = + | F11bits + (** The identifier is on 11 bits. *) + | F29bits + (** The identifier is on 29 bits. *) + +(** Type of CAN frames. *) +type frame = private { + identifier : int; + (** The CAN identifier. *) + kind : kind; + (** The type of the frame. *) + remote : bool; + (** [true] iff this is aremote transmission request. *) + format : format; + (** The format of the frame. *) + data : string; + (** The data of the frame. It is a array of [0..8] bytes. *) +} + +val identifier : frame -> int +val kind : frame -> kind +val remote : frame -> bool +val format : frame -> format +val data : frame -> string + +val frame : + identifier : int -> + kind : kind -> + remote : bool -> + format : format -> + data : string -> frame + (** Create a frame. It raises {!Invalid_frame} if the frame is not + valid. *) + +(** {6 Reading/writing numbers} *) + +val get_sint8 : string -> int -> int +val get_uint8 : string -> int -> int + +val get_sint16 : string -> int -> int +val get_uint16 : string -> int -> int + +val get_sint32 : string -> int -> int +val get_uint32 : string -> int -> int + +val put_sint8 : string -> int -> int -> unit +val put_uint8 : string -> int -> int -> unit + +val put_sint16 : string -> int -> int -> unit +val put_uint16 : string -> int -> int -> unit + +val put_sint32 : string -> int -> int -> unit +val put_uint32 : string -> int -> int -> unit + +(** {6 D-Bus frame conversion} *) + +val value_of_frame : frame -> OBus_value.V.single + (** Converts a can frame into a D-Bus structure. *) + +val frame_of_value : OBus_value.V.single -> frame + (** Converts a D-Bus structure into a can frame. *) + +(** {6 Sending/receiving frames} *) + +val send : OBus_bus.t -> frame -> unit Lwt.t + (** [send bus frame] sends the given frame over D-Bus. *) + +val frames : OBus_bus.t -> frame OBus_signal.t + (** [frames bus] returns is the D-Bus signal which receive CAN + frames. *) diff --git a/info/control2011/tools/krobot_plot.ml b/info/control2011/tools/krobot_plot.ml new file mode 100644 index 0000000..0629f22 --- /dev/null +++ b/info/control2011/tools/krobot_plot.ml @@ -0,0 +1,62 @@ +(* + * krobot_plot.ml + * -------------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Lwt +open Krobot_can + +type data = { + coder_pos : int; + coder_dir : int; +} + +let decode_frame frame = + let data = Krobot_can.data frame in + ({ coder_pos = get_uint16 data 0; + coder_dir = get_uint8 data 4 }, + { coder_pos = get_uint16 data 2; + coder_dir = get_uint8 data 5 }) + +let rec loop bus oc = + let time = Unix.gettimeofday () in + lwt coder1, coder2 = Krobot_can_bus.recv bus >|= decode_frame in + lwt coder3, coder4 = Krobot_can_bus.recv bus >|= decode_frame in + lwt () = + Lwt_io.fprintlf oc + "%f %d %d %d %d %d %d %d %d" + time + coder1.coder_pos coder1.coder_dir + coder2.coder_pos coder2.coder_dir + coder3.coder_pos coder3.coder_dir + coder4.coder_pos coder4.coder_dir + in + lwt () = + Lwt_io.printlf "time: %f + coder1: pos = %d, dir = %d + coder2: pos = %d, dir = %d + coder3: pos = %d, dir = %d + coder4: pos = %d, dir = %d +" + time + coder1.coder_pos coder1.coder_dir + coder2.coder_pos coder2.coder_dir + coder3.coder_pos coder3.coder_dir + coder4.coder_pos coder4.coder_dir + in + loop bus oc + +lwt () = + if Array.length Sys.argv <> 2 then begin + print_endline "usage: krobot-plot <interface>"; + exit 2; + end; + try_lwt + lwt bus = Krobot_can_bus.open_can Sys.argv.(1) and oc = Lwt_io.open_file ~mode:Lwt_io.output "data" in + loop bus oc + with Unix.Unix_error(error, func, arg) -> + Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) hooks/post-receive -- krobot |
From: Olivier B. <Ba...@us...> - 2011-03-12 19:25:51
|
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 b43cd31f49a7d41d1337700bffa8202a984b6418 (commit) from 9a5999ae2db16bfe97f00600f8005e14386ab916 (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 b43cd31f49a7d41d1337700bffa8202a984b6418 Author: Olivier BICHLER <oli...@gm...> Date: Sat Mar 12 20:25:08 2011 +0100 [Monitoring_4Cells] Working test firmware & board! ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk index b92ba07..92bf9fc 100644 --- a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk @@ -10,6 +10,7 @@ Firmware_Test_PROGRAMMER_PORT = none # Files included by the user. Firmware_Test_USER_CSRC = \ $(Firmware_Test_SRC_PATH)/main.c \ + $(Firmware_Test_SRC_PATH)/ads7828.c \ # # Files included by the user. diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.c b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.c new file mode 100644 index 0000000..031ff29 --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.c @@ -0,0 +1,25 @@ +/* + * Wrapper to use the ADS7828 analog to digital converter + * Olivier Bichler + */ + +#include "ads7828.h" + +unsigned int adc7828_measure(I2c* i2c, unsigned char addr, unsigned char ch) { + unsigned char value[2] = {0}; + unsigned char cmd = ADS7828_CMD_PD0 + | ADS7828_CMD_PD1 + | ((ch/2) << 4) + | ADS7828_CMD_SD; + + if (ch % 2) + cmd|= ADS7828_CMD_C2; + + i2c_start_w(i2c, addr, 1, I2C_STOP); + i2c_write(i2c, &cmd, 1); + i2c_start_r(i2c, addr, 2, I2C_STOP); + i2c_read(i2c, &value, 2); + + return ((value[0] << 8) | value[1]); +} + diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h index ade1632..5622fa8 100644 --- a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h @@ -23,7 +23,7 @@ #include <drv/i2c.h> - +unsigned int adc7828_measure(I2c* i2c, unsigned char addr, unsigned char ch); #endif diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/main.c b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/main.c index 91fcbec..036e4c2 100644 --- a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/main.c +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/main.c @@ -89,8 +89,7 @@ static void NORETURN led_process(void) int main(void) { I2c ctx; - unsigned int cmd = ADS7828_CMD_PD0 | ADS7828_CMD_PD1 | ADS7828_CMD_SD; - unsigned int value; + int ch, value; /* Hardware initialization */ init(); @@ -107,16 +106,14 @@ int main(void) while (1) { //monitor_report(); - //timer_delay(1000); - timer_delay(100); + timer_delay(1000); + + for (ch = 0; ch < 8; ++ch) { + value = adc7828_measure(&ctx, ADS7828_ADDR_BASE, ch); + kprintf("CH%d: %.2f V (%d)\n", ch, 2.0*value*ADS7828_LSB, value); + } - value = 0; - i2c_start_w(&ctx, ADS7828_ADDR_BASE, 1, I2C_STOP); - i2c_write(&ctx, &cmd, 1); - i2c_start_r(&ctx, ADS7828_ADDR_BASE, 2, I2C_STOP); - i2c_read(&ctx, &value, 2); - //kprintf("%d mV\n", (int) (value*ADS7828_LSB*1000.0)); - kprintf("%d\n", value); + kprintf("-----------\n"); } } hooks/post-receive -- krobot |
From: Olivier B. <Ba...@us...> - 2011-03-12 16:45:34
|
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 9a5999ae2db16bfe97f00600f8005e14386ab916 (commit) from 49ce86ef538251858fbd784a4612a6c3943db1d5 (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 9a5999ae2db16bfe97f00600f8005e14386ab916 Author: Olivier BICHLER <oli...@gm...> Date: Sat Mar 12 17:44:38 2011 +0100 [Monitoring_4Cells] Added a test firmware ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test.project b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test.project new file mode 100644 index 0000000..b161883 --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test.project @@ -0,0 +1,1211 @@ +<?xml version="1.0" encoding="utf-8"?> +<CodeLite_Project Name="Firmware_Test" InternalType=""> +<File Name="Makefile"/> +<VirtualDirectory Name="bertos"> +<File Name="bertos/verstag.h"/> +<File Name="bertos/config.mk"/> +<File Name="bertos/rules.mk"/> +<File Name="bertos/verstag.c"/> +<VirtualDirectory Name="icons"> +<File Name="bertos/icons/logo.h"/> +<File Name="bertos/icons/Makefile"/> +<File Name="bertos/icons/logo.c"/> +<File Name="bertos/icons/flipimage.cpp"/> +</VirtualDirectory> +<VirtualDirectory Name="gfx"> +<File Name="bertos/gfx/text_format.c"/> +<File Name="bertos/gfx/font.h"/> +<File Name="bertos/gfx/charts.c"/> +<File Name="bertos/gfx/gfx_p.h"/> +<File Name="bertos/gfx/charts.h"/> +<File Name="bertos/gfx/win.c"/> +<File Name="bertos/gfx/win.h"/> +<File Name="bertos/gfx/fillpoly.cpp"/> +<File Name="bertos/gfx/gfx.h"/> +<File Name="bertos/gfx/font_10x20.c"/> +<File Name="bertos/gfx/text.h"/> +<File Name="bertos/gfx/bitmap.c"/> +<File Name="bertos/gfx/text.c"/> +<File Name="bertos/gfx/line.c"/> +</VirtualDirectory> +<VirtualDirectory Name="drv"> +<File Name="bertos/drv/ser.h"/> +<File Name="bertos/drv/kdebug.c"/> +<File Name="bertos/drv/adc.h"/> +<File Name="bertos/drv/lcd_ili9225.c"/> +<File Name="bertos/drv/thermo.h"/> +<File Name="bertos/drv/i2c.h"/> +<File Name="bertos/drv/ntc.c"/> +<File Name="bertos/drv/lcd_text.c"/> +<File Name="bertos/drv/sd.c"/> +<File Name="bertos/drv/lm75.h"/> +<File Name="bertos/drv/lcd_lm44_qt.h"/> +<File Name="bertos/drv/usbkbd.c"/> +<File Name="bertos/drv/flash.h"/> +<File Name="bertos/drv/usb.h"/> +<File Name="bertos/drv/lcd_hd44.c"/> +<File Name="bertos/drv/ser.c"/> +<File Name="bertos/drv/lcd_text.h"/> +<File Name="bertos/drv/tas5706a.h"/> +<File Name="bertos/drv/sd.h"/> +<File Name="bertos/drv/lm75.c"/> +<File Name="bertos/drv/lcd_gfx_qt.h"/> +<File Name="bertos/drv/dc_motor.h"/> +<File Name="bertos/drv/sipo.c"/> +<File Name="bertos/drv/lcd_ili9225.h"/> +<File Name="bertos/drv/ntc.h"/> +<File Name="bertos/drv/phase.h"/> +<File Name="bertos/drv/ft245rl.c"/> +<File Name="bertos/drv/pwm.h"/> +<File Name="bertos/drv/mcp41.h"/> +<File Name="bertos/drv/usbkbd.h"/> +<File Name="bertos/drv/buzzerled.c"/> +<File Name="bertos/drv/phase.c"/> +<File Name="bertos/drv/tlv5618.c"/> +<File Name="bertos/drv/tas5706a.c"/> +<File Name="bertos/drv/lcd_gfx_hwtest.c"/> +<File Name="bertos/drv/mcp41.c"/> +<File Name="bertos/drv/kbd.c"/> +<File Name="bertos/drv/i2c.c"/> +<File Name="bertos/drv/tlv5618.h"/> +<File Name="bertos/drv/timer.c"/> +<File Name="bertos/drv/dataflash.c"/> +<File Name="bertos/drv/usbmouse.h"/> +<File Name="bertos/drv/tc520.h"/> +<File Name="bertos/drv/flash25.h"/> +<File Name="bertos/drv/kbd.h"/> +<File Name="bertos/drv/buzzer.c"/> +<File Name="bertos/drv/tc520.c"/> +<File Name="bertos/drv/pwm.c"/> +<File Name="bertos/drv/lcd_hx8347.h"/> +<File Name="bertos/drv/usbser.c"/> +<File Name="bertos/drv/eeprom.h"/> +<File Name="bertos/drv/sipo.h"/> +<File Name="bertos/drv/tmp123.c"/> +<File Name="bertos/drv/dc_motor.c"/> +<File Name="bertos/drv/usb_endpoint.h"/> +<File Name="bertos/drv/lcd_text_hwtest.c"/> +<File Name="bertos/drv/eeprom.c"/> +<File Name="bertos/drv/lcd_rit128x96.h"/> +<File Name="bertos/drv/dc_motor_hwtest.c"/> +<File Name="bertos/drv/timer.h"/> +<File Name="bertos/drv/lcd_gfx_qt.cpp"/> +<File Name="bertos/drv/lcd_hd44_hwtest.c"/> +<File Name="bertos/drv/flash25.c"/> +<File Name="bertos/drv/adc.c"/> +<File Name="bertos/drv/i2c_bitbang.c"/> +<File Name="bertos/drv/dataflash.h"/> +<File Name="bertos/drv/buzzer.h"/> +<File Name="bertos/drv/lcd_hx8347.c"/> +<File Name="bertos/drv/lcd_rit128x96.c"/> +<File Name="bertos/drv/pwm_hwtest.c"/> +<File Name="bertos/drv/pcf8574.c"/> +<File Name="bertos/drv/rtc.h"/> +<File Name="bertos/drv/ft245rl.h"/> +<File Name="bertos/drv/spi_bitbang.h"/> +<File Name="bertos/drv/stepper.c"/> +<File Name="bertos/drv/flash25_hwtest.c"/> +<File Name="bertos/drv/lcd_32122a.c"/> +<File Name="bertos/drv/ser_p.h"/> +<File Name="bertos/drv/lcd_hd44.h"/> +<File Name="bertos/drv/usbmouse.c"/> +<File Name="bertos/drv/timer_test.c"/> +<File Name="bertos/drv/wdt.h"/> +<File Name="bertos/drv/mpxx6115a.h"/> +<File Name="bertos/drv/usb_hid.h"/> +<File Name="bertos/drv/thermo.c"/> +<File Name="bertos/drv/buzzerled.h"/> +<File Name="bertos/drv/spi_bitbang.c"/> +<File Name="bertos/drv/eth.h"/> +<File Name="bertos/drv/stepper.h"/> +<File Name="bertos/drv/dataflash_hwtest.c"/> +<File Name="bertos/drv/lcd_lm44_qt.cpp"/> +<File Name="bertos/drv/tmp123.h"/> +<File Name="bertos/drv/usbser.h"/> +<File Name="bertos/drv/pcf8574.h"/> +<File Name="bertos/drv/lcd_32122a.h"/> +</VirtualDirectory> +<VirtualDirectory Name="kern"> +<File Name="bertos/kern/signal.c"/> +<File Name="bertos/kern/msg.h"/> +<File Name="bertos/kern/proc.c"/> +<File Name="bertos/kern/sem_test.c"/> +<File Name="bertos/kern/coop.c"/> +<File Name="bertos/kern/irq.c"/> +<File Name="bertos/kern/sem.c"/> +<File Name="bertos/kern/sem.h"/> +<File Name="bertos/kern/msg_test.c"/> +<File Name="bertos/kern/proc.h"/> +<File Name="bertos/kern/preempt.c"/> +<File Name="bertos/kern/monitor.h"/> +<File Name="bertos/kern/kfile.h"/> +<File Name="bertos/kern/signal_test.c"/> +<File Name="bertos/kern/signal.h"/> +<File Name="bertos/kern/proc_test.c"/> +<File Name="bertos/kern/irq.h"/> +<File Name="bertos/kern/proc_p.h"/> +<File Name="bertos/kern/monitor.c"/> +<VirtualDirectory Name="proc_test"> +<File Name="bertos/kern/proc_test/preempt_msg_test.c"/> +<File Name="bertos/kern/proc_test/preempt_heap_test.c"/> +<File Name="bertos/kern/proc_test/coop_pri_heap_test.c"/> +<File Name="bertos/kern/proc_test/coop_signal_test.c"/> +<File Name="bertos/kern/proc_test/coop_sem_test.c"/> +<File Name="bertos/kern/proc_test/preempt_signal_test.c"/> +<File Name="bertos/kern/proc_test/coop_msg_test.c"/> +<File Name="bertos/kern/proc_test/coop_heap_test.c"/> +<File Name="bertos/kern/proc_test/preempt_sem_test.c"/> +<File Name="bertos/kern/proc_test/preempt_test.c"/> +<File Name="bertos/kern/proc_test/coop_pri_test.c"/> +<File Name="bertos/kern/proc_test/preempt_pri_test.c"/> +<File Name="bertos/kern/proc_test/preempt_pri_heap_test.c"/> +<File Name="bertos/kern/proc_test/coop_test.c"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="emul"> +<File Name="bertos/emul/kfile_posix.c"/> +<File Name="bertos/emul/switch_i386.S"/> +<File Name="bertos/emul/emul.h"/> +<File Name="bertos/emul/emulwin.h"/> +<File Name="bertos/emul/timer_qt.h"/> +<File Name="bertos/emul/switch_ppc.S"/> +<File Name="bertos/emul/kfile_posix.h"/> +<File Name="bertos/emul/diskio_emul.c"/> +<File Name="bertos/emul/switch.S"/> +<File Name="bertos/emul/emul.mk"/> +<File Name="bertos/emul/timer_posix.h"/> +<File Name="bertos/emul/timer_posix.c"/> +<File Name="bertos/emul/emulkbd.cpp"/> +<File Name="bertos/emul/emul.cpp"/> +<File Name="bertos/emul/timer_qt.c"/> +<File Name="bertos/emul/ser_posix.c"/> +<File Name="bertos/emul/emulkbd.h"/> +<File Name="bertos/emul/emulwin.cpp"/> +<File Name="bertos/emul/switch_ctx_emul.S"/> +</VirtualDirectory> +<VirtualDirectory Name="mware"> +<File Name="bertos/mware/resource.c"/> +<File Name="bertos/mware/observer.h"/> +<File Name="bertos/mware/hex.c"/> +<File Name="bertos/mware/blanker.h"/> +<File Name="bertos/mware/strtol10.c"/> +<File Name="bertos/mware/observer.c"/> +<File Name="bertos/mware/byteorder.h"/> +<File Name="bertos/mware/rle.h"/> +<File Name="bertos/mware/formatwr.c"/> +<File Name="bertos/mware/pgm.h"/> +<File Name="bertos/mware/strtol10.h"/> +<File Name="bertos/mware/readline.c"/> +<File Name="bertos/mware/event.c"/> +<File Name="bertos/mware/messages.c"/> +<File Name="bertos/mware/sprintf_test.c"/> +<File Name="bertos/mware/parser.c"/> +<File Name="bertos/mware/sprintf.c"/> +<File Name="bertos/mware/ini_reader.h"/> +<File Name="bertos/mware/parser.h"/> +<File Name="bertos/mware/readline.h"/> +<File Name="bertos/mware/blanker.c"/> +<File Name="bertos/mware/formatwr.h"/> +<File Name="bertos/mware/hex.h"/> +<File Name="bertos/mware/messages.h"/> +<File Name="bertos/mware/resource.h"/> +<File Name="bertos/mware/cmd_hunk.h"/> +<File Name="bertos/mware/ini_reader_test.c"/> +<File Name="bertos/mware/except.h"/> +<File Name="bertos/mware/ini_reader.c"/> +<File Name="bertos/mware/event.h"/> +</VirtualDirectory> +<VirtualDirectory Name="sec"> +<File Name="bertos/sec/random_p.h"/> +<File Name="bertos/sec/random.c"/> +<File Name="bertos/sec/benchmarks.c"/> +<File Name="bertos/sec/cipher.h"/> +<File Name="bertos/sec/cipher.c"/> +<File Name="bertos/sec/hash.h"/> +<File Name="bertos/sec/kdf.h"/> +<File Name="bertos/sec/entropy.h"/> +<File Name="bertos/sec/prng.h"/> +<File Name="bertos/sec/random.h"/> +<File Name="bertos/sec/mac.h"/> +<File Name="bertos/sec/util.c"/> +<File Name="bertos/sec/benchmarks.h"/> +<File Name="bertos/sec/util.h"/> +<VirtualDirectory Name="prng"> +<File Name="bertos/sec/prng/x917.h"/> +<File Name="bertos/sec/prng/x917.c"/> +<File Name="bertos/sec/prng/yarrow.h"/> +<File Name="bertos/sec/prng/isaac.c"/> +<File Name="bertos/sec/prng/yarrow.c"/> +<File Name="bertos/sec/prng/isaac.h"/> +</VirtualDirectory> +<VirtualDirectory Name="cipher"> +<File Name="bertos/sec/cipher/aes.h"/> +<File Name="bertos/sec/cipher/aes_f32.h"/> +<File Name="bertos/sec/cipher/aes.c"/> +<File Name="bertos/sec/cipher/blowfish.c"/> +<File Name="bertos/sec/cipher/blowfish_test.c"/> +<File Name="bertos/sec/cipher/aes_test.c"/> +<File Name="bertos/sec/cipher/aes_f8.h"/> +<File Name="bertos/sec/cipher/blowfish.h"/> +</VirtualDirectory> +<VirtualDirectory Name="mac"> +<File Name="bertos/sec/mac/omac.h"/> +<File Name="bertos/sec/mac/omac.c"/> +<File Name="bertos/sec/mac/omac_test.c"/> +<File Name="bertos/sec/mac/hmac.h"/> +<File Name="bertos/sec/mac/hmac_test.c"/> +<File Name="bertos/sec/mac/hmac.c"/> +</VirtualDirectory> +<VirtualDirectory Name="entropy"> +<File Name="bertos/sec/entropy/yarrow_pool.c"/> +<File Name="bertos/sec/entropy/yarrow_pool.h"/> +</VirtualDirectory> +<VirtualDirectory Name="hash"> +<File Name="bertos/sec/hash/sha1.h"/> +<File Name="bertos/sec/hash/ripemd_test.c"/> +<File Name="bertos/sec/hash/md5_test.c"/> +<File Name="bertos/sec/hash/sha1.c"/> +<File Name="bertos/sec/hash/ripemd.h"/> +<File Name="bertos/sec/hash/ripemd.c"/> +<File Name="bertos/sec/hash/md5.c"/> +<File Name="bertos/sec/hash/sha1_test.c"/> +<File Name="bertos/sec/hash/md5.h"/> +</VirtualDirectory> +<VirtualDirectory Name="kdf"> +<File Name="bertos/sec/kdf/pbkdf1_test.c"/> +<File Name="bertos/sec/kdf/pbkdf2.c"/> +<File Name="bertos/sec/kdf/pbkdf1.h"/> +<File Name="bertos/sec/kdf/pbkdf2.h"/> +<File Name="bertos/sec/kdf/pbkdf1.c"/> +<File Name="bertos/sec/kdf/pbkdf2_test.c"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="io"> +<File Name="bertos/io/kfile_block.c"/> +<File Name="bertos/io/kblock_ram.h"/> +<File Name="bertos/io/kblock_ram.c"/> +<File Name="bertos/io/kfile.h"/> +<File Name="bertos/io/kblock_posix.c"/> +<File Name="bertos/io/kfile_block.h"/> +<File Name="bertos/io/kfile.c"/> +<File Name="bertos/io/kblock.c"/> +<File Name="bertos/io/kblock_posix.h"/> +<File Name="bertos/io/kblock.h"/> +<File Name="bertos/io/kfile_test.c"/> +</VirtualDirectory> +<VirtualDirectory Name="cfg"> +<File Name="bertos/cfg/depend.h"/> +<File Name="bertos/cfg/cfg_timer.h"/> +<File Name="bertos/cfg/cfg_boot.h"/> +<File Name="bertos/cfg/cfg_stepper.h"/> +<File Name="bertos/cfg/cfg_attr.h"/> +<File Name="bertos/cfg/cfg_randpool.h"/> +<File Name="bertos/cfg/cfg_ser.h"/> +<File Name="bertos/cfg/cfg_flash25.h"/> +<File Name="bertos/cfg/cfg_i2c.h"/> +<File Name="bertos/cfg/cfg_adc.h"/> +<File Name="bertos/cfg/cfg_lcd_32122a.h"/> +<File Name="bertos/cfg/cfg_usbmouse.h"/> +<File Name="bertos/cfg/cfg_keytag.h"/> +<File Name="bertos/cfg/cfg_eeprom.h"/> +<File Name="bertos/cfg/cfg_i2s.h"/> +<File Name="bertos/cfg/cfg_tas5706a.h"/> +<File Name="bertos/cfg/debug.h"/> +<File Name="bertos/cfg/cfg_hashtable.h"/> +<File Name="bertos/cfg/cfg_usbser.h"/> +<File Name="bertos/cfg/cfg_spi_bitbang.h"/> +<File Name="bertos/cfg/cfg_pocketbus.h"/> +<File Name="bertos/cfg/compiler.h"/> +<File Name="bertos/cfg/module.h"/> +<File Name="bertos/cfg/cfg_ramp.h"/> +<File Name="bertos/cfg/cfg_lm75.h"/> +<File Name="bertos/cfg/cfg_ini_reader.h"/> +<File Name="bertos/cfg/cfg_lwip.h"/> +<File Name="bertos/cfg/cfg_battfs.h"/> +<File Name="bertos/cfg/cfg_menu.h"/> +<File Name="bertos/cfg/cfg_kern.h"/> +<File Name="bertos/cfg/cfg_ax25.h"/> +<File Name="bertos/cfg/cfg_afsk.h"/> +<File Name="bertos/cfg/cfg_parser.h"/> +<File Name="bertos/cfg/cfg_proc.h"/> +<File Name="bertos/cfg/cfg_phase.h"/> +<File Name="bertos/cfg/cfg_formatwr.h"/> +<File Name="bertos/cfg/cfg_signal.h"/> +<File Name="bertos/cfg/cfg_lcd_hd44.h"/> +<File Name="bertos/cfg/cfg_wdt.h"/> +<File Name="bertos/cfg/cfg_spi_dma.h"/> +<File Name="bertos/cfg/cfg_eth.h"/> +<File Name="bertos/cfg/macros.h"/> +<File Name="bertos/cfg/cfg_buzzerled.h"/> +<File Name="bertos/cfg/cfg_thermo.h"/> +<File Name="bertos/cfg/cfg_dataflash.h"/> +<File Name="bertos/cfg/cfg_random.h"/> +<File Name="bertos/cfg/cfg_tftp.h"/> +<File Name="bertos/cfg/cfg_ntc.h"/> +<File Name="bertos/cfg/cfg_dc_motor.h"/> +<File Name="bertos/cfg/cfg_pid.h"/> +<File Name="bertos/cfg/kfile_debug.h"/> +<File Name="bertos/cfg/cfg_heap.h"/> +<File Name="bertos/cfg/cfg_sd.h"/> +<File Name="bertos/cfg/cfg_usbkbd.h"/> +<File Name="bertos/cfg/cfg_emb_flash.h"/> +<File Name="bertos/cfg/cfg_monitor.h"/> +<File Name="bertos/cfg/cfg_pwm.h"/> +<File Name="bertos/cfg/cfg_debug.h"/> +<File Name="bertos/cfg/test.h"/> +<File Name="bertos/cfg/cfg_usb.h"/> +<File Name="bertos/cfg/kfile_debug.c"/> +<File Name="bertos/cfg/cfg_xmodem.h"/> +<File Name="bertos/cfg/cfg_md2.h"/> +<File Name="bertos/cfg/cfg_context_switch.h"/> +<File Name="bertos/cfg/cfg_gfx.h"/> +<File Name="bertos/cfg/cfg_fat.h"/> +<File Name="bertos/cfg/os.h"/> +<File Name="bertos/cfg/cfg_kfile.h"/> +<File Name="bertos/cfg/cfg_kbd.h"/> +<File Name="bertos/cfg/cfg_sem.h"/> +<File Name="bertos/cfg/cfg_nmea.h"/> +<File Name="bertos/cfg/log.h"/> +<File Name="bertos/cfg/cfg_arch.h"/> +</VirtualDirectory> +<VirtualDirectory Name="cpu"> +<File Name="bertos/cpu/attr.h"/> +<File Name="bertos/cpu/frame.h"/> +<File Name="bertos/cpu/byteorder.h"/> +<File Name="bertos/cpu/pgm.h"/> +<File Name="bertos/cpu/types.h"/> +<File Name="bertos/cpu/byteorder_test.c"/> +<File Name="bertos/cpu/detect.h"/> +<File Name="bertos/cpu/power.h"/> +<File Name="bertos/cpu/irq.h"/> +<VirtualDirectory Name="i196"> +<VirtualDirectory Name="drv"> +<File Name="bertos/cpu/i196/drv/kdebug_i196.c"/> +<File Name="bertos/cpu/i196/drv/ser_i196.c"/> +<File Name="bertos/cpu/i196/drv/timer_i196.h"/> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="dsp56k"> +<VirtualDirectory Name="drv"> +<File Name="bertos/cpu/dsp56k/drv/ser_dsp56k.h"/> +<File Name="bertos/cpu/dsp56k/drv/kdebug_dsp56k.c"/> +<File Name="bertos/cpu/dsp56k/drv/buzzerled_dsp56k.h"/> +<File Name="bertos/cpu/dsp56k/drv/ser_dsp56k.c"/> +<File Name="bertos/cpu/dsp56k/drv/timer_dsp56k.h"/> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +<File Name="bertos/cpu/dsp56k/hw/switch_dsp56k.c"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="cortex-m3"> +<VirtualDirectory Name="scripts"> +<File Name="bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/cortex-m3_ram.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/stm32f101c4_ram.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/sam3n4_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/lm3s8962_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/stm32f103re_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/sam3n4_ram.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/cortex-m3_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/lm3s1968_ram.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/sam3x8_rom.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/lm3s8962_ram.ld"/> +<File Name="bertos/cpu/cortex-m3/scripts/stm32f101c4_rom.ld"/> +</VirtualDirectory> +<VirtualDirectory Name="drv"> +<File Name="bertos/cpu/cortex-m3/drv/adc_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/adc_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/gpio_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/adc_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/ssi_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/kdebug_sam3.c"/> +<File Name="bertos/cpu/cortex-m3/drv/timer_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/flash_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/i2c_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/gpio_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/random_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/i2c_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/i2c_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/ssi_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/timer_cm3.c"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/adc_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/flash_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/gpio_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/flash_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/adc_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/kdebug_cm3.c"/> +<File Name="bertos/cpu/cortex-m3/drv/kdebug_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/gpio_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/i2c_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/kdebug_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/irq_cm3.c"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/kdebug_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/random_lm3s.c"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_sam3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/kdebug_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_sam3.c"/> +<File Name="bertos/cpu/cortex-m3/drv/usb_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/flash_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/i2c_stm32.h"/> +<File Name="bertos/cpu/cortex-m3/drv/usb_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_sam3.c"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/rtc_stm32.c"/> +<File Name="bertos/cpu/cortex-m3/drv/flash_lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/drv/ser_sam3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/irq_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/drv/clock_stm32.h"/> +</VirtualDirectory> +<VirtualDirectory Name="io"> +<File Name="bertos/cpu/cortex-m3/io/stm32_ints.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_flash.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_wdt.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_sysctl.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_nvic.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_gpio.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_pwr.h"/> +<File Name="bertos/cpu/cortex-m3/io/cm3.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_memmap.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_nvic.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_adc.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_memmap.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_ints.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_uart.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_i2c.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_nvic.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_flash.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3n.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_gpio.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_spi.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_smc.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_pmc.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_usart.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_ssi.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_types.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_adc.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_pwm.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_sysctl.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_com.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_uart.h"/> +<File Name="bertos/cpu/cortex-m3/io/sam3_pio.h"/> +<File Name="bertos/cpu/cortex-m3/io/lm3s_ints.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_uart.h"/> +<File Name="bertos/cpu/cortex-m3/io/stm32_i2c.h"/> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +<File Name="bertos/cpu/cortex-m3/hw/switch_ctx_cm3.c"/> +<File Name="bertos/cpu/cortex-m3/hw/init_cm3.c"/> +<File Name="bertos/cpu/cortex-m3/hw/crt_cm3.S"/> +<File Name="bertos/cpu/cortex-m3/hw/switch_ctx_cm3.h"/> +<File Name="bertos/cpu/cortex-m3/hw/vectors_cm3.S"/> +</VirtualDirectory> +<VirtualDirectory Name="info"> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="msp430"> +<VirtualDirectory Name="drv"> +<File Name="bertos/cpu/msp430/drv/kdebug_msp430.c"/> +<File Name="bertos/cpu/msp430/drv/kdebug_msp430.h"/> +</VirtualDirectory> +<VirtualDirectory Name="info"> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="arm"> +<VirtualDirectory Name="scripts"> +<File Name="bertos/cpu/arm/scripts/at91sam7_512_rom.ld"/> +<File Name="bertos/cpu/arm/scripts/arm7tdmi_ram.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_128_ram.ld"/> +<File Name="bertos/cpu/arm/scripts/lpc2378.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_256_ram.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_512_ram.ld"/> +<File Name="bertos/cpu/arm/scripts/arm7tdmi_rom.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_64_rom.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_64_ram.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_256_rom.ld"/> +<File Name="bertos/cpu/arm/scripts/at91sam7_128_rom.ld"/> +</VirtualDirectory> +<VirtualDirectory Name="drv"> +<File Name="bertos/cpu/arm/drv/ser_at91.h"/> +<File Name="bertos/cpu/arm/drv/kdebug_lpc2.c"/> +<File Name="bertos/cpu/arm/drv/ser_at91.c"/> +<File Name="bertos/cpu/arm/drv/stepper_at91.h"/> +<File Name="bertos/cpu/arm/drv/ser_lpc2.c"/> +<File Name="bertos/cpu/arm/drv/kdebug_arm.c"/> +<File Name="bertos/cpu/arm/drv/i2s_at91.h"/> +<File Name="bertos/cpu/arm/drv/pwm_at91.c"/> +<File Name="bertos/cpu/arm/drv/timer_at91.c"/> +<File Name="bertos/cpu/arm/drv/flash_arm.h"/> +<File Name="bertos/cpu/arm/drv/flash_at91.h"/> +<File Name="bertos/cpu/arm/drv/wdt_arm.h"/> +<File Name="bertos/cpu/arm/drv/kdebug_at91.h"/> +<File Name="bertos/cpu/arm/drv/timer_arm.h"/> +<File Name="bertos/cpu/arm/drv/ser_lpc2.h"/> +<File Name="bertos/cpu/arm/drv/timer_at91.h"/> +<File Name="bertos/cpu/arm/drv/adc_at91.c"/> +<File Name="bertos/cpu/arm/drv/i2c_lpc2.c"/> +<File Name="bertos/cpu/arm/drv/sysirq_at91.c"/> +<File Name="bertos/cpu/arm/drv/stepper_arm.c"/> +<File Name="bertos/cpu/arm/drv/ser_arm.c"/> +<File Name="bertos/cpu/arm/drv/adc_arm.h"/> +<File Name="bertos/cpu/arm/drv/i2c_at91.h"/> +<File Name="bertos/cpu/arm/drv/adc_at91.h"/> +<File Name="bertos/cpu/arm/drv/timer_arm.c"/> +<File Name="bertos/cpu/arm/drv/i2c_lpc2.h"/> +<File Name="bertos/cpu/arm/drv/kdebug_at91.c"/> +<File Name="bertos/cpu/arm/drv/spi_dma_at91.h"/> +<File Name="bertos/cpu/arm/drv/eth_at91.h"/> +<File Name="bertos/cpu/arm/drv/timer_lpc2.h"/> +<File Name="bertos/cpu/arm/drv/adc_arm.c"/> +<File Name="bertos/cpu/arm/drv/stepper_at91_hwtest.c"/> +<File Name="bertos/cpu/arm/drv/pwm_at91.h"/> +<File Name="bertos/cpu/arm/drv/flash_lpc2.c"/> +<File Name="bertos/cpu/arm/drv/twi_arm.c"/> +<File Name="bertos/cpu/arm/drv/twi_at91.c"/> +<File Name="bertos/cpu/arm/drv/stepper_arm.h"/> +<File Name="bertos/cpu/arm/drv/vic_lpc2.c"/> +<File Name="bertos/cpu/arm/drv/sysirq_at91.h"/> +<File Name="bertos/cpu/arm/drv/timer_lpc2.c"/> +<File Name="bertos/cpu/arm/drv/twi_at91.h"/> +<File Name="bertos/cpu/arm/drv/eth_at91.c"/> +<File Name="bertos/cpu/arm/drv/pwm_arm.c"/> +<File Name="bertos/cpu/arm/drv/flash_lpc2.h"/> +<File Name="bertos/cpu/arm/drv/stepper_at91.c"/> +<File Name="bertos/cpu/arm/drv/i2c_arm.h"/> +<File Name="bertos/cpu/arm/drv/vic_lpc2.h"/> +<File Name="bertos/cpu/arm/drv/twi_arm.h"/> +<File Name="bertos/cpu/arm/drv/flash_at91.c"/> +<File Name="bertos/cpu/arm/drv/ser_arm.h"/> +<File Name="bertos/cpu/arm/drv/spi_dma_at91.c"/> +<File Name="bertos/cpu/arm/drv/pwm_arm.h"/> +<File Name="bertos/cpu/arm/drv/i2s_at91.c"/> +</VirtualDirectory> +<VirtualDirectory Name="io"> +<File Name="bertos/cpu/arm/io/lpc23xx.h"/> +<File Name="bertos/cpu/arm/io/at91_dbgu.h"/> +<File Name="bertos/cpu/arm/io/at91_pwm.h"/> +<File Name="bertos/cpu/arm/io/at91_pmc.h"/> +<File Name="bertos/cpu/arm/io/at91_ssc.h"/> +<File Name="bertos/cpu/arm/io/at91_tc.h"/> +<File Name="bertos/cpu/arm/io/arm.h"/> +<File Name="bertos/cpu/arm/io/at91_wdt.h"/> +<File Name="bertos/cpu/arm/io/at91_rstc.h"/> +<File Name="bertos/cpu/arm/io/at91_aic.h"/> +<File Name="bertos/cpu/arm/io/at91sam7.h"/> +<File Name="bertos/cpu/arm/io/at91_us.h"/> +<File Name="bertos/cpu/arm/io/at91_mc.h"/> +<File Name="bertos/cpu/arm/io/at91_adc.h"/> +<File Name="bertos/cpu/arm/io/at91.h"/> +<File Name="bertos/cpu/arm/io/at91_twi.h"/> +<File Name="bertos/cpu/arm/io/at91_pit.h"/> +<File Name="bertos/cpu/arm/io/at91_spi.h"/> +<File Name="bertos/cpu/arm/io/at91_pio.h"/> +<File Name="bertos/cpu/arm/io/at91_emac.h"/> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +<File Name="bertos/cpu/arm/hw/init_lpc2.c"/> +<File Name="bertos/cpu/arm/hw/switch_ctx_arm.S"/> +<File Name="bertos/cpu/arm/hw/switch_arm.S"/> +<File Name="bertos/cpu/arm/hw/init_at91.c"/> +<File Name="bertos/cpu/arm/hw/pll_at91.h"/> +<File Name="bertos/cpu/arm/hw/crt_arm7tdmi.S"/> +<File Name="bertos/cpu/arm/hw/vectors_lpc2.S"/> +<File Name="bertos/cpu/arm/hw/crtat91sam7_rom.S"/> +<File Name="bertos/cpu/arm/hw/vectors_at91.S"/> +</VirtualDirectory> +<VirtualDirectory Name="info"> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="avr"> +<VirtualDirectory Name="drv"> +<File Name="bertos/cpu/avr/drv/ser_simple_avr.h"/> +<File Name="bertos/cpu/avr/drv/kdebug_avr.c"/> +<File Name="bertos/cpu/avr/drv/wdt_avr.h"/> +<File Name="bertos/cpu/avr/drv/i2c_avr.h"/> +<File Name="bertos/cpu/avr/drv/pwm_avr.c"/> +<File Name="bertos/cpu/avr/drv/pwm_avr.h"/> +<File Name="bertos/cpu/avr/drv/ser_avr.h"/> +<File Name="bertos/cpu/avr/drv/adc_avr.h"/> +<File Name="bertos/cpu/avr/drv/flash_avr.h"/> +<File Name="bertos/cpu/avr/drv/stepper_avr.c"/> +<File Name="bertos/cpu/avr/drv/adc_avr.c"/> +<File Name="bertos/cpu/avr/drv/ser_avr.c"/> +<File Name="bertos/cpu/avr/drv/timer_simple_avr.c"/> +<File Name="bertos/cpu/avr/drv/flash_avr.c"/> +<File Name="bertos/cpu/avr/drv/i2c_avr.c"/> +<File Name="bertos/cpu/avr/drv/timer_avr.h"/> +<File Name="bertos/cpu/avr/drv/stepper_avr.h"/> +<File Name="bertos/cpu/avr/drv/timer_avr.c"/> +<File Name="bertos/cpu/avr/drv/timer_simple_avr.h"/> +<File Name="bertos/cpu/avr/drv/ser_simple_avr.c"/> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +<File Name="bertos/cpu/avr/hw/switch_avr.S"/> +<File Name="bertos/cpu/avr/hw/switch_ctx_avr.S"/> +</VirtualDirectory> +<VirtualDirectory Name="info"> +</VirtualDirectory> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="benchmark"> +<File Name="bertos/benchmark/context_switch.h"/> +<File Name="bertos/benchmark/kernel_footprint.c"/> +<File Name="bertos/benchmark/kernel_footprint.h"/> +<File Name="bertos/benchmark/context_switch.c"/> +</VirtualDirectory> +<VirtualDirectory Name="os"> +<File Name="bertos/os/hptime.c"/> +<File Name="bertos/os/hptime.h"/> +</VirtualDirectory> +<VirtualDirectory Name="gui"> +<File Name="bertos/gui/leveledit.h"/> +<File Name="bertos/gui/levelbar.c"/> +<File Name="bertos/gui/menubar.c"/> +<File Name="bertos/gui/menubar.h"/> +<File Name="bertos/gui/leveledit.c"/> +<File Name="bertos/gui/menu.h"/> +<File Name="bertos/gui/menu.c"/> +<File Name="bertos/gui/levelbar.h"/> +</VirtualDirectory> +<VirtualDirectory Name="dt"> +<File Name="bertos/dt/editint.c"/> +<File Name="bertos/dt/dwidget.h"/> +<File Name="bertos/dt/editint.h"/> +<File Name="bertos/dt/editbool.h"/> +<File Name="bertos/dt/dnotifier.h"/> +<File Name="bertos/dt/dnotifier.c"/> +<File Name="bertos/dt/editbool.c"/> +<File Name="bertos/dt/dwidget.c"/> +<File Name="bertos/dt/dtag.h"/> +</VirtualDirectory> +<VirtualDirectory Name="net"> +<File Name="bertos/net/pocketbus.h"/> +<File Name="bertos/net/xmodem.c"/> +<File Name="bertos/net/afsk.c"/> +<File Name="bertos/net/nmea.c"/> +<File Name="bertos/net/ax25.c"/> +<File Name="bertos/net/lwip.h"/> +<File Name="bertos/net/nmea_test.c"/> +<File Name="bertos/net/keytag.c"/> +<File Name="bertos/net/xmodem.h"/> +<File Name="bertos/net/ax25_test.c"/> +<File Name="bertos/net/tftp.h"/> +<File Name="bertos/net/afsk_test.c"/> +<File Name="bertos/net/pocketbus.c"/> +<File Name="bertos/net/pocketcmd.c"/> +<File Name="bertos/net/afsk.h"/> +<File Name="bertos/net/lwip.c"/> +<File Name="bertos/net/nmea.h"/> +<File Name="bertos/net/keytag.h"/> +<File Name="bertos/net/pocketcmd.h"/> +<File Name="bertos/net/ax25.h"/> +<File Name="bertos/net/tftp.c"/> +<VirtualDirectory Name="lwip"> +<VirtualDirectory Name="test"> +<VirtualDirectory Name="unit"> +<File Name="bertos/net/lwip/test/unit/lwip_unittests.c"/> +<File Name="bertos/net/lwip/test/unit/lwip_check.h"/> +<VirtualDirectory Name="tcp"> +<File Name="bertos/net/lwip/test/unit/tcp/test_tcp.h"/> +<File Name="bertos/net/lwip/test/unit/tcp/test_tcp.c"/> +<File Name="bertos/net/lwip/test/unit/tcp/test_tcp_oos.h"/> +<File Name="bertos/net/lwip/test/unit/tcp/test_tcp_oos.c"/> +<File Name="bertos/net/lwip/test/unit/tcp/tcp_helper.h"/> +<File Name="bertos/net/lwip/test/unit/tcp/tcp_helper.c"/> +</VirtualDirectory> +<VirtualDirectory Name="udp"> +<File Name="bertos/net/lwip/test/unit/udp/test_udp.c"/> +<File Name="bertos/net/lwip/test/unit/udp/test_udp.h"/> +</VirtualDirectory> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="src"> +<VirtualDirectory Name="core"> +<File Name="bertos/net/lwip/src/core/tcp_out.c"/> +<File Name="bertos/net/lwip/src/core/pbuf.c"/> +<File Name="bertos/net/lwip/src/core/mem.c"/> +<File Name="bertos/net/lwip/src/core/memp.c"/> +<File Name="bertos/net/lwip/src/core/tcp_in.c"/> +<File Name="bertos/net/lwip/src/core/raw.c"/> +<File Name="bertos/net/lwip/src/core/tcp.c"/> +<File Name="bertos/net/lwip/src/core/udp.c"/> +<File Name="bertos/net/lwip/src/core/dhcp.c"/> +<File Name="bertos/net/lwip/src/core/stats.c"/> +<File Name="bertos/net/lwip/src/core/init.c"/> +<File Name="bertos/net/lwip/src/core/sys.c"/> +<File Name="bertos/net/lwip/src/core/dns.c"/> +<File Name="bertos/net/lwip/src/core/netif.c"/> +<VirtualDirectory Name="snmp"> +<File Name="bertos/net/lwip/src/core/snmp/asn1_dec.c"/> +<File Name="bertos/net/lwip/src/core/snmp/msg_in.c"/> +<File Name="bertos/net/lwip/src/core/snmp/msg_out.c"/> +<File Name="bertos/net/lwip/src/core/snmp/asn1_enc.c"/> +<File Name="bertos/net/lwip/src/core/snmp/mib2.c"/> +<File Name="bertos/net/lwip/src/core/snmp/mib_structs.c"/> +</VirtualDirectory> +<VirtualDirectory Name="ipv4"> +<File Name="bertos/net/lwip/src/core/ipv4/igmp.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/ip_frag.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/autoip.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/inet.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/inet_chksum.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/ip.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/icmp.c"/> +<File Name="bertos/net/lwip/src/core/ipv4/ip_addr.c"/> +</VirtualDirectory> +<VirtualDirectory Name="ipv6"> +<File Name="bertos/net/lwip/src/core/ipv6/inet6.c"/> +<File Name="bertos/net/lwip/src/core/ipv6/ip6_addr.c"/> +<File Name="bertos/net/lwip/src/core/ipv6/ip6.c"/> +<File Name="bertos/net/lwip/src/core/ipv6/icmp6.c"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="netif"> +<File Name="bertos/net/lwip/src/netif/etharp.c"/> +<File Name="bertos/net/lwip/src/netif/slipif.c"/> +<File Name="bertos/net/lwip/src/netif/loopif.c"/> +<File Name="bertos/net/lwip/src/netif/ethernetif.c"/> +<VirtualDirectory Name="ppp"> +<File Name="bertos/net/lwip/src/netif/ppp/chpms.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/chap.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/vjbsdhdr.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/pppdebug.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/auth.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/vj.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/fsm.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/auth.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/lcp.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/chap.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/randm.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/ipcp.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/md5.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/ppp.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/lcp.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/chpms.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/randm.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/md5.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/ppp_oe.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/magic.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/magic.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/pap.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/ipcp.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/vj.c"/> +<File Name="bertos/net/lwip/src/netif/ppp/pap.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/fsm.h"/> +<File Name="bertos/net/lwip/src/netif/ppp/ppp.c"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="include"> +<File Name="bertos/net/lwip/src/include/lwipopts.h"/> +<VirtualDirectory Name="netif"> +<File Name="bertos/net/lwip/src/include/netif/etharp.h"/> +<File Name="bertos/net/lwip/src/include/netif/ppp_oe.h"/> +<File Name="bertos/net/lwip/src/include/netif/loopif.h"/> +<File Name="bertos/net/lwip/src/include/netif/slipif.h"/> +<File Name="bertos/net/lwip/src/include/netif/ethernetif.h"/> +</VirtualDirectory> +<VirtualDirectory Name="lwip"> +<File Name="bertos/net/lwip/src/include/lwip/dhcp.h"/> +<File Name="bertos/net/lwip/src/include/lwip/memp_std.h"/> +<File Name="bertos/net/lwip/src/include/lwip/api_msg.h"/> +<File Name="bertos/net/lwip/src/include/lwip/netdb.h"/> +<File Name="bertos/net/lwip/src/include/lwip/netbuf.h"/> +<File Name="bertos/net/lwip/src/include/lwip/debug.h"/> +<File Name="bertos/net/lwip/src/include/lwip/arch.h"/> +<File Name="bertos/net/lwip/src/include/lwip/snmp_msg.h"/> +<File Name="bertos/net/lwip/src/include/lwip/raw.h"/> +<File Name="bertos/net/lwip/src/include/lwip/sio.h"/> +<File Name="bertos/net/lwip/src/include/lwip/snmp_structs.h"/> +<File Name="bertos/net/lwip/src/include/lwip/tcp.h"/> +<File Name="bertos/net/lwip/src/include/lwip/stats.h"/> +<File Name="bertos/net/lwip/src/include/lwip/pbuf.h"/> +<File Name="bertos/net/lwip/src/include/lwip/netifapi.h"/> +<File Name="bertos/net/lwip/src/include/lwip/init.h"/> +<File Name="bertos/net/lwip/src/include/lwip/sockets.h"/> +<File Name="bertos/net/lwip/src/include/lwip/mem.h"/> +<File Name="bertos/net/lwip/src/include/lwip/tcpip.h"/> +<File Name="bertos/net/lwip/src/include/lwip/memp.h"/> +<File Name="bertos/net/lwip/src/include/lwip/err.h"/> +<File Name="bertos/net/lwip/src/include/lwip/udp.h"/> +<File Name="bertos/net/lwip/src/include/lwip/opt.h"/> +<File Name="bertos/net/lwip/src/include/lwip/dns.h"/> +<File Name="bertos/net/lwip/src/include/lwip/snmp.h"/> +<File Name="bertos/net/lwip/src/include/lwip/def.h"/> +<File Name="bertos/net/lwip/src/include/lwip/netif.h"/> +<File Name="bertos/net/lwip/src/include/lwip/sys.h"/> +<File Name="bertos/net/lwip/src/include/lwip/snmp_asn1.h"/> +<File Name="bertos/net/lwip/src/include/lwip/api.h"/> +</VirtualDirectory> +<VirtualDirectory Name="ipv4"> +<VirtualDirectory Name="lwip"> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/igmp.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/inet_chksum.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/inet.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/autoip.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/ip.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/ip_addr.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/ip_frag.h"/> +<File Name="bertos/net/lwip/src/include/ipv4/lwip/icmp.h"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="arch"> +<File Name="bertos/net/lwip/src/include/arch/sys_arch.h"/> +<File Name="bertos/net/lwip/src/include/arch/cc.h"/> +<File Name="bertos/net/lwip/src/include/arch/perf.h"/> +</VirtualDirectory> +<VirtualDirectory Name="ipv6"> +<VirtualDirectory Name="lwip"> +<File Name="bertos/net/lwip/src/include/ipv6/lwip/inet.h"/> +<File Name="bertos/net/lwip/src/include/ipv6/lwip/ip.h"/> +<File Name="bertos/net/lwip/src/include/ipv6/lwip/ip_addr.h"/> +<File Name="bertos/net/lwip/src/include/ipv6/lwip/icmp.h"/> +</VirtualDirectory> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="arch"> +<File Name="bertos/net/lwip/src/arch/sys_arch.c"/> +</VirtualDirectory> +<VirtualDirectory Name="api"> +<File Name="bertos/net/lwip/src/api/tcpip.c"/> +<File Name="bertos/net/lwip/src/api/api_lib.c"/> +<File Name="bertos/net/lwip/src/api/netifapi.c"/> +<File Name="bertos/net/lwip/src/api/netbuf.c"/> +<File Name="bertos/net/lwip/src/api/netdb.c"/> +<File Name="bertos/net/lwip/src/api/sockets.c"/> +<File Name="bertos/net/lwip/src/api/api_msg.c"/> +<File Name="bertos/net/lwip/src/api/err.c"/> +</VirtualDirectory> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="nmeap"> +<File Name="bertos/net/nmeap/Makefile"/> +<VirtualDirectory Name="tst"> +<File Name="bertos/net/nmeap/tst/test1.c"/> +<File Name="bertos/net/nmeap/tst/test3.c"/> +<File Name="bertos/net/nmeap/tst/test2.c"/> +<File Name="bertos/net/nmeap/tst/Makefile"/> +<File Name="bertos/net/nmeap/tst/wingps.c"/> +</VirtualDirectory> +<VirtualDirectory Name="src"> +<File Name="bertos/net/nmeap/src/nmeap01.c"/> +<File Name="bertos/net/nmeap/src/Makefile"/> +</VirtualDirectory> +<VirtualDirectory Name="inc"> +<File Name="bertos/net/nmeap/inc/nmeap_def.h"/> +<File Name="bertos/net/nmeap/inc/nmeap.h"/> +</VirtualDirectory> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="fs"> +<File Name="bertos/fs/fat.c"/> +<File Name="bertos/fs/fat_test.c"/> +<File Name="bertos/fs/battfs_test.c"/> +<File Name="bertos/fs/fat.h"/> +<File Name="bertos/fs/battfs.h"/> +<File Name="bertos/fs/battfs.c"/> +<VirtualDirectory Name="fatfs"> +<File Name="bertos/fs/fatfs/diskio.c"/> +<File Name="bertos/fs/fatfs/ff.c"/> +<File Name="bertos/fs/fatfs/integer.h"/> +<File Name="bertos/fs/fatfs/ff.h"/> +<File Name="bertos/fs/fatfs/diskio.h"/> +<VirtualDirectory Name="option"> +<File Name="bertos/fs/fatfs/option/cc949.c"/> +<File Name="bertos/fs/fatfs/option/cc932.c"/> +<File Name="bertos/fs/fatfs/option/cc936.c"/> +<File Name="bertos/fs/fatfs/option/ccsbcs.c"/> +<File Name="bertos/fs/fatfs/option/cc950.c"/> +<File Name="bertos/fs/fatfs/option/syncobj.c"/> +</VirtualDirectory> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +<File Name="bertos/hw/mcp41_map.h"/> +<File Name="bertos/hw/hw_lcd_hd44.h"/> +<File Name="bertos/hw/hw_ser.h"/> +<File Name="bertos/hw/hw_phase.c"/> +<File Name="bertos/hw/hw_led.h"/> +<File Name="bertos/hw/hw_sd.h"/> +<File Name="bertos/hw/hw_thermo.h"/> +<File Name="bertos/hw/hw_rit128x96.h"/> +<File Name="bertos/hw/hw_afsk.h"/> +<File Name="bertos/hw/hw_ili9225.h"/> +<File Name="bertos/hw/hw_dataflash.c"/> +<File Name="bertos/hw/hw_tmp123.h"/> +<File Name="bertos/hw/kbd_map.h"/> +<File Name="bertos/hw/hw_stepper.h"/> +<File Name="bertos/hw/hw_ntc.h"/> +<File Name="bertos/hw/phase_map.h"/> +<File Name="bertos/hw/hw_phase.h"/> +<File Name="bertos/hw/hw_spi.h"/> +<File Name="bertos/hw/hw_tc520.h"/> +<File Name="bertos/hw/hw_dataflash.h"/> +<File Name="bertos/hw/thermo_map.h"/> +<File Name="bertos/hw/hw_ntc.c"/> +<File Name="bertos/hw/hw_hx8347.h"/> +<File Name="bertos/hw/ntc_map.h"/> +<File Name="bertos/hw/hw_boot.h"/> +<File Name="bertos/hw/hw_ft245rl.h"/> +<File Name="bertos/hw/hw_buzzer.h"/> +<File Name="bertos/hw/hw_mcp41.c"/> +<File Name="bertos/hw/hw_sipo.h"/> +<File Name="bertos/hw/hw_i2c_bitbang.h"/> +<File Name="bertos/hw/hw_sensor.h"/> +<File Name="bertos/hw/hw_input.h"/> +<File Name="bertos/hw/hw_buzzerled.h"/> +<File Name="bertos/hw/hw_tlv5618.h"/> +<File Name="bertos/hw/hw_lm75.h"/> +<File Name="bertos/hw/hw_mcp41.h"/> +<File Name="bertos/hw/hw_tas5706a.h"/> +<File Name="bertos/hw/hw_blanker.h"/> +<File Name="bertos/hw/hw_lcd_32122a.h"/> +<File Name="bertos/hw/hw_cpufreq.h"/> +<File Name="bertos/hw/hw_spi_dma.h"/> +<File Name="bertos/hw/hw_dc_motor.h"/> +<File Name="bertos/hw/pwm_map.h"/> +<File Name="bertos/hw/hw_kbd.h"/> +<File Name="bertos/hw/hw_lcd.h"/> +<File Name="bertos/hw/hw_timer.h"/> +</VirtualDirectory> +<VirtualDirectory Name="struct"> +<File Name="bertos/struct/list.h"/> +<File Name="bertos/struct/bitarray_test.c"/> +<File Name="bertos/struct/heap.c"/> +<File Name="bertos/struct/kfile_mem.h"/> +<File Name="bertos/struct/hashtable_test.c"/> +<File Name="bertos/struct/heap.h"/> +<File Name="bertos/struct/heap_test.c"/> +<File Name="bertos/struct/pool.h"/> +<File Name="bertos/struct/fifobuf.h"/> +<File Name="bertos/struct/bitarray.h"/> +<File Name="bertos/struct/kfile_mem.c"/> +<File Name="bertos/struct/hashtable.h"/> +<File Name="bertos/struct/kfile_fifo.h"/> +<File Name="bertos/struct/hashtable.c"/> +<File Name="bertos/struct/kfile_fifo.c"/> +<File Name="bertos/struct/kfile_fifo_test.c"/> +</VirtualDirectory> +<VirtualDirectory Name="algo"> +<File Name="bertos/algo/randpool.c"/> +<File Name="bertos/algo/rand.c"/> +<File Name="bertos/algo/randpool.h"/> +<File Name="bertos/algo/crc.h"/> +<File Name="bertos/algo/pid_control.c"/> +<File Name="bertos/algo/rand.h"/> +<File Name="bertos/algo/rle.c"/> +<File Name="bertos/algo/rle.h"/> +<File Name="bertos/algo/crc_ccitt.c"/> +<File Name="bertos/algo/ramp.c"/> +<File Name="bertos/algo/tea.h"/> +<File Name="bertos/algo/reverse_test.c"/> +<File Name="bertos/algo/crc.c"/> +<File Name="bertos/algo/ramp.h"/> +<File Name="bertos/algo/rotating_hash.h"/> +<File Name="bertos/algo/ramp_test.c"/> +<File Name="bertos/algo/crc_ccitt.h"/> +<File Name="bertos/algo/crc_test.c"/> +<File Name="bertos/algo/md2.h"/> +<File Name="bertos/algo/tea.c"/> +<File Name="bertos/algo/mean.h"/> +<File Name="bertos/algo/md2.c"/> +<File Name="bertos/algo/pid_control.h"/> +</VirtualDirectory> +<VirtualDirectory Name="fonts"> +<File Name="bertos/fonts/fixed6x8.c"/> +<File Name="bertos/fonts/helvB10.c"/> +<File Name="bertos/fonts/luBS14.c"/> +<File Name="bertos/fonts/ncenB18.c"/> +<File Name="bertos/fonts/fonts.mk"/> +<File Name="bertos/fonts/gohu.c"/> +</VirtualDirectory> +</VirtualDirectory> +<VirtualDirectory Name="jtag"> +<File Name="jtag/flash.mk"/> +</VirtualDirectory> +<VirtualDirectory Name="Firmware_Test"> +<File Name="Firmware_Test/Firmware_Test.mk"/> +<File Name="Firmware_Test/ads7828.h"/> +<File Name="Firmware_Test/main.c"/> +<File Name="Firmware_Test/Firmware_Test_user.mk"/> +<VirtualDirectory Name="cfg"> +<File Name="Firmware_Test/cfg/cfg_timer.h"/> +<File Name="Firmware_Test/cfg/cfg_stepper.h"/> +<File Name="Firmware_Test/cfg/cfg_randpool.h"/> +<File Name="Firmware_Test/cfg/cfg_ser.h"/> +<File Name="Firmware_Test/cfg/cfg_flash25.h"/> +<File Name="Firmware_Test/cfg/cfg_i2c.h"/> +<File Name="Firmware_Test/cfg/cfg_adc.h"/> +<File Name="Firmware_Test/cfg/cfg_lcd_32122a.h"/> +<File Name="Firmware_Test/cfg/cfg_usbmouse.h"/> +<File Name="Firmware_Test/cfg/cfg_keytag.h"/> +<File Name="Firmware_Test/cfg/cfg_eeprom.h"/> +<File Name="Firmware_Test/cfg/cfg_i2s.h"/> +<File Name="Firmware_Test/cfg/cfg_tas5706a.h"/> +<File Name="Firmware_Test/cfg/cfg_hashtable.h"/> +<File Name="Firmware_Test/cfg/cfg_usbser.h"/> +<File Name="Firmware_Test/cfg/cfg_spi_bitbang.h"/> +<File Name="Firmware_Test/cfg/cfg_pocketbus.h"/> +<File Name="Firmware_Test/cfg/cfg_ramp.h"/> +<File Name="Firmware_Test/cfg/cfg_lm75.h"/> +<File Name="Firmware_Test/cfg/cfg_ini_reader.h"/> +<File Name="Firmware_Test/cfg/cfg_lwip.h"/> +<File Name="Firmware_Test/cfg/cfg_battfs.h"/> +<File Name="Firmware_Test/cfg/cfg_ax25.h"/> +<File Name="Firmware_Test/cfg/cfg_afsk.h"/> +<File Name="Firmware_Test/cfg/cfg_parser.h"/> +<File Name="Firmware_Test/cfg/cfg_proc.h"/> +<File Name="Firmware_Test/cfg/cfg_phase.h"/> +<File Name="Firmware_Test/cfg/cfg_formatwr.h"/> +<File Name="Firmware_Test/cfg/cfg_signal.h"/> +<File Name="Firmware_Test/cfg/cfg_lcd_hd44.h"/> +<File Name="Firmware_Test/cfg/cfg_wdt.h"/> +<File Name="Firmware_Test/cfg/cfg_eth.h"/> +<File Name="Firmware_Test/cfg/cfg_thermo.h"/> +<File Name="Firmware_Test/cfg/cfg_dataflash.h"/> +<File Name="Firmware_Test/cfg/cfg_random.h"/> +<File Name="Firmware_Test/cfg/cfg_tftp.h"/> +<File Name="Firmware_Test/cfg/cfg_dc_motor.h"/> +<File Name="Firmware_Test/cfg/cfg_heap.h"/> +<File Name="Firmware_Test/cfg/cfg_sd.h"/> +<File Name="Firmware_Test/cfg/cfg_usbkbd.h"/> +<File Name="Firmware_Test/cfg/cfg_emb_flash.h"/> +<File Name="Firmware_Test/cfg/cfg_monitor.h"/> +<File Name="Firmware_Test/cfg/cfg_pwm.h"/> +<File Name="Firmware_Test/cfg/cfg_debug.h"/> +<File Name="Firmware_Test/cfg/cfg_usb.h"/> +<File Name="Firmware_Test/cfg/cfg_xmodem.h"/> +<File Name="Firmware_Test/cfg/cfg_md2.h"/> +<File Name="Firmware_Test/cfg/cfg_context_switch.h"/> +<File Name="Firmware_Test/cfg/cfg_gfx.h"/> +<File Name="Firmware_Test/cfg/cfg_fat.h"/> +<File Name="Firmware_Test/cfg/cfg_kfile.h"/> +<File Name="Firmware_Test/cfg/cfg_kbd.h"/> +<File Name="Firmware_Test/cfg/cfg_sem.h"/> +<File Name="Firmware_Test/cfg/cfg_nmea.h"/> +</VirtualDirectory> +<VirtualDirectory Name="hw"> +<File Name="Firmware_Test/hw/mcp41_map.h"/> +<File Name="Firmware_Test/hw/hw_lcd_hd44.h"/> +<File Name="Firmware_Test/hw/hw_ser.h"/> +<File Name="Firmware_Test/hw/hw_phase.c"/> +<File Name="Firmware_Test/hw/hw_afsk.c"/> +<File Name="Firmware_Test/hw/hw_led.h"/> +<File Name="Firmware_Test/hw/hw_sd.h"/> +<File Name="Firmware_Test/hw/hw_thermo.h"/> +<File Name="Firmware_Test/hw/hw_rit128x96.h"/> +<File Name="Firmware_Test/hw/hw_afsk.h"/> +<File Name="Firmware_Test/hw/hw_ili9225.h"/> +<File Name="Firmware_Test/hw/hw_dataflash.c"/> +<File Name="Firmware_Test/hw/hw_tmp123.h"/> +<File Name="Firmware_Test/hw/kbd_map.h"/> +<File Name="Firmware_Test/hw/hw_stepper.h"/> +<File Name="Firmware_Test/hw/hw_ntc.h"/> +<File Name="Firmware_Test/hw/phase_map.h"/> +<File Name="Firmware_Test/hw/hw_phase.h"/> +<File Name="Firmware_Test/hw/hw_spi.h"/> +<File Name="Firmware_Test/hw/hw_adc.h"/> +<File Name="Firmware_Test/hw/hw_tc520.h"/> +<File Name="Firmware_Test/hw/hw_dataflash.h"/> +<File Name="Firmware_Test/hw/thermo_map.h"/> +<File Name="Firmware_Test/hw/hw_ntc.c"/> +<File Name="Firmware_Test/hw/hw_hx8347.h"/> +<File Name="Firmware_Test/hw/ntc_map.h"/> +<File Name="Firmware_Test/hw/hw_boot.h"/> +<File Name="Firmware_Test/hw/hw_ft245rl.h"/> +<File Name="Firmware_Test/hw/hw_buzzer.h"/> +<File Name="Firmware_Test/hw/hw_mcp41.c"/> +<File Name="Firmware_Test/hw/hw_sipo.h"/> +<File Name="Firmware_Test/hw/hw_i2c_bitbang.h"/> +<File Name="Firmware_Test/hw/hw_sensor.h"/> +<File Name="Firmware_Test/hw/hw_input.h"/> +<File Name="Firmware_Test/hw/hw_buzzerled.h"/> +<File Name="Firmware_Test/hw/hw_tlv5618.h"/> +<File Name="Firmware_Test/hw/hw_lm75.h"/> +<File Name="Firmware_Test/hw/hw_mcp41.h"/> +<File Name="Firmware_Test/hw/hw_tas5706a.h"/> +<File Name="Firmware_Test/hw/hw_blanker.h"/> +<File Name="Firmware_Test/hw/hw_lcd_32122a.h"/> +<File Name="Firmware_Test/hw/hw_cpufreq.h"/> +<File Name="Firmware_Test/hw/hw_spi_dma.h"/> +<File Name="Firmware_Test/hw/hw_dc_motor.h"/> +<File Name="Firmware_Test/hw/pwm_map.h"/> +<File Name="Firmware_Test/hw/hw_kbd.h"/> +<File Name="Firmware_Test/hw/hw_timer.h"/> +</VirtualDirectory> +</VirtualDirectory> + <Description></Description> + <Dependencies/> + <Settings Type="Dynamic Library"> + <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library"> + <General OutputFile="" IntermediateDirectory="./Debug" Command="./images/Firmware_Test.elf" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> + <Compiler Required="yes" Options="-g"> + <IncludePath Value="."/> + </Compiler> + <Linker Required="yes" Options=""/> + <Debugger IsRemote="yes" RemoteHostName="localhost" RemoteHostPort="3333" DebuggerPath="/home/olivier/opt/arm/bin/arm-none-eabi-gdb"> + <PostConnectCommands> +source bertos/prg_scripts/arm/openocd/gdbinit-sam7 + </PostConnectCommands> + <StartupCommands> +shell sleep 2 + </StartupCommands> + </Debugger> + <ResourceCompiler Required="no" Options=""/> + <PreBuild/> + <PostBuild/> + <CustomBuild Enabled="yes"> + <CleanCommand>make clean</CleanCommand> + <BuildCommand>make</BuildCommand> + <PreprocessFileCommand></PreprocessFileCommand> + <SingleFileCommand></SingleFileCommand> + <MakefileGenerationCommand></MakefileGenerationCommand> + <ThirdPartyToolName>None</ThirdPartyToolName> + <WorkingDirectory>$(WorkspacePath)</WorkingDirectory> + </CustomBuild> + <AdditionalRules> + <CustomPostBuild></CustomPostBuild> + <CustomPreBuild></CustomPreBuild> + </AdditionalRules> + </Configuration> + <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Dynamic Library"> + <General OutputFile="" IntermediateDirectory="./Release" Command="" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/> + <Compiler Required="yes" Options=""> + <IncludePath Value="."/> + </Compiler> + <Linker Required="yes" Options="-O2"/> + <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath=""> + <PostConnectCommands></PostConnectCommands> + <StartupCommands></StartupCommands> + </Debugger> + <ResourceCompiler Required="no" Options=""/> + <PreBuild/> + <PostBuild/> + <CustomBuild Enabled="yes"> + <CleanCommand>make clean</CleanCommand> + <BuildCommand>make</BuildCommand> + <PreprocessFileCommand></PreprocessFileCommand> + <SingleFileCommand></SingleFileCommand> + <MakefileGenerationCommand></MakefileGenerationCommand> + <ThirdPartyToolName>None</ThirdPartyToolName> + <WorkingDirectory>$(WorkspacePath)</WorkingDirectory> + </CustomBuild> + <AdditionalRules> + <CustomPostBuild></CustomPostBuild> + <CustomPreBuild></CustomPreBuild> + </AdditionalRules> + </Configuration> + </Settings> +</CodeLite_Project> diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test.workspace b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test.workspace new file mode 100644 index 0000000..acbdf8e --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test.workspace @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<CodeLite_Workspace Name="Firmware_Test" Database="./bertos.tags"> + <Project Name="Firmware_Test" Path="Firmware_Test.project" Active="Yes"/> + <BuildMatrix> + <WorkspaceConfiguration Name="Debug" Selected="yes"> + <Project Name="Firmware_Test" ConfigName="Debug"/> + </WorkspaceConfiguration> + <WorkspaceConfiguration Name="Release" Selected="yes"> + <Project Name="Firmware_Test" ConfigName="Release"/> + </WorkspaceConfiguration> + </BuildMatrix> +</CodeLite_Workspace> diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/.spec b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/.spec new file mode 100644 index 0000000..04a79cf --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/.spec @@ -0,0 +1,9 @@ +name = 'kernel preset' +advanced = True +description=""" +<p> +This is a minimalist kernel project: it just initializes the hardware and +creates an independent process to blink an LED, while the main loop +continues to monitor the stack utilization of all the processes. +</p> +""" diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test.mk b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test.mk new file mode 100644 index 0000000..c712e8c --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test.mk @@ -0,0 +1,96 @@ +# +# Wizard autogenerated makefile. +# DO NOT EDIT, use the Firmware_Test_user.mk file instead. +# + +# Constants automatically defined by the selected modules +Firmware_Test_DEBUG = 1 + +# Our target application +TRG += Firmware_Test + +Firmware_Test_PREFIX = "arm-none-eabi-" + +Firmware_Test_SUFFIX = "" + +Firmware_Test_SRC_PATH = Firmware_Test + +Firmware_Test_HW_PATH = Firmware_Test + +# Files automatically generated by the wizard. DO NOT EDIT, USE Firmware_Test_USER_CSRC INSTEAD! +Firmware_Test_WIZARD_CSRC = \ + bertos/cpu/cortex-m3/hw/switch_ctx_cm3.c \ + bertos/mware/event.c \ + bertos/kern/sem.c \ + bertos/cpu/cortex-m3/drv/timer_cm3.c \ + bertos/struct/heap.c \ + bertos/drv/i2c_bitbang.c \ + bertos/io/kfile.c \ + bertos/kern/monitor.c \ + bertos/cpu/cortex-m3/drv/i2c_stm32.c \ + bertos/drv/timer.c \ + bertos/kern/signal.c \ + bertos/kern/proc.c \ + bertos/mware/formatwr.c \ + bertos/mware/hex.c \ + bertos/drv/i2c.c \ + # + +# Files automatically generated by the wizard. DO NOT EDIT, USE Firmware_Test_USER_PCSRC INSTEAD! +Firmware_Test_WIZARD_PCSRC = \ + \ + # + +# Files automatically generated by the wizard. DO NOT EDIT, USE Firmware_Test_USER_CPPASRC INSTEAD! +Firmware_Test_WIZARD_CPPASRC = \ + \ + # + +# Files automatically generated by the wizard. DO NOT EDIT, USE Firmware_Test_USER_CXXSRC INSTEAD! +Firmware_Test_WIZARD_CXXSRC = \ + \ + # + +# Files automatically generated by the wizard. DO NOT EDIT, USE Firmware_Test_USER_ASRC INSTEAD! +Firmware_Test_WIZARD_ASRC = \ + \ + # + +Firmware_Test_CPPFLAGS = -D'CPU_FREQ=(72000000UL)' -D'ARCH=(ARCH_DEFAULT)' -D'WIZ_AUTOGEN' -I$(Firmware_Test_HW_PATH) -I$(Firmware_Test_SRC_PATH) $(Firmware_Test_CPU_CPPFLAGS) $(Firmware_Test_USER_CPPFLAGS) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_LDFLAGS = $(Firmware_Test_CPU_LDFLAGS) $(Firmware_Test_WIZARD_LDFLAGS) $(Firmware_Test_USER_LDFLAGS) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_CPPAFLAGS = $(Firmware_Test_CPU_CPPAFLAGS) $(Firmware_Test_WIZARD_CPPAFLAGS) $(Firmware_Test_USER_CPPAFLAGS) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_CSRC = $(Firmware_Test_CPU_CSRC) $(Firmware_Test_WIZARD_CSRC) $(Firmware_Test_USER_CSRC) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_PCSRC = $(Firmware_Test_CPU_PCSRC) $(Firmware_Test_WIZARD_PCSRC) $(Firmware_Test_USER_PCSRC) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_CPPASRC = $(Firmware_Test_CPU_CPPASRC) $(Firmware_Test_WIZARD_CPPASRC) $(Firmware_Test_USER_CPPASRC) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_CXXSRC = $(Firmware_Test_CPU_CXXSRC) $(Firmware_Test_WIZARD_CXXSRC) $(Firmware_Test_USER_CXXSRC) + +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_ASRC = $(Firmware_Test_CPU_ASRC) $(Firmware_Test_WIZARD_ASRC) $(Firmware_Test_USER_ASRC) + +# CPU specific flags and options, defined in the CPU definition files. +# Automatically generated by the wizard. PLEASE DO NOT EDIT! +Firmware_Test_CPU_CPPASRC = bertos/cpu/cortex-m3/hw/crt_cm3.S bertos/cpu/cortex-m3/hw/vectors_cm3.S +Firmware_Test_CPU_CPPAFLAGS = -g -gdwarf-2 -mthumb -mno-thumb-interwork +Firmware_Test_CPU_CPPFLAGS = -O0 -g3 -gdwarf-2 -mthumb -mno-thumb-interwork -fno-strict-aliasing -fwrapv -fverbose-asm -Ibertos/cpu/cortex-m3/ -D__ARM_STM32F103RB__ +Firmware_Test_CPU_CSRC = bertos/cpu/cortex-m3/hw/init_cm3.c bertos/cpu/cortex-m3/drv/irq_cm3.c bertos/cpu/cortex-m3/drv/gpio_stm32.c bertos/cpu/cortex-m3/drv/clock_stm32.c +Firmware_Test_PROGRAMMER_CPU = stm32 +Firmware_Test_CPU_LDFLAGS = -mthumb -mno-thumb-interwork -nostartfiles -Wl,--no-warn-mismatch -Wl,-dT bertos/cpu/cortex-m3/scripts/stm32f103rb_rom.ld +Firmware_Test_STOPFLASH_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh +Firmware_Test_CPU = cortex-m3 +Firmware_Test_STOPDEBUG_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh +Firmware_Test_DEBUG_SCRIPT = bertos/prg_scripts/arm/debug.sh +Firmware_Test_FLASH_SCRIPT = bertos/prg_scripts/arm/flash-stm32.sh + +include $(Firmware_Test_SRC_PATH)/Firmware_Test_user.mk diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk new file mode 100644 index 0000000..b92ba07 --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/Firmware_Test_user.mk @@ -0,0 +1,48 @@ +# +# User makefile. +# Edit this file to change compiler options and related stuff. +# + +# Programmer interface configuration, see http://dev.bertos.org/wiki/ProgrammerInterface for help +Firmware_Test_PROGRAMMER_TYPE = none +Firmware_Test_PROGRAMMER_PORT = none + +# Files included by the user. +Firmware_Test_USER_CSRC = \ + $(Firmware_Test_SRC_PATH)/main.c \ + # + +# Files included by the user. +Firmware_Test_USER_PCSRC = \ + # + +# Files included by the user. +Firmware_Test_USER_CPPASRC = \ + # + +# Files included by the user. +Firmware_Test_USER_CXXSRC = \ + # + +# Files included by the user. +Firmware_Test_USER_ASRC = \ + # + +# Flags included by the user. +Firmware_Test_USER_LDFLAGS = \ + # + +# Flags included by the user. +Firmware_Test_USER_CPPAFLAGS = \ + # + +# Flags included by the user. +Firmware_Test_USER_CPPFLAGS = \ + -fno-strict-aliasing \ + -fwrapv \ + # + +BUILDDIR = images +PROJECT = Firmware_Test +include jtag/flash.mk + diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h new file mode 100644 index 0000000..ade1632 --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/ads7828.h @@ -0,0 +1,29 @@ +/* + * Wrapper to use the ADS7828 analog to digital converter + * Olivier Bichler + */ + +#ifndef HEADER__ADS7828 +#define HEADER__ADS7828 + +#define ADS7828_VREF 2.5 +#define ADS7828_RES 12 +#define ADS7828_LSB (ADS7828_VREF/((1 << ADS7828_RES) - 1.0)) + +#define ADS7828_ADDR_BASE 0x90 +#define ADS7828_ADDR_A0 0x02 +#define ADS7828_ADDR_A1 0x04 + +#define ADS7828_CMD_PD0 0x04 +#define ADS7828_CMD_PD1 0x08 +#define ADS7828_CMD_C0 0x10 +#define ADS7828_CMD_C1 0x20 +#define ADS7828_CMD_C2 0x40 +#define ADS7828_CMD_SD 0x80 + +#include <drv/i2c.h> + + + +#endif + diff --git a/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/cfg/cfg_adc.h b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/cfg/cfg_adc.h new file mode 100644 index 0000000..df2587b --- /dev/null +++ b/elec/boards/Monitoring_4Cells/Firmware_Test/Firmware_Test/cfg/cfg_adc.h @@ -0,0 +1,112 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/... [truncated message content] |
From: Olivier B. <Ba...@us...> - 2011-03-12 14:21:07
|
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 49ce86ef538251858fbd784a4612a6c3943db1d5 (commit) from c25647f65a4b57b73ff5367be6896403c66049ce (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 49ce86ef538251858fbd784a4612a6c3943db1d5 Author: Olivier BICHLER <oli...@gm...> Date: Sat Mar 12 15:20:22 2011 +0100 [Controller_Motor_STM32] Removed absolute path to the toolchain (use PATH instead) ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32.mk b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32.mk index fd1ed23..ddec5b2 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32.mk +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32.mk @@ -9,7 +9,7 @@ Firmware_DEBUG = 1 # Our target application TRG += controller_motor_stm32 -controller_motor_stm32_PREFIX = "/home/lxir/opt/arm/bin/arm-none-eabi-" +controller_motor_stm32_PREFIX = "arm-none-eabi-" controller_motor_stm32_SUFFIX = "" hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2011-03-12 14:07:21
|
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 c25647f65a4b57b73ff5367be6896403c66049ce (commit) via df6731f8a5646984a9674bde634c1fba0738ae55 (commit) via 6b95ef3f756ab2337d3e8d3863be51bfc747af34 (commit) from 85ee8e9f8f4b8df9a2b2efbd4848a9ee9952ec4e (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 c25647f65a4b57b73ff5367be6896403c66049ce Author: Xavier Lagorce <Xav...@cr...> Date: Sat Mar 12 15:06:50 2011 +0100 [Controller_Motor_STM32] Corrected warnings in encoder.c commit df6731f8a5646984a9674bde634c1fba0738ae55 Author: Xavier Lagorce <Xav...@cr...> Date: Sat Mar 12 15:05:11 2011 +0100 [Controller_Motor_STM32] BeRTOS update Updated BeRTOS to add CAN_support commit 6b95ef3f756ab2337d3e8d3863be51bfc747af34 Author: Xavier Lagorce <Xav...@cr...> Date: Sat Mar 12 14:46:25 2011 +0100 [Controller_Motor_STM32] No need to remap USART3 and added encoders support ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cfg/cfg_can.h b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cfg/cfg_can.h new file mode 100644 index 0000000..827bc96 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cfg/cfg_can.h @@ -0,0 +1,57 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright © 2011 Nicolas Dandrimont <Nic...@cr...> + * + * --> + * + * \brief Configuration file for the CAN module. + * + * \author Nicolas Dandrimont <Nic...@cr...> + */ + +#ifndef CFG_CAN_H +#define CFG_CAN_H + +/** + * Module logging level. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_level" + */ +#define CAN_LOG_LEVEL LOG_LVL_INFO + +/** + * Module logging format. + * + * $WIZ$ type = "enum" + * $WIZ$ value_list = "log_format" + */ +#define CAN_LOG_FORMAT LOG_FMT_VERBOSE + +#endif /* CFG_CAN_H */ diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/config.mk b/elec/boards/Controller_Motor_STM32/Firmware/bertos/config.mk index 1c53640..1d75dc0 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/bertos/config.mk +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/config.mk @@ -1,5 +1,5 @@ # -# $Id: config.mk 4643 2010-12-20 12:10:41Z lottaviano $ +# $Id$ # Copyright 2002,2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/) # All rights reserved. # diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_cm3.h b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_cm3.h new file mode 100644 index 0000000..27b1254 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_cm3.h @@ -0,0 +1,46 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright © 2010 Nicolas Dandrimont <Nic...@cr...> + * + * --> + * + * \brief Low-level CAN module for ARM (interface). + * + * \author Nicolas Dandrimont <Nic...@cr...> + * + */ + +#include <cpu/detect.h> + +#if CPU_CM3_STM32 + #include "can_stm32.h" +/*#elif Add other ARM families here */ +#else + #error Unknown/Unsupported CPU +#endif diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c new file mode 100644 index 0000000..b92fb9f --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.c @@ -0,0 +1,304 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright © 2011 Nicolas Dandrimont <Nic...@cr...> + * + * --> + * + * \brief CAN hardware-specific implementation + * + * \author Nicolas Dandrimont <Nic...@cr...> + */ + +#include "can_stm32.h" + +#include <cpu/irq.h> + +#include "cfg/cfg_can.h" +#include "cfg/cfg_proc.h" + +#include <cfg/macros.h> +#include <cfg/compiler.h> +#include <cfg/debug.h> + +// Define log settings for cfg/log.h. +#define LOG_LEVEL CAN_LOG_LEVEL +#define LOG_FORMAT CAN_LOG_FORMAT +#include <cfg/log.h> + +#include <drv/can.h> +#include <drv/clock_stm32.h> +#include <drv/gpio_stm32.h> + +#include <io/stm32.h> +#include <io/stm32_can.h> + +#include <cfg/module.h> + +#include <drv/irq_cm3.h> + + +static can_driver _cand1; +can_driver *CAND1 = &_cand1; + +CAN *CAN1 = (CAN *)CAN1_BASE; + +/** + * CAN IRQ Handlers + */ + +/** + * Transmit Done IRQ Handler + */ +static DECLARE_ISR(can1_tx_irqhandler) +{ + // Clear the transmit done events until we handled them... + CAN1->TSR = CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2; + // Allow processes to send CAN messages again. + event_do(&CAND1->tx_empty_event); +} + +/** + * Message received (on RX0) IRQ Handler + */ +static DECLARE_ISR(can1_rx0_irqhandler) +{ + if ((CAN1->RF0R & CAN_RF0R_FMP0) > 0) + { + // Disable further message received interrupts. + CAN1->IER &= ~CAN_IER_FMPIE0; + event_do(&CAND1->rx_available_event); + } + if ((CAN1->RF0R & CAN_RF0R_FOVR0) > 0) + { + // The RX0 queue is overflowing. Handle this. + CAN1->RF0R = CAN_RF0R_FOVR0; + event_do(&CAND1->error_event); + } +} + +/** + * Status Change / Error IRQ Handler + */ +static DECLARE_ISR(can1_sce_irqhandler) +{ + uint32_t msr; + + msr = CAN1->MSR; + // Clear Error Interrupt, Wakeup Interrupt and Sleep Ack Interrupt bits + CAN1->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI; + + if ((msr & CAN_MSR_WKUI) == CAN_MSR_WKUI) + { + event_do(&CAND1->wakeup_event); + } + if ((msr & CAN_MSR_ERRI) == CAN_MSR_ERRI) + { + event_do(&CAND1->error_event); + } + if ((msr & CAN_MSR_SLAKI) == CAN_MSR_SLAKI) + { + event_do(&CAND1->sleep_event); + } +} + +/** + * Init CAN hardware. + */ +void can_hw_init(void) +{ + + // Initialize the driver structure... + can_drv_init(CAND1); + CAND1->can = CAN1; + + // Set the pins to the right mode for CAN. + stm32_gpioRemap(GPIO_REMAP1_CAN1, GPIO_REMAP_ENABLE); + stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(8), GPIO_MODE_IPU, GPIO_SPEED_50MHZ); + stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(9), GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); + + // Enable the clocks + RCC->APB2ENR |= RCC_APB2_AFIO; + RCC->APB2ENR |= RCC_APB2_GPIOB; +} + +void can_hw_start(can_driver *drv) { + // Reset the CAN controller, to avoid trouble with JTAGs + RCC->APB1RSTR |= RCC_APB1_CAN; + RCC->APB1RSTR &= ~RCC_APB1_CAN; + + // Make sure the USB device is disabled + RCC->APB1ENR &= ~RCC_APB1_USB; + RCC->APB1ENR &= ~RCC_APB1_CAN; + + // Clock enable + RCC->APB1ENR |= RCC_APB1_CAN; + + // Initialization mode + drv->state = CAN_STARTING; + + drv->can->MCR = CAN_MCR_INRQ; + + while ((drv->can->MSR & CAN_MSR_INAK) == 0) + timer_delayTicks(1); + + // Initialize registers + drv->can->BTR = drv->config->btr; + drv->can->MCR = drv->config->mcr; + + // Initialize filters + drv->can->FMR |= CAN_FMR_FINIT; + if (drv->config->n_filters > 0) { + uint32_t i, mask; + CAN_FilterRegister *cur_filter; + + drv->can->FA1R = 0; + drv->can->FM1R = 0; + drv->can->FS1R = 0; + drv->can->FFA1R = 0; + cur_filter = drv->can->sFilterRegister; + mask = 1; + + for (i = 0; i < CAN_MAX_FILTERS; i++) { + if (i < drv->config->n_filters) { + if (drv->config->filters[i].mode) + drv->can->FM1R |= mask; + if (drv->config->filters[i].scale) + drv->can->FS1R |= mask; + if (drv->config->filters[i].assignment) + drv->can->FFA1R |= mask; + cur_filter->FR1 = drv->config->filters[i].register1; + cur_filter->FR2 = drv->config->filters[i].register2; + drv->can->FA1R |= mask; + } + else { + cur_filter->FR1 = 0; + cur_filter->FR2 = 0; + } + // This loop may be big; allow preemption + proc_permit(); + cur_filter++; + mask <<= 1; + proc_forbid(); + } + } + else { + // Default filter + drv->can->sFilterRegister[0].FR1 = 0; + drv->can->sFilterRegister[0].FR2 = 0; + drv->can->FM1R = 0; + drv->can->FFA1R = 0; + drv->can->FS1R = 1; + drv->can->FA1R = 1; + } + drv->can->FMR &= ~CAN_FMR_FINIT; + + // Register IRQ handlers + sysirq_setHandler(USB_HP_CAN_TX_IRQHANDLER, can1_tx_irqhandler); + sysirq_setHandler(USB_LP_CAN_RX0_IRQHANDLER, can1_rx0_irqhandler); + //sysirq_setHandler(CAN_RX1_IRQHANDLER, can1_rx1_irqhandler); + sysirq_setHandler(CAN_SCE_IRQHANDLER, can1_sce_irqhandler); + + // Enable interrupts in the CAN registers + drv->can->IER = CAN_IER_TMEIE | CAN_IER_FMPIE0 | CAN_IER_FMPIE1 | + CAN_IER_WKUIE | CAN_IER_ERRIE | CAN_IER_LECIE | + CAN_IER_BOFIE | CAN_IER_EPVIE | CAN_IER_EWGIE | + CAN_IER_FOVIE0 | CAN_IER_FOVIE1; + +} + +void can_hw_stop(can_driver *drv) { + if (drv->state == CAN_READY) { + if (drv == CAND1) { + drv->can->MCR = 0x00010002; + drv->can->IER = 0x00000000; + sysirq_freeHandler(USB_HP_CAN_TX_IRQHANDLER); + sysirq_freeHandler(USB_LP_CAN_RX0_IRQHANDLER); + //sysirq_freeHandler(CAN_RX1_IRQHANDLER); + sysirq_freeHandler(CAN_SCE_IRQHANDLER); + RCC->APB1ENR &= ~RCC_APB1_CAN; + } + } +} + +void can_hw_sleep(can_driver *drv) { + drv->can->MCR |= CAN_MCR_SLEEP; +} +void can_hw_wakeup(can_driver *drv) { + drv->can->MCR &= ~CAN_MCR_SLEEP; +} +bool can_hw_can_transmit(can_driver *drv) { + return (drv->can->TSR & CAN_TSR_TME) != 0; +} +bool can_hw_can_receive(can_driver *drv) { + return (drv->can->RF0R & CAN_RF0R_FMP0) > 0; +} +void can_hw_transmit(can_driver *drv, const can_tx_frame *frame) { + uint32_t id_reg; + CAN_TxMailBox *mailbox; + + // Get the address of a free transmit mailbox + mailbox = &drv->can->sTxMailBox[(drv->can->TSR & CAN_TSR_CODE) >> 24]; + + if (frame->ide) + id_reg = ((uint32_t)frame->eid << 3) | ((uint32_t)frame->rtr << 1) | CAN_TI0R_IDE; + else + id_reg = ((uint32_t)frame->sid << 21) | ((uint32_t)frame->rtr << 1); + + mailbox->TDTR = frame->dlc; + mailbox->TDLR = frame->data32[0]; + mailbox->TDHR = frame->data32[1]; + mailbox->TIR = id_reg | CAN_TI0R_TXRQ; +} +void can_hw_receive(can_driver *drv, can_rx_frame *frame) { + uint32_t reg; + + reg = drv->can->sFIFOMailBox[0].RIR; + frame->rtr = (reg & CAN_RI0R_RTR) >> 1; + frame->ide = (reg & CAN_RI0R_IDE) >> 2; + if (frame->ide) { + frame->eid = reg >> 3; + } + else { + frame->sid = reg >> 21; + } + + reg = drv->can->sFIFOMailBox[0].RDTR; + frame->dlc = reg & CAN_RDT0R_DLC; + frame->fmi = (uint8_t)(reg >> 8); + frame->time = (uint16_t)(reg >> 16); + frame->data32[0] = drv->can->sFIFOMailBox[0].RDLR; + frame->data32[1] = drv->can->sFIFOMailBox[0].RDHR; + + // Release the mailbox + drv->can->RF0R = CAN_RF0R_RFOM0; + + // Reenable the IRQ if the queue is empty + if ((drv->can->RF0R & CAN_RF0R_FMP0) == 0) + drv->can->IER |= CAN_IER_FMPIE0; +} diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.h b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.h new file mode 100644 index 0000000..5263054 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/drv/can_stm32.h @@ -0,0 +1,167 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright © 2011 Nicolas Dandrimont <Nic...@cr...> + * + * --> + * + * \brief CAN hardware-specific definition + * + * \author Nicolas Dandrimont <Nic...@cr... + */ + +#ifndef DRV_CAN_STM32_H +#define DRV_CAN_STM32_H + +#include <hw/hw_cpufreq.h> + +#include "cfg/cfg_can.h" + +#include <cfg/compiler.h> + +#include <mware/event.h> + +#include <io/stm32_can.h> + +#undef CAN_BTR_BRP +#undef CAN_BTR_TS1 +#undef CAN_BTR_TS2 +#undef CAN_BTR_SJW +#define CAN_BTR_BRP(n) (n) //< BRP field macro. +#define CAN_BTR_TS1(n) ((n) << 16) //< TS1 field macro. +#define CAN_BTR_TS2(n) ((n) << 20) //< TS2 field macro. +#define CAN_BTR_SJW(n) ((n) << 24) //< SJW field macro. + + +typedef enum { + CAN_NOTSETUP = 0, + CAN_STOP, + CAN_STARTING, + CAN_READY, + CAN_SLEEP, +} can_state; + +typedef uint8_t can_errorflags; + +/** + * @brief Errors rate warning. + */ +#define CAN_LIMIT_WARNING 1 +/** + * @brief Errors rate error. + */ +#define CAN_LIMIT_ERROR 2 +/** + * @brief Bus off condition reached. + */ +#define CAN_BUS_OFF_ERROR 4 +/** + * @brief Framing error of some kind on the CAN bus. + */ +#define CAN_FRAMING_ERROR 8 +/** + * @brief Overflow in receive queue. + */ +#define CAN_OVERFLOW_ERROR 16 + +#define CAN_MAX_FILTERS 14 + +typedef struct _can_tx_frame { + uint8_t dlc:4; //< Data length + uint8_t rtr:1; //< Remote transmission request + uint8_t ide:1; //< Identifier type + union { + uint32_t sid:11; //< Standard identifier + uint32_t eid:29; //< Extended identifier + }; + union { + uint8_t data8[8]; //< Frame data + uint16_t data16[4]; //< Frame data + uint32_t data32[2]; //< Frame data + }; +} can_tx_frame; + +typedef struct _can_rx_frame { + uint8_t fmi; //< Filter Match ID + uint16_t time; //< Timestamp + uint8_t dlc:4; //< Data length + uint8_t rtr:1; //< Remote transmission reauest + uint8_t ide:1; //< Identifier type + union { + uint32_t sid:11; //< Standard identifier + uint32_t eid:29; //< Extended identifier + }; + union { + uint8_t data8[8]; //< Frame data + uint16_t data16[4]; //< Frame data + uint32_t data32[2]; //< Frame data + }; +} can_rx_frame; + +typedef struct _can_filter { + uint8_t mode:1; //< Filter mode (0: mask, 1: list) + uint8_t scale:1; //< Filter scale (0: 16 bit, 1: 32 bit) + uint8_t assignment:1; //< Filter assignment (0: fifo0, 1: fifo1). Forced to 0 + uint32_t register1; //< Filter register 1 + uint32_t register2; //< Filter register 2 +} can_filter; + +typedef struct _can_config { + uint32_t mcr; //< Contents of the MCR register + uint32_t btr; //< Contents of the BTR register + uint32_t n_filters; //< Number of filters + const can_filter *filters; //< Contents of the filters +} can_config; + +typedef struct _can_driver { + can_state state; //< Driver state + const can_config *config; //< Driver configuration data + can_errorflags error_flags; //< Driver error flags + Event rx_available_event; //< One or more frames become available + Event tx_empty_event; //< One or more TX slots become available + Event sleep_event; //< Entering sleep state + Event wakeup_event; //< Exiting sleep state + Event error_event; //< A CAN error happened + CAN *can; //< The CAN register structure +} can_driver; + +extern can_driver *CAND1; +extern CAN *CAN1; + +void can_hw_init(void); +void can_hw_start(can_driver *drv); +void can_hw_stop(can_driver *drv); +void can_hw_sleep(can_driver *drv); +void can_hw_wakeup(can_driver *drv); +bool can_hw_can_transmit(can_driver *drv); +bool can_hw_can_receive(can_driver *drv); +void can_hw_transmit(can_driver *drv, const can_tx_frame *frame); +void can_hw_receive(can_driver *drv, can_rx_frame *frame); + + +#endif /* DRV_CAN_STM32_H */ diff --git a/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/io/stm32_can.h b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/io/stm32_can.h new file mode 100644 index 0000000..c38327e --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/bertos/cpu/cortex-m3/io/stm32_can.h @@ -0,0 +1,1611 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright © 2010 Nicolas Dandrimont <Nic...@cr...> + * + * --> + * \author Nicolas Dandrimont <Nic...@cr...> + * + * \brief STM32F103xx CAN register definitions. + */ + +#ifndef IO_STM32_CAN_H +#define IO_STM32_CAN_H + +#include <cpu/types.h> + + +/** + * \{ + * \name CAN registers data structures + */ +/** + * CAN Transmit MailBox + */ +typedef struct +{ + volatile uint32_t TIR; + volatile uint32_t TDTR; + volatile uint32_t TDLR; + volatile uint32_t TDHR; +} CAN_TxMailBox; + +/** + * CAN Receive FIFO MailBox + */ +typedef struct +{ + volatile uint32_t RIR; + volatile uint32_t RDTR; + volatile uint32_t RDLR; + volatile uint32_t RDHR; +} CAN_FIFOMailBox; + +/** + * CAN Filter Register + */ +typedef struct +{ + volatile uint32_t FR1; + volatile uint32_t FR2; +} CAN_FilterRegister; + +/** + * CAN Register structure + */ +typedef struct +{ + volatile uint32_t MCR; + volatile uint32_t MSR; + volatile uint32_t TSR; + volatile uint32_t RF0R; + volatile uint32_t RF1R; + volatile uint32_t IER; + volatile uint32_t ESR; + volatile uint32_t BTR; + uint32_t RESERVED0[88]; + CAN_TxMailBox sTxMailBox[3]; + CAN_FIFOMailBox sFIFOMailBox[2]; + uint32_t RESERVED1[12]; + volatile uint32_t FMR; + volatile uint32_t FM1R; + uint32_t RESERVED2; + volatile uint32_t FS1R; + uint32_t RESERVED3; + volatile uint32_t FFA1R; + uint32_t RESERVED4; + volatile uint32_t FA1R; + uint32_t RESERVED5[8]; + CAN_FilterRegister sFilterRegister[14]; +} CAN; +/*\}*/ + +/** + * \{ + * \name CAN registers bit definitions + */ +/** + * \{ + * \name CAN control and status registers + */ +/** + * \{ + * \name CAN_MCR register + */ +#define CAN_MCR_INRQ ((uint16_t)0x0001) ///< Initialization Request +#define CAN_MCR_SLEEP ((uint16_t)0x0002) ///< Sleep Mode Request +#define CAN_MCR_TXFP ((uint16_t)0x0004) ///< Transmit FIFO Priority +#define CAN_MCR_RFLM ((uint16_t)0x0008) ///< Receive FIFO Locked Mode +#define CAN_MCR_NART ((uint16_t)0x0010) ///< No Automatic Retransmission +#define CAN_MCR_AWUM ((uint16_t)0x0020) ///< Automatic Wakeup Mode +#define CAN_MCR_ABOM ((uint16_t)0x0040) ///< Automatic Bus-Off Management +#define CAN_MCR_TTCM ((uint16_t)0x0080) ///< Time Triggered Communication Mode +#define CAN_MCR_RESET ((uint16_t)0x8000) ///< bxCAN software master reset +/*\}*/ + +/** + * \{ + * \name CAN_MSR register + */ +#define CAN_MSR_INAK ((uint16_t)0x0001) ///< Initialization Acknowledge +#define CAN_MSR_SLAK ((uint16_t)0x0002) ///< Sleep Acknowledge +#define CAN_MSR_ERRI ((uint16_t)0x0004) ///< Error Interrupt +#define CAN_MSR_WKUI ((uint16_t)0x0008) ///< Wakeup Interrupt +#define CAN_MSR_SLAKI ((uint16_t)0x0010) ///< Sleep Acknowledge Interrupt +#define CAN_MSR_TXM ((uint16_t)0x0100) ///< Transmit Mode +#define CAN_MSR_RXM ((uint16_t)0x0200) ///< Receive Mode +#define CAN_MSR_SAMP ((uint16_t)0x0400) ///< Last Sample Point +#define CAN_MSR_RX ((uint16_t)0x0800) ///< CAN Rx Signal +/*\}*/ + +/** + * \{ + * \name CAN_TSR register + */ +#define CAN_TSR_RQCP0 ((uint32_t)0x00000001) ///< Request Completed Mailbox0 +#define CAN_TSR_TXOK0 ((uint32_t)0x00000002) ///< Transmission OK of Mailbox0 +#define CAN_TSR_ALST0 ((uint32_t)0x00000004) ///< Arbitration Lost for Mailbox0 +#define CAN_TSR_TERR0 ((uint32_t)0x00000008) ///< Transmission Error of Mailbox0 +#define CAN_TSR_ABRQ0 ((uint32_t)0x00000080) ///< Abort Request for Mailbox0 +#define CAN_TSR_RQCP1 ((uint32_t)0x00000100) ///< Request Completed Mailbox1 +#define CAN_TSR_TXOK1 ((uint32_t)0x00000200) ///< Transmission OK of Mailbox1 +#define CAN_TSR_ALST1 ((uint32_t)0x00000400) ///< Arbitration Lost for Mailbox1 +#define CAN_TSR_TERR1 ((uint32_t)0x00000800) ///< Transmission Error of Mailbox1 +#define CAN_TSR_ABRQ1 ((uint32_t)0x00008000) ///< Abort Request for Mailbox 1 +#define CAN_TSR_RQCP2 ((uint32_t)0x00010000) ///< Request Completed Mailbox2 +#define CAN_TSR_TXOK2 ((uint32_t)0x00020000) ///< Transmission OK of Mailbox 2 +#define CAN_TSR_ALST2 ((uint32_t)0x00040000) ///< Arbitration Lost for mailbox 2 +#define CAN_TSR_TERR2 ((uint32_t)0x00080000) ///< Transmission Error of Mailbox 2 +#define CAN_TSR_ABRQ2 ((uint32_t)0x00800000) ///< Abort Request for Mailbox 2 +#define CAN_TSR_CODE ((uint32_t)0x03000000) ///< Mailbox Code + +#define CAN_TSR_TME ((uint32_t)0x1C000000) ///< TME[2:0] bits +#define CAN_TSR_TME0 ((uint32_t)0x04000000) ///< Transmit Mailbox 0 Empty +#define CAN_TSR_TME1 ((uint32_t)0x08000000) ///< Transmit Mailbox 1 Empty +#define CAN_TSR_TME2 ((uint32_t)0x10000000) ///< Transmit Mailbox 2 Empty + +#define CAN_TSR_LOW ((uint32_t)0xE0000000) ///< LOW[2:0] bits +#define CAN_TSR_LOW0 ((uint32_t)0x20000000) ///< Lowest Priority Flag for Mailbox 0 +#define CAN_TSR_LOW1 ((uint32_t)0x40000000) ///< Lowest Priority Flag for Mailbox 1 +#define CAN_TSR_LOW2 ((uint32_t)0x80000000) ///< Lowest Priority Flag for Mailbox 2 +/*\}*/ + +/** + * \{ + * \name CAN_RF0R register + */ +#define CAN_RF0R_FMP0 ((uint8_t)0x03) ///< FIFO 0 Message Pending +#define CAN_RF0R_FULL0 ((uint8_t)0x08) ///< FIFO 0 Full +#define CAN_RF0R_FOVR0 ((uint8_t)0x10) ///< FIFO 0 Overrun +#define CAN_RF0R_RFOM0 ((uint8_t)0x20) ///< Release FIFO 0 Output Mailbox +/*\}*/ + +/** + * \{ + * \name CAN_RF1R register + */ +#define CAN_RF1R_FMP1 ((uint8_t)0x03) ///< FIFO 1 Message Pending +#define CAN_RF1R_FULL1 ((uint8_t)0x08) ///< FIFO 1 Full +#define CAN_RF1R_FOVR1 ((uint8_t)0x10) ///< FIFO 1 Overrun +#define CAN_RF1R_RFOM1 ((uint8_t)0x20) ///< Release FIFO 1 Output Mailbox +/*\}*/ + +/** + * \{ + * \name CAN_IER register + **/ +#define CAN_IER_TMEIE ((uint32_t)0x00000001) ///< Transmit Mailbox Empty Interrupt Enable +#define CAN_IER_FMPIE0 ((uint32_t)0x00000002) ///< FIFO Message Pending Interrupt Enable +#define CAN_IER_FFIE0 ((uint32_t)0x00000004) ///< FIFO Full Interrupt Enable +#define CAN_IER_FOVIE0 ((uint32_t)0x00000008) ///< FIFO Overrun Interrupt Enable +#define CAN_IER_FMPIE1 ((uint32_t)0x00000010) ///< FIFO Message Pending Interrupt Enable +#define CAN_IER_FFIE1 ((uint32_t)0x00000020) ///< FIFO Full Interrupt Enable +#define CAN_IER_FOVIE1 ((uint32_t)0x00000040) ///< FIFO Overrun Interrupt Enable +#define CAN_IER_EWGIE ((uint32_t)0x00000100) ///< Error Warning Interrupt Enable +#define CAN_IER_EPVIE ((uint32_t)0x00000200) ///< Error Passive Interrupt Enable +#define CAN_IER_BOFIE ((uint32_t)0x00000400) ///< Bus-Off Interrupt Enable +#define CAN_IER_LECIE ((uint32_t)0x00000800) ///< Last Error Code Interrupt Enable +#define CAN_IER_ERRIE ((uint32_t)0x00008000) ///< Error Interrupt Enable +#define CAN_IER_WKUIE ((uint32_t)0x00010000) ///< Wakeup Interrupt Enable +#define CAN_IER_SLKIE ((uint32_t)0x00020000) ///< Sleep Interrupt Enable +/*\}*/ + +/** + * \{ + * \name CAN_ESR register + */ +#define CAN_ESR_EWGF ((uint32_t)0x00000001) ///< Error Warning Flag +#define CAN_ESR_EPVF ((uint32_t)0x00000002) ///< Error Passive Flag +#define CAN_ESR_BOFF ((uint32_t)0x00000004) ///< Bus-Off Flag + +#define CAN_ESR_LEC ((uint32_t)0x00000070) ///< LEC[2:0] bits (Last Error Code) +#define CAN_ESR_LEC_0 ((uint32_t)0x00000010) ///< Bit 0 +#define CAN_ESR_LEC_1 ((uint32_t)0x00000020) ///< Bit 1 +#define CAN_ESR_LEC_2 ((uint32_t)0x00000040) ///< Bit 2 + +#define CAN_ESR_TEC ((uint32_t)0x00FF0000) ///< Least significant byte of the 9-bit Transmit Error Counter +#define CAN_ESR_REC ((uint32_t)0xFF000000) ///< Receive Error Counter +/*\}*/ + +/** + * \{ + * \name CAN_BTR register + */ +#define CAN_BTR_BRP ((uint32_t)0x000003FF) ///< Baud Rate Prescaler +#define CAN_BTR_TS1 ((uint32_t)0x000F0000) ///< Time Segment 1 +#define CAN_BTR_TS2 ((uint32_t)0x00700000) ///< Time Segment 2 +#define CAN_BTR_SJW ((uint32_t)0x03000000) ///< Resynchronization Jump Width +#define CAN_BTR_LBKM ((uint32_t)0x40000000) ///< Loop Back Mode (Debug) +#define CAN_BTR_SILM ((uint32_t)0x80000000) ///< Silent Mode +/*\}*/ +/*\}*/ + +/** + * \{ + * \name Mailbox registers + */ +/** + * \{ + * \name CAN_TI0R register + */ +#define CAN_TI0R_TXRQ ((uint32_t)0x00000001) ///< Transmit Mailbox Request +#define CAN_TI0R_RTR ((uint32_t)0x00000002) ///< Remote Transmission Request +#define CAN_TI0R_IDE ((uint32_t)0x00000004) ///< Identifier Extension +#define CAN_TI0R_EXID ((uint32_t)0x001FFFF8) ///< Extended Identifier +#define CAN_TI0R_STID ((uint32_t)0xFFE00000) ///< Standard Identifier or Extended Identifier +/*\}*/ + +/** + * \{ + * \name CAN_TDT0R register + */ +#define CAN_TDT0R_DLC ((uint32_t)0x0000000F) ///< Data Length Code +#define CAN_TDT0R_TGT ((uint32_t)0x00000100) ///< Transmit Global Time +#define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000) ///< Message Time Stamp +/*\}*/ + +/** + * \{ + * \name CAN_TDL0R register + */ +#define CAN_TDL0R_DATA0 ((uint32_t)0x000000FF) ///< Data byte 0 +#define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00) ///< Data byte 1 +#define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000) ///< Data byte 2 +#define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000) ///< Data byte 3 +/*\}*/ + +/** + * \{ + * \name CAN_TDH0R register + */ +#define CAN_TDH0R_DATA4 ((uint32_t)0x000000FF) ///< Data byte 4 +#define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00) ///< Data byte 5 +#define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000) ///< Data byte 6 +#define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000) ///< Data byte 7 +/*\}*/ + +/** + * \{ + * \name CAN_TI1R register + */ +#define CAN_TI1R_TXRQ ((uint32_t)0x00000001) ///< Transmit Mailbox Request +#define CAN_TI1R_RTR ((uint32_t)0x00000002) ///< Remote Transmission Request +#define CAN_TI1R_IDE ((uint32_t)0x00000004) ///< Identifier Extension +#define CAN_TI1R_EXID ((uint32_t)0x001FFFF8) ///< Extended Identifier +#define CAN_TI1R_STID ((uint32_t)0xFFE00000) ///< Standard Identifier or Extended Identifier +/*\}*/ + +/** + * \{ + * \name CAN_TDT1R register + */ +#define CAN_TDT1R_DLC ((uint32_t)0x0000000F) ///< Data Length Code +#define CAN_TDT1R_TGT ((uint32_t)0x00000100) ///< Transmit Global Time +#define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000) ///< Message Time Stamp +/*\}*/ + +/** + * \{ + * \name CAN_TDL1R register + */ +#define CAN_TDL1R_DATA0 ((uint32_t)0x000000FF) ///< Data byte 0 +#define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00) ///< Data byte 1 +#define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000) ///< Data byte 2 +#define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000) ///< Data byte 3 +/*\}*/ + +/** + * \{ + * \name CAN_TDH1R register + */ +#define CAN_TDH1R_DATA4 ((uint32_t)0x000000FF) ///< Data byte 4 +#define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00) ///< Data byte 5 +#define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000) ///< Data byte 6 +#define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000) ///< Data byte 7 +/*\}*/ + +/** + * \{ + * \name CAN_TI2R register + */ +#define CAN_TI2R_TXRQ ((uint32_t)0x00000001) ///< Transmit Mailbox Request +#define CAN_TI2R_RTR ((uint32_t)0x00000002) ///< Remote Transmission Request +#define CAN_TI2R_IDE ((uint32_t)0x00000004) ///< Identifier Extension +#define CAN_TI2R_EXID ((uint32_t)0x001FFFF8) ///< Extended identifier +#define CAN_TI2R_STID ((uint32_t)0xFFE00000) ///< Standard Identifier or Extended Identifier +/*\}*/ + +/** + * \{ + * \name CAN_TDT2R register + */ +#define CAN_TDT2R_DLC ((uint32_t)0x0000000F) ///< Data Length Code +#define CAN_TDT2R_TGT ((uint32_t)0x00000100) ///< Transmit Global Time +#define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000) ///< Message Time Stamp +/*\}*/ + +/** + * \{ + * \name CAN_TDL2R register + */ +#define CAN_TDL2R_DATA0 ((uint32_t)0x000000FF) ///< Data byte 0 +#define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00) ///< Data byte 1 +#define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000) ///< Data byte 2 +#define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000) ///< Data byte 3 +/*\}*/ + +/** + * \{ + * \name CAN_TDH2R register + */ +#define CAN_TDH2R_DATA4 ((uint32_t)0x000000FF) ///< Data byte 4 +#define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00) ///< Data byte 5 +#define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000) ///< Data byte 6 +#define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000) ///< Data byte 7 +/*\}*/ + +/** + * \{ + * \name CAN_RI0R register + */ +#define CAN_RI0R_RTR ((uint32_t)0x00000002) ///< Remote Transmission Request +#define CAN_RI0R_IDE ((uint32_t)0x00000004) ///< Identifier Extension +#define CAN_RI0R_EXID ((uint32_t)0x001FFFF8) ///< Extended Identifier +#define CAN_RI0R_STID ((uint32_t)0xFFE00000) ///< Standard Identifier or Extended Identifier +/*\}*/ + +/** + * \{ + * \name CAN_RDT0R register + */ +#define CAN_RDT0R_DLC ((uint32_t)0x0000000F) ///< Data Length Code +#define CAN_RDT0R_FMI ((uint32_t)0x0000FF00) ///< Filter Match Index +#define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000) ///< Message Time Stamp +/*\}*/ + +/** + * \{ + * \name CAN_RDL0R register + */ +#define CAN_RDL0R_DATA0 ((uint32_t)0x000000FF) ///< Data byte 0 +#define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00) ///< Data byte 1 +#define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000) ///< Data byte 2 +#define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000) ///< Data byte 3 +/*\}*/ + +/** + * \{ + * \name CAN_RDH0R register + */ +#define CAN_RDH0R_DATA4 ((uint32_t)0x000000FF) ///< Data byte 4 +#define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00) ///< Data byte 5 +#define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000) ///< Data byte 6 +#define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000) ///< Data byte 7 +/*\}*/ + +/** + * \{ + * \name CAN_RI1R register + */ +#define CAN_RI1R_RTR ((uint32_t)0x00000002) ///< Remote Transmission Request +#define CAN_RI1R_IDE ((uint32_t)0x00000004) ///< Identifier Extension +#define CAN_RI1R_EXID ((uint32_t)0x001FFFF8) ///< Extended identifier +#define CAN_RI1R_STID ((uint32_t)0xFFE00000) ///< Standard Identifier or Extended Identifier +/*\}*/ + +/** + * \{ + * \name CAN_RDT1R register + */ +#define CAN_RDT1R_DLC ((uint32_t)0x0000000F) ///< Data Length Code +#define CAN_RDT1R_FMI ((uint32_t)0x0000FF00) ///< Filter Match Index +#define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000) ///< Message Time Stamp +/*\}*/ + +/** + * \{ + * \name CAN_RDL1R register + */ +#define CAN_RDL1R_DATA0 ((uint32_t)0x000000FF) ///< Data byte 0 +#define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00) ///< Data byte 1 +#define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000) ///< Data byte 2 +#define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000) ///< Data byte 3 +/*\}*/ + +/** + * \{ + * \name CAN_RDH1R register + */ +#define CAN_RDH1R_DATA4 ((uint32_t)0x000000FF) ///< Data byte 4 +#define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00) ///< Data byte 5 +#define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000) ///< Data byte 6 +#define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000) ///< Data byte 7 +/*\}*/ +/*\}*/ + +/** + * \{ + * \name CAN filter registers + */ +/** + * \{ + * \name CAN_FMR register + */ +#define CAN_FMR_FINIT ((uint8_t)0x01) ///< Filter Init Mode +/*\}*/ + +/** + * \{ + * \name CAN_FM1R register + */ +#define CAN_FM1R_FBM ((uint16_t)0x3FFF) ///< Filter Mode +#define CAN_FM1R_FBM0 ((uint16_t)0x0001) ///< Filter Init Mode bit 0 +#define CAN_FM1R_FBM1 ((uint16_t)0x0002) ///< Filter Init Mode bit 1 +#define CAN_FM1R_FBM2 ((uint16_t)0x0004) ///< Filter Init Mode bit 2 +#define CAN_FM1R_FBM3 ((uint16_t)0x0008) ///< Filter Init Mode bit 3 +#define CAN_FM1R_FBM4 ((uint16_t)0x0010) ///< Filter Init Mode bit 4 +#define CAN_FM1R_FBM5 ((uint16_t)0x0020) ///< Filter Init Mode bit 5 +#define CAN_FM1R_FBM6 ((uint16_t)0x0040) ///< Filter Init Mode bit 6 +#define CAN_FM1R_FBM7 ((uint16_t)0x0080) ///< Filter Init Mode bit 7 +#define CAN_FM1R_FBM8 ((uint16_t)0x0100) ///< Filter Init Mode bit 8 +#define CAN_FM1R_FBM9 ((uint16_t)0x0200) ///< Filter Init Mode bit 9 +#define CAN_FM1R_FBM10 ((uint16_t)0x0400) ///< Filter Init Mode bit 10 +#define CAN_FM1R_FBM11 ((uint16_t)0x0800) ///< Filter Init Mode bit 11 +#define CAN_FM1R_FBM12 ((uint16_t)0x1000) ///< Filter Init Mode bit 12 +#define CAN_FM1R_FBM13 ((uint16_t)0x2000) ///< Filter Init Mode bit 13 +/*\}*/ + +/** + * \{ + * \name CAN_FS1R register + */ +#define CAN_FS1R_FSC ((uint16_t)0x3FFF) ///< Filter Scale Configuration +#define CAN_FS1R_FSC0 ((uint16_t)0x0001) ///< Filter Scale Configuration bit 0 +#define CAN_FS1R_FSC1 ((uint16_t)0x0002) ///< Filter Scale Configuration bit 1 +#define CAN_FS1R_FSC2 ((uint16_t)0x0004) ///< Filter Scale Configuration bit 2 +#define CAN_FS1R_FSC3 ((uint16_t)0x0008) ///< Filter Scale Configuration bit 3 +#define CAN_FS1R_FSC4 ((uint16_t)0x0010) ///< Filter Scale Configuration bit 4 +#define CAN_FS1R_FSC5 ((uint16_t)0x0020) ///< Filter Scale Configuration bit 5 +#define CAN_FS1R_FSC6 ((uint16_t)0x0040) ///< Filter Scale Configuration bit 6 +#define CAN_FS1R_FSC7 ((uint16_t)0x0080) ///< Filter Scale Configuration bit 7 +#define CAN_FS1R_FSC8 ((uint16_t)0x0100) ///< Filter Scale Configuration bit 8 +#define CAN_FS1R_FSC9 ((uint16_t)0x0200) ///< Filter Scale Configuration bit 9 +#define CAN_FS1R_FSC10 ((uint16_t)0x0400) ///< Filter Scale Configuration bit 10 +#define CAN_FS1R_FSC11 ((uint16_t)0x0800) ///< Filter Scale Configuration bit 11 +#define CAN_FS1R_FSC12 ((uint16_t)0x1000) ///< Filter Scale Configuration bit 12 +#define CAN_FS1R_FSC13 ((uint16_t)0x2000) ///< Filter Scale Configuration bit 13 +/*\}*/ + +/** + * \{ + * \name CAN_FFA1R register + */ +#define CAN_FFA1R_FFA ((uint16_t)0x3FFF) ///< Filter FIFO Assignment +#define CAN_FFA1R_FFA0 ((uint16_t)0x0001) ///< Filter FIFO Assignment for Filter 0 +#define CAN_FFA1R_FFA1 ((uint16_t)0x0002) ///< Filter FIFO Assignment for Filter 1 +#define CAN_FFA1R_FFA2 ((uint16_t)0x0004) ///< Filter FIFO Assignment for Filter 2 +#define CAN_FFA1R_FFA3 ((uint16_t)0x0008) ///< Filter FIFO Assignment for Filter 3 +#define CAN_FFA1R_FFA4 ((uint16_t)0x0010) ///< Filter FIFO Assignment for Filter 4 +#define CAN_FFA1R_FFA5 ((uint16_t)0x0020) ///< Filter FIFO Assignment for Filter 5 +#define CAN_FFA1R_FFA6 ((uint16_t)0x0040) ///< Filter FIFO Assignment for Filter 6 +#define CAN_FFA1R_FFA7 ((uint16_t)0x0080) ///< Filter FIFO Assignment for Filter 7 +#define CAN_FFA1R_FFA8 ((uint16_t)0x0100) ///< Filter FIFO Assignment for Filter 8 +#define CAN_FFA1R_FFA9 ((uint16_t)0x0200) ///< Filter FIFO Assignment for Filter 9 +#define CAN_FFA1R_FFA10 ((uint16_t)0x0400) ///< Filter FIFO Assignment for Filter 10 +#define CAN_FFA1R_FFA11 ((uint16_t)0x0800) ///< Filter FIFO Assignment for Filter 11 +#define CAN_FFA1R_FFA12 ((uint16_t)0x1000) ///< Filter FIFO Assignment for Filter 12 +#define CAN_FFA1R_FFA13 ((uint16_t)0x2000) ///< Filter FIFO Assignment for Filter 13 +/*\}*/ + +/** + * \{ + * \name CAN_FA1R register + */ +#define CAN_FA1R_FACT ((uint16_t)0x3FFF) ///< Filter Active +#define CAN_FA1R_FACT0 ((uint16_t)0x0001) ///< Filter 0 Active +#define CAN_FA1R_FACT1 ((uint16_t)0x0002) ///< Filter 1 Active +#define CAN_FA1R_FACT2 ((uint16_t)0x0004) ///< Filter 2 Active +#define CAN_FA1R_FACT3 ((uint16_t)0x0008) ///< Filter 3 Active +#define CAN_FA1R_FACT4 ((uint16_t)0x0010) ///< Filter 4 Active +#define CAN_FA1R_FACT5 ((uint16_t)0x0020) ///< Filter 5 Active +#define CAN_FA1R_FACT6 ((uint16_t)0x0040) ///< Filter 6 Active +#define CAN_FA1R_FACT7 ((uint16_t)0x0080) ///< Filter 7 Active +#define CAN_FA1R_FACT8 ((uint16_t)0x0100) ///< Filter 8 Active +#define CAN_FA1R_FACT9 ((uint16_t)0x0200) ///< Filter 9 Active +#define CAN_FA1R_FACT10 ((uint16_t)0x0400) ///< Filter 10 Active +#define CAN_FA1R_FACT11 ((uint16_t)0x0800) ///< Filter 11 Active +#define CAN_FA1R_FACT12 ((uint16_t)0x1000) ///< Filter 12 Active +#define CAN_FA1R_FACT13 ((uint16_t)0x2000) ///< Filter 13 Active +/*\}*/ + +/** + * \{ + * \name CAN_F0R1 register + */ +#define CAN_F0R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F0R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F0R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F0R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F0R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F0R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F0R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F0R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F0R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F0R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F0R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F0R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F0R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F0R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F0R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F0R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F0R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F0R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F0R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F0R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F0R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F0R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F0R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_F0R1_FB23 ((uint32_t)0x00800000) ///< Filter bit 23 +#define CAN_F0R1_FB24 ((uint32_t)0x01000000) ///< Filter bit 24 +#define CAN_F0R1_FB25 ((uint32_t)0x02000000) ///< Filter bit 25 +#define CAN_F0R1_FB26 ((uint32_t)0x04000000) ///< Filter bit 26 +#define CAN_F0R1_FB27 ((uint32_t)0x08000000) ///< Filter bit 27 +#define CAN_F0R1_FB28 ((uint32_t)0x10000000) ///< Filter bit 28 +#define CAN_F0R1_FB29 ((uint32_t)0x20000000) ///< Filter bit 29 +#define CAN_F0R1_FB30 ((uint32_t)0x40000000) ///< Filter bit 30 +#define CAN_F0R1_FB31 ((uint32_t)0x80000000) ///< Filter bit 31 +/*\}*/ + +/** + * \{ + * \name CAN_F1R1 register + */ +#define CAN_F1R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F1R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F1R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F1R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F1R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F1R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F1R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F1R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F1R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F1R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F1R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F1R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F1R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F1R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F1R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F1R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F1R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F1R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F1R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F1R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F1R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F1R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F1R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_F1R1_FB23 ((uint32_t)0x00800000) ///< Filter bit 23 +#define CAN_F1R1_FB24 ((uint32_t)0x01000000) ///< Filter bit 24 +#define CAN_F1R1_FB25 ((uint32_t)0x02000000) ///< Filter bit 25 +#define CAN_F1R1_FB26 ((uint32_t)0x04000000) ///< Filter bit 26 +#define CAN_F1R1_FB27 ((uint32_t)0x08000000) ///< Filter bit 27 +#define CAN_F1R1_FB28 ((uint32_t)0x10000000) ///< Filter bit 28 +#define CAN_F1R1_FB29 ((uint32_t)0x20000000) ///< Filter bit 29 +#define CAN_F1R1_FB30 ((uint32_t)0x40000000) ///< Filter bit 30 +#define CAN_F1R1_FB31 ((uint32_t)0x80000000) ///< Filter bit 31 +/*\}*/ + +/** + * \{ + * \name CAN_F2R1 register + */ +#define CAN_F2R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F2R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F2R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F2R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F2R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F2R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F2R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F2R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F2R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F2R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F2R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F2R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F2R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F2R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F2R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F2R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F2R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F2R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F2R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F2R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F2R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F2R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F2R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_F2R1_FB23 ((uint32_t)0x00800000) ///< Filter bit 23 +#define CAN_F2R1_FB24 ((uint32_t)0x01000000) ///< Filter bit 24 +#define CAN_F2R1_FB25 ((uint32_t)0x02000000) ///< Filter bit 25 +#define CAN_F2R1_FB26 ((uint32_t)0x04000000) ///< Filter bit 26 +#define CAN_F2R1_FB27 ((uint32_t)0x08000000) ///< Filter bit 27 +#define CAN_F2R1_FB28 ((uint32_t)0x10000000) ///< Filter bit 28 +#define CAN_F2R1_FB29 ((uint32_t)0x20000000) ///< Filter bit 29 +#define CAN_F2R1_FB30 ((uint32_t)0x40000000) ///< Filter bit 30 +#define CAN_F2R1_FB31 ((uint32_t)0x80000000) ///< Filter bit 31 +/*\}*/ + +/** + * \{ + * \name CAN_F3R1 register + */ +#define CAN_F3R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F3R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F3R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F3R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F3R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F3R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F3R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F3R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F3R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F3R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F3R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F3R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F3R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F3R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F3R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F3R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F3R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F3R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F3R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F3R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F3R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F3R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F3R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_F3R1_FB23 ((uint32_t)0x00800000) ///< Filter bit 23 +#define CAN_F3R1_FB24 ((uint32_t)0x01000000) ///< Filter bit 24 +#define CAN_F3R1_FB25 ((uint32_t)0x02000000) ///< Filter bit 25 +#define CAN_F3R1_FB26 ((uint32_t)0x04000000) ///< Filter bit 26 +#define CAN_F3R1_FB27 ((uint32_t)0x08000000) ///< Filter bit 27 +#define CAN_F3R1_FB28 ((uint32_t)0x10000000) ///< Filter bit 28 +#define CAN_F3R1_FB29 ((uint32_t)0x20000000) ///< Filter bit 29 +#define CAN_F3R1_FB30 ((uint32_t)0x40000000) ///< Filter bit 30 +#define CAN_F3R1_FB31 ((uint32_t)0x80000000) ///< Filter bit 31 +/*\}*/ + +/** + * \{ + * \name CAN_F4R1 register + */ +#define CAN_F4R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F4R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F4R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F4R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F4R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F4R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F4R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F4R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F4R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F4R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F4R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F4R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F4R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F4R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F4R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F4R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F4R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F4R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F4R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F4R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F4R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F4R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F4R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_F4R1_FB23 ((uint32_t)0x00800000) ///< Filter bit 23 +#define CAN_F4R1_FB24 ((uint32_t)0x01000000) ///< Filter bit 24 +#define CAN_F4R1_FB25 ((uint32_t)0x02000000) ///< Filter bit 25 +#define CAN_F4R1_FB26 ((uint32_t)0x04000000) ///< Filter bit 26 +#define CAN_F4R1_FB27 ((uint32_t)0x08000000) ///< Filter bit 27 +#define CAN_F4R1_FB28 ((uint32_t)0x10000000) ///< Filter bit 28 +#define CAN_F4R1_FB29 ((uint32_t)0x20000000) ///< Filter bit 29 +#define CAN_F4R1_FB30 ((uint32_t)0x40000000) ///< Filter bit 30 +#define CAN_F4R1_FB31 ((uint32_t)0x80000000) ///< Filter bit 31 +/*\}*/ + +/** + * \{ + * \name CAN_F5R1 register + */ +#define CAN_F5R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F5R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F5R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F5R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F5R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F5R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F5R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F5R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F5R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F5R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F5R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F5R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F5R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F5R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F5R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F5R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F5R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F5R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F5R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F5R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F5R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F5R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F5R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_F5R1_FB23 ((uint32_t)0x00800000) ///< Filter bit 23 +#define CAN_F5R1_FB24 ((uint32_t)0x01000000) ///< Filter bit 24 +#define CAN_F5R1_FB25 ((uint32_t)0x02000000) ///< Filter bit 25 +#define CAN_F5R1_FB26 ((uint32_t)0x04000000) ///< Filter bit 26 +#define CAN_F5R1_FB27 ((uint32_t)0x08000000) ///< Filter bit 27 +#define CAN_F5R1_FB28 ((uint32_t)0x10000000) ///< Filter bit 28 +#define CAN_F5R1_FB29 ((uint32_t)0x20000000) ///< Filter bit 29 +#define CAN_F5R1_FB30 ((uint32_t)0x40000000) ///< Filter bit 30 +#define CAN_F5R1_FB31 ((uint32_t)0x80000000) ///< Filter bit 31 +/*\}*/ + +/** + * \{ + * \name CAN_F6R1 register + */ +#define CAN_F6R1_FB0 ((uint32_t)0x00000001) ///< Filter bit 0 +#define CAN_F6R1_FB1 ((uint32_t)0x00000002) ///< Filter bit 1 +#define CAN_F6R1_FB2 ((uint32_t)0x00000004) ///< Filter bit 2 +#define CAN_F6R1_FB3 ((uint32_t)0x00000008) ///< Filter bit 3 +#define CAN_F6R1_FB4 ((uint32_t)0x00000010) ///< Filter bit 4 +#define CAN_F6R1_FB5 ((uint32_t)0x00000020) ///< Filter bit 5 +#define CAN_F6R1_FB6 ((uint32_t)0x00000040) ///< Filter bit 6 +#define CAN_F6R1_FB7 ((uint32_t)0x00000080) ///< Filter bit 7 +#define CAN_F6R1_FB8 ((uint32_t)0x00000100) ///< Filter bit 8 +#define CAN_F6R1_FB9 ((uint32_t)0x00000200) ///< Filter bit 9 +#define CAN_F6R1_FB10 ((uint32_t)0x00000400) ///< Filter bit 10 +#define CAN_F6R1_FB11 ((uint32_t)0x00000800) ///< Filter bit 11 +#define CAN_F6R1_FB12 ((uint32_t)0x00001000) ///< Filter bit 12 +#define CAN_F6R1_FB13 ((uint32_t)0x00002000) ///< Filter bit 13 +#define CAN_F6R1_FB14 ((uint32_t)0x00004000) ///< Filter bit 14 +#define CAN_F6R1_FB15 ((uint32_t)0x00008000) ///< Filter bit 15 +#define CAN_F6R1_FB16 ((uint32_t)0x00010000) ///< Filter bit 16 +#define CAN_F6R1_FB17 ((uint32_t)0x00020000) ///< Filter bit 17 +#define CAN_F6R1_FB18 ((uint32_t)0x00040000) ///< Filter bit 18 +#define CAN_F6R1_FB19 ((uint32_t)0x00080000) ///< Filter bit 19 +#define CAN_F6R1_FB20 ((uint32_t)0x00100000) ///< Filter bit 20 +#define CAN_F6R1_FB21 ((uint32_t)0x00200000) ///< Filter bit 21 +#define CAN_F6R1_FB22 ((uint32_t)0x00400000) ///< Filter bit 22 +#define CAN_... [truncated message content] |
From: Nicolas D. <Ba...@us...> - 2011-03-12 10:35:54
|
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 85ee8e9f8f4b8df9a2b2efbd4848a9ee9952ec4e (commit) from 3846984ca2ae71b7c36fed298726cdef90f60080 (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 85ee8e9f8f4b8df9a2b2efbd4848a9ee9952ec4e Author: Nicolas Dandrimont <Nic...@cr...> Date: Sat Mar 12 11:29:00 2011 +0100 Import USB-CAN firmware ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/USB_CAN/Firmware/Makefile b/elec/boards/USB_CAN/Firmware/Makefile new file mode 100644 index 0000000..d77a575 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/Makefile @@ -0,0 +1,17 @@ +# +# Copyright 2009 Develer S.r.l. (http://www.develer.com/) +# All rights reserved. +# +# Author: Lorenzo Berni <du...@de...> +# + +# Set to 1 for verbose build output, 0 for terse output +V := 0 + +default: all + +include bertos/config.mk + +include usb_can/usb_can.mk + +include bertos/rules.mk diff --git a/elec/boards/USB_CAN/Firmware/VERSION b/elec/boards/USB_CAN/Firmware/VERSION new file mode 100644 index 0000000..e520145 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/VERSION @@ -0,0 +1 @@ +BeRTOS 2.6.99 [local copy] diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/crc.c b/elec/boards/USB_CAN/Firmware/bertos/algo/crc.c new file mode 100644 index 0000000..d4293f9 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/crc.c @@ -0,0 +1,102 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/) + * Copyright 1999 Bernie Innocenti <be...@co...> + * + * --> + * + * \brief CRC table and support routines + * + * \author Bernie Innocenti <be...@co...> + */ + +#include "crc.h" + +/* + * The boot on AVR cpu is placed at the end of flash memory, but the avr + * address memory by byte and the pointers are 16bits long, so we are able + * to address 64Kbyte memory max. For this reason we can't read the crctab + * from flash, because it is placed at the end of memory. This is true every + * time we have an AVR cpu with more that 64Kbyte of flash. To fix this problem + * we let the compiler copy the table in RAM at startup. Obviously this solution + * is not efficent, but for now this is the only way. + */ +#if CPU_HARVARD && !(defined(ARCH_BOOT) && (ARCH & ARCH_BOOT)) + #define CRC_TABLE const uint16_t PROGMEM crc16tab[256] +#else + #define CRC_TABLE const uint16_t crc16tab[256] +#endif + +/** + * crctab calculated by Mark G. Mendel, Network Systems Corporation + */ +CRC_TABLE = { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, + 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, + 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, + 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, + 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, + 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, + 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, + 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, + 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, + 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, + 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, + 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, + 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, + 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, + 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, + 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, + 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, + 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, + 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, + 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, + 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, + 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, + 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 +}; + +uint16_t crc16(uint16_t crc, const void *buffer, size_t len) +{ + const unsigned char *buf = (const unsigned char *)buffer; + while(len--) + crc = UPDCRC16(*buf++, crc); + + return crc; +} + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/crc.h b/elec/boards/USB_CAN/Firmware/bertos/algo/crc.h new file mode 100644 index 0000000..c5c1eef --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/crc.h @@ -0,0 +1,115 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2003, 2004 Develer S.r.l. (http://www.develer.com/) + * Copyright 1999 Bernie Innocenti <be...@co...> + * + * --> + * + * \brief Cyclic Redundancy Check 16 (CRC). This algorithm is the one used by the XMODEM protocol. + * + * \note This algorithm is incompatible with the CCITT-CRC16. + * + * This code is based on the article Copyright 1986 Stephen Satchell. + * + * Programmers may incorporate any or all code into their programs, + * giving proper credit within the source. Publication of the + * source routines is permitted so long as proper credit is given + * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, + * Omen Technology. + * + * \author Bernie Innocenti <be...@co...> + * + * $WIZ$ module_name = "crc16" + */ + +#ifndef ALGO_CRC_H +#define ALGO_CRC_H + +#include "cfg/cfg_arch.h" + +#include <cfg/compiler.h> +#include <cpu/pgm.h> + +EXTERN_C_BEGIN + +/* CRC table */ +extern const uint16_t crc16tab[256]; + + +/** + * \brief Compute the updated CRC16 value for one octet (macro version) + * + * \note This version is only intended for old/broken compilers. + * Use the inline function in new code. + * + * \param c New octet (range 0-255) + * \param oldcrc Previous CRC16 value (referenced twice, beware of side effects) + */ +#if CPU_HARVARD && !(defined(ARCH_BOOT) && (ARCH & ARCH_BOOT)) + #define UPDCRC16(c, oldcrc) (pgm_read_uint16_t(&crc16tab[((oldcrc) >> 8) ^ ((unsigned char)(c))]) ^ ((oldcrc) << 8)) +#else + #define UPDCRC16(c, oldcrc) ((crc16tab[((oldcrc) >> 8) ^ ((unsigned char)(c))]) ^ ((oldcrc) << 8)) +#endif + +/** CRC-16 init value */ +#define CRC16_INIT_VAL ((uint16_t)0) + +#ifdef INLINE +/** + * \brief Compute the updated CRC16 value for one octet (inline version) + */ +INLINE uint16_t updcrc16(uint8_t c, uint16_t oldcrc) +{ +#if CPU_HARVARD && !(defined(ARCH_BOOT) && (ARCH & ARCH_BOOT)) + return pgm_read_uint16_t(&crc16tab[(oldcrc >> 8) ^ c]) ^ (oldcrc << 8); +#else + return crc16tab[(oldcrc >> 8) ^ c] ^ (oldcrc << 8); +#endif +} +#endif // INLINE + + +/** + * This function implements the CRC 16 calculation on a buffer. + * + * \param crc Current CRC16 value. + * \param buf The buffer to perform CRC calculation on. + * \param len The length of the Buffer. + * + * \return The updated CRC16 value. + */ +extern uint16_t crc16(uint16_t crc, const void *buf, size_t len); + +int crc_testSetup(void); +int crc_testRun(void); +int crc_testTearDown(void); + +EXTERN_C_END + +#endif /* ALGO_CRC_H */ diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/crc_ccitt.c b/elec/boards/USB_CAN/Firmware/bertos/algo/crc_ccitt.c new file mode 100644 index 0000000..feaf624 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/crc_ccitt.c @@ -0,0 +1,83 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2009 Develer S.r.l. (http://www.develer.com/) + * + * --> + * + * \brief CRC-CCITT table and support routines + * + * \author Francesco Sacchi <ba...@de...> + */ + +#include "crc_ccitt.h" + +const uint16_t PROGMEM crc_ccitt_tab[256] = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78, +}; + +uint16_t crc_ccitt(uint16_t crc, const void *buffer, size_t len) +{ + const unsigned char *buf = (const unsigned char *)buffer; + while (len--) + crc = updcrc_ccitt(*buf++, crc); + + return crc; +} + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/crc_ccitt.h b/elec/boards/USB_CAN/Firmware/bertos/algo/crc_ccitt.h new file mode 100644 index 0000000..240e6e1 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/crc_ccitt.h @@ -0,0 +1,78 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2009 Develer S.r.l. (http://www.develer.com/) + * + * --> + * + * \brief CCITT Cyclic Redundancy Check (CRC-CCITT). + * + * \note This algorithm is incompatible with the CRC16. + * + * \author Francesco Sacchi <ba...@de...> + * + * $WIZ$ module_name = "crc-ccitt" + */ + +#ifndef ALGO_CRC_CCITT_H +#define ALGO_CRC_CCITT_H + +#include <cfg/compiler.h> +#include <cpu/pgm.h> + +EXTERN_C_BEGIN + +/* CRC table */ +extern const uint16_t crc_ccitt_tab[256]; + +/** + * \brief Compute the updated CRC-CCITT value for one octet (inline version) + */ +INLINE uint16_t updcrc_ccitt(uint8_t c, uint16_t oldcrc) +{ + return (oldcrc >> 8) ^ pgm_read16(&crc_ccitt_tab[(oldcrc ^ c) & 0xff]); +} + +/** CRC-CCITT init value */ +#define CRC_CCITT_INIT_VAL ((uint16_t)0xFFFF) + + +/** + * This function implements the CRC-CCITT calculation on a buffer. + * + * \param crc Current CRC-CCITT value. + * \param buf The buffer to perform CRC calculation on. + * \param len The length of the Buffer. + * + * \return The updated CRC-CCITT value. + */ +extern uint16_t crc_ccitt(uint16_t crc, const void *buf, size_t len); + +EXTERN_C_END + +#endif /* ALGO_CRC_CCITT_H */ diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/crc_test.c b/elec/boards/USB_CAN/Firmware/bertos/algo/crc_test.c new file mode 100644 index 0000000..1a93e3b --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/crc_test.c @@ -0,0 +1,75 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2003,2004 Develer S.r.l. (http://www.develer.com/) + * Copyright 1999 Bernie Innocenti <be...@co...> + * + * --> + * + * \brief CRC-CCITT table and support routines + * + * \author Francesco Sacchi <ba...@de...> + */ + +#include "crc_ccitt.h" +#include "crc.h" + +#include <cfg/debug.h> +#include <cfg/test.h> + + +int crc_testSetup(void) +{ + kdbg_init(); + return 0; +} + +int crc_testTearDown(void) +{ + return 0; +} + +int crc_testRun(void) +{ + char vector[9] = "123456789"; + + uint16_t crc = CRC_CCITT_INIT_VAL; + + crc = crc_ccitt(crc, vector, sizeof(vector)); + kprintf("crc_ccitt [%04X]\n", crc); + ASSERT(crc == 0x6F91); + + crc = CRC16_INIT_VAL; + crc = crc16(crc, vector, sizeof(vector)); + kprintf("crc16 [%04X]\n", crc); + ASSERT(crc == 0x31C3); + + return 0; +} + +TEST_MAIN(crc); diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/md2.c b/elec/boards/USB_CAN/Firmware/bertos/algo/md2.c new file mode 100644 index 0000000..589d989 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/md2.c @@ -0,0 +1,336 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2007 Develer S.r.l. (http://www.develer.com/) + * + * --> + * + * \brief MD2 Message-Digest algorithm. + * + * The MD2 algorithm work with a constant array of 256 permutationt + * defined in RFC1319. If you don't want to use a standard array of + * permutatione you can use a md2_perm() function that generate an + * array of 256 "casual" permutation. To swich from a standard array + * to md2_perm function you must chanche CONFIG_MD2_STD_PERM defined in + * appconfig.h. + * If you need to store array in program memory you must define + * a macro _PROGMEM (for more info see cpu/pgm.h). + * + * + * \author Daniele Basile <as...@de...> + */ + +#include "md2.h" + +#include <string.h> //memset(), memcpy(); +#include <cfg/compiler.h> +#include <cfg/debug.h> //ASSERT() +#include <cfg/macros.h> //MIN(), countof(), ROTR(); +#include <cpu/pgm.h> + + +#if CONFIG_MD2_STD_PERM + /* + * Official array of 256 byte pemutation contructed from digits of pi, defined + * in the RFC 1319. + */ + static const uint8_t PROGMEM md2_perm[256] = + { + 41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, + 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, + 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, + 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, + 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, + 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, + 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, + 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, + 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, + 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, + 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, + 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, + 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, + 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, + 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, + 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, + 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, + 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 + }; + + #define MD2_PERM(x) pgm_read8(&md2_perm[x]) +#else + /** + * Md2_perm() function generate an array of 256 "casual" permutation. + */ + + /** + * Costant define for computing an array of 256 "casual" permutation. + * \{ + */ + #define K1 5 + #define K2 3 + #define R 2 + #define X 172 + /*\}*/ + + static uint8_t md2_perm(uint8_t i) + { + + i = i * K1; + i = ROTR(i, R); + i ^= X; + i = i * K2; + + return i; + } + + #define MD2_PERM(x) md2_perm(x) + +#endif + + +/** + * Pad function. Put len_pad unsigned char in + * input block. + */ +static void md2_pad(void *_block, size_t len_pad) +{ + uint8_t *block; + + block = (uint8_t *)_block; + + ASSERT(len_pad <= CONFIG_MD2_BLOCK_LEN); + + /* + * Fill input block with len_pad char. + */ + memset(block, len_pad, len_pad); + +} + +static void md2_compute(void *_state, void *_checksum, void *_block) +{ + int i = 0; + uint16_t t = 0; + uint8_t compute_array[COMPUTE_ARRAY_LEN]; + uint8_t *state; + uint8_t *checksum; + uint8_t *block; + + state = (uint8_t *)_state; + checksum = (uint8_t *)_checksum; + block = (uint8_t *)_block; + + /* + * Copy state and checksum context in compute array. + */ + memcpy(compute_array, state, CONFIG_MD2_BLOCK_LEN); + memcpy(compute_array + CONFIG_MD2_BLOCK_LEN, block, CONFIG_MD2_BLOCK_LEN); + + /* + * Fill compute array with state XOR block + */ + for(i = 0; i < CONFIG_MD2_BLOCK_LEN; i++) + compute_array[i + (CONFIG_MD2_BLOCK_LEN * 2)] = state[i] ^ block[i]; + + /* + * Encryt block. + */ + for(i = 0; i < NUM_COMPUTE_ROUNDS; i++) + { + for(int j = 0; j < COMPUTE_ARRAY_LEN; j++) + { + compute_array[j] ^= MD2_PERM(t); + t = compute_array[j]; + } + + t = (t + i) & 0xff; //modulo 256. + } + /* + * Update checksum. + */ + t = checksum[CONFIG_MD2_BLOCK_LEN - 1]; + + for(i = 0; i < CONFIG_MD2_BLOCK_LEN; i++) + { + checksum[i] ^= MD2_PERM(block[i] ^ t); + t = checksum[i]; + } + + /* + * Update state and clean compute array. + */ + memcpy(state, compute_array, CONFIG_MD2_BLOCK_LEN); + memset(compute_array, 0, sizeof(compute_array)); +} + +/** + * Algorithm initialization. + * + * \param context empty context. + */ +void md2_init(Md2Context *context) +{ + + memset(context, 0, sizeof(Md2Context)); + +} + +/** + * Update block. + */ +void md2_update(Md2Context *context, const void *_block_in, size_t block_len) +{ + + const uint8_t *block_in; + size_t cpy_len; + + + block_in = (const uint8_t *)_block_in; + + while(block_len > 0) + { + /* + * Choose a number of block that fill input context buffer. + */ + cpy_len = MIN(block_len, CONFIG_MD2_BLOCK_LEN - context->counter); + + + /* + * Copy in the buffer input block. + */ + memcpy(&context->buffer[context->counter], block_in, cpy_len); + + /* + * Update a context counter, input block length and remaning + * context buffer block lenght. + */ + context->counter += cpy_len; + block_len -= cpy_len; + block_in += cpy_len; + + /* + * If buffer is full, compute it. + */ + if (context->counter >= CONFIG_MD2_BLOCK_LEN) + { + md2_compute(context->state, context->checksum, context->buffer); + context->counter = 0; + } + } + + +} +/** + * Ends an MD2 message digest operation. + * This fuction take an context and return a pointer + * to context state. + * + * \param context in input. + * \return a pointer to context state (message digest). + */ +uint8_t *md2_end(Md2Context *context) +{ + + uint8_t buf[CONFIG_MD2_BLOCK_LEN]; + + /* + * Fill remaning empty context buffer. + */ + md2_pad(buf, CONFIG_MD2_BLOCK_LEN - context->counter); + + /* + * Update context buffer and compute it. + */ + md2_update(context, buf, CONFIG_MD2_BLOCK_LEN - context->counter); + + /* + * Add context checksum to message input. + */ + md2_update(context, context->checksum, CONFIG_MD2_BLOCK_LEN); + + + return context->state; //return a pointer to message digest. +} +/** + * MD2 test fuction. + * This function test MD2 algorithm with a standard string specified + * in RFC 1319. + * + * \note This test work with official array of 256 byte pemutation + * contructed from digits of pi, defined in the RFC 1319. + * + */ +bool md2_test(void) +{ + + Md2Context context; + + const char *test[] = + { + "", + "message digest", + "abcdefghijklmnopqrstuvwxyz", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890" + }; + + + const char *result[] = { + "\x83\x50\xe5\xa3\xe2\x4c\x15\x3d\xf2\x27\x5c\x9f\x80\x69\x27\x73", + "\xab\x4f\x49\x6b\xfb\x2a\x53\x0b\x21\x9f\xf3\x30\x31\xfe\x06\xb0", + "\x4e\x8d\xdf\xf3\x65\x02\x92\xab\x5a\x41\x08\xc3\xaa\x47\x94\x0b", + "\xd5\x97\x6f\x79\xd8\x3d\x3a\x0d\xc9\x80\x6c\x3c\x66\xf3\xef\xd8", + }; + + + for (size_t i = 0; i < countof(test); i++) + { + md2_init(&context); + md2_update(&context, test[i], strlen(test[i])); + + if(memcmp(result[i], md2_end(&context), MD2_DIGEST_LEN)) + return false; + } + + return true; +} + +#if 0 + +#include <stdio.h> +int main(int argc, char * argv[]) +{ + + if(md2_test()) + printf("MD2 algorithm work well!\n"); + else + printf("MD2 algorithm doesn't work well.\n"); + +} + +#endif + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/md2.h b/elec/boards/USB_CAN/Firmware/bertos/algo/md2.h new file mode 100644 index 0000000..f7642b9 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/md2.h @@ -0,0 +1,74 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2007 Develer S.r.l. (http://www.develer.com/) + * + * --> + * + * \brief MD2 Message-Digest algorithm. + * + * The algorithm takes as input a message of arbitrary length and produces + * as output a 128-bit message digest of the input. + * It is conjectured that it is computationally infeasible to produce + * two messages having the same message digest, or to produce any + * message having a given prespecified target message digest. + * + * + * \author Daniele Basile <as...@de...> + * + * $WIZ$ module_name = "md2" + * $WIZ$ module_configuration = "bertos/cfg/cfg_md2.h" + */ + +#ifndef ALGO_MD2_H +#define ALGO_MD2_H + +#include "cfg/cfg_md2.h" +#include <cfg/compiler.h> + +#define NUM_COMPUTE_ROUNDS 18 ///< Number of compute rounds. +#define COMPUTE_ARRAY_LEN CONFIG_MD2_BLOCK_LEN * 3 ///< Lenght of compute array. +#define MD2_DIGEST_LEN CONFIG_MD2_BLOCK_LEN +/** + * Context for MD2 computation. + */ +typedef struct Md2Context +{ + uint8_t buffer[CONFIG_MD2_BLOCK_LEN]; ///< Input buffer. + uint8_t state[CONFIG_MD2_BLOCK_LEN]; ///< Current state buffer. + uint8_t checksum[CONFIG_MD2_BLOCK_LEN]; ///< Checksum. + size_t counter; ///< Counter of remaining bytes. + +} Md2Context; + +void md2_init(Md2Context *context); +void md2_update(Md2Context *context, const void *block_in, size_t block_len); +uint8_t *md2_end(Md2Context *context); +bool md2_test(void); + +#endif /* ALGO_MD2_H */ diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/mean.h b/elec/boards/USB_CAN/Firmware/bertos/algo/mean.h new file mode 100644 index 0000000..893241e --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/mean.h @@ -0,0 +1,41 @@ +#warning revise me! + + +/** + * DECLARE_SMEAN(temperature, uint8_t, uint16_t); + * for (i = 0; i < TEMP_MEANS; ++i) + * SMEAN_ADD(temperature, adc_get(), TEMP_MEANS); + * printf("mean temperature = %d\n", SMEAN_GET(temperature)); + */ + +/** + * Instantiate a mean instance + */ +#define DECLARE_SMEAN(name, Type, SumType) \ + struct { \ + SumType sum; \ + Type result; \ + int count; \ + } name = { 0, 0, 0 } + +/** + * Insert a new sample into the mean. + * + * \note \a mean and \a max_samples are evaluated multiple times + */ +#define SMEAN_ADD(mean, sample, max_samples) \ + do { \ + (mean).sum += (sample); \ + if ((mean).count++ >= (max_samples)) \ + { \ + (mean).result = (mean).sum / (max_samples); \ + (mean).sum = 0; \ + (mean).count = 0; \ + } \ + } while (0) + +/** + * Return current mean value. + */ +#define SMEAN_GET(mean) ((mean).result) + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/pid_control.c b/elec/boards/USB_CAN/Firmware/bertos/algo/pid_control.c new file mode 100644 index 0000000..73e7ffd --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/pid_control.c @@ -0,0 +1,115 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2008 Develer S.r.l. (http://www.develer.com/) + * --> + * + * + * \brief Proportional, integral, derivative controller (PID controller) (implementation) + * + * + * \author Daniele Basile <as...@de...> + */ + +#include "pid_control.h" + +#include "cfg/cfg_pid.h" + +// Define logging setting (for cfg/log.h module). +#define LOG_LEVEL PID_LOG_LEVEL +#define LOG_VERBOSITY PID_LOG_FORMAT + +#include <cfg/log.h> +#include <cfg/debug.h> + +/** + * Compute next value for reaching \a target point. + */ +piddata_t pid_control_update(PidContext *pid_ctx, piddata_t target, piddata_t curr_pos) +{ + piddata_t P; + piddata_t I; + piddata_t D; + piddata_t err; + + //Compute current error. + err = target - curr_pos; + + /* + * Compute Proportional contribute + */ + P = err * pid_ctx->cfg->kp; + + //Update integral state error + pid_ctx->i_state += err; + + //Clamp integral state between i_min and i_max + pid_ctx->i_state = MINMAX(pid_ctx->cfg->i_min, pid_ctx->i_state, pid_ctx->cfg->i_max); + + /* + * Compute Integral contribute + * + * note: for computing the integral contribute we use a sample period in seconds + * and so we divide sample_period in microsenconds for 1000. + */ + I = pid_ctx->i_state * pid_ctx->cfg->ki * ((piddata_t)pid_ctx->cfg->sample_period / 1000); + + + /* + * Compute derivative contribute + */ + D = (err - pid_ctx->prev_err) * pid_ctx->cfg->kd / ((piddata_t)pid_ctx->cfg->sample_period / 1000); + + + LOG_INFO("curr_pos[%lf],tgt[%lf],err[%f],P[%f],I[%f],D[%f]", curr_pos, target, err, P, I, D); + + + //Store the last error value + pid_ctx->prev_err = err; + piddata_t pid = MINMAX(pid_ctx->cfg->out_min, (P + I + D), pid_ctx->cfg->out_max); + + LOG_INFO("pid[%lf]",pid); + + //Clamp out between out_min and out_max + return pid; +} + +/** + * Init PID control. + */ +void pid_control_init(PidContext *pid_ctx, const PidCfg *pid_cfg) +{ + /* + * Init all values of pid control struct + */ + pid_ctx->cfg = pid_cfg; + + pid_control_reset(pid_ctx); + +} + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/pid_control.h b/elec/boards/USB_CAN/Firmware/bertos/algo/pid_control.h new file mode 100644 index 0000000..c21319a --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/pid_control.h @@ -0,0 +1,115 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2008 Develer S.r.l. (http://www.develer.com/) + * --> + * + * + * \brief Proportional, integral, derivative controller (PID controller). + * + * + * \author Daniele Basile <as...@de...> + * + * $WIZ$ module_name = "pid_control" + * $WIZ$ module_depends = "timer" + */ + +#ifndef ALGO_PID_CONTROL_H +#define ALGO_PID_CONTROL_H + +#include <drv/timer.h> + +/** + * Data type for pid coefficient. + */ +typedef float pidk_t; +typedef float piddata_t; + +/** + * PID context structure. + */ +typedef struct PidCfg +{ + pidk_t kp; ///< Proportional term of PID control method (Gain). + pidk_t ki; ///< Integral term of PID control method (Integral Gain). + pidk_t kd; ///< Derivative of PID control method (Derivative Gain). + + piddata_t i_max; ///< Max value of integral term. + piddata_t i_min; ///< Min value of integral term. + + piddata_t out_max; ///< Man value of output. + piddata_t out_min; ///< Min value of output. + + mtime_t sample_period; ///< Sample period in milliseconds. + +} PidCfg; + + +/** + * PID context structure. + */ +typedef struct PidContext +{ + const PidCfg *cfg; + + piddata_t prev_err; ///< Previous error. + piddata_t i_state; ///< Integrator state (sum of all the preceding errors). + +} PidContext; + +/** + * Set Kp, Ki, Kd constants of PID control. + */ +INLINE void pid_control_setPid(PidCfg *pid_cfg, pidk_t kp, pidk_t ki, pidk_t kd) +{ + pid_cfg->kp = kp; + pid_cfg->ki = ki; + pid_cfg->kd = kd; +} + +/** + * Set sample period for PID control. + */ +INLINE void pid_control_setPeriod(PidCfg *pid_cfg, mtime_t sample_period) +{ + pid_cfg->sample_period = sample_period; +} + +/** + * Clear a pid control structure + */ +INLINE void pid_control_reset(PidContext *pid_ctx) +{ + pid_ctx->i_state = 0; + pid_ctx->prev_err = 0; +} + +piddata_t pid_control_update(PidContext *pid_ctx, piddata_t target, piddata_t curr_pos); +void pid_control_init(PidContext *pid_ctx, const PidCfg *pid_cfg); + +#endif /* ALGO_PID_CONTROL_H */ diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/ramp.c b/elec/boards/USB_CAN/Firmware/bertos/algo/ramp.c new file mode 100644 index 0000000..fff8a6c --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/ramp.c @@ -0,0 +1,200 @@ +/*! + * \file + * <!-- + * Copyright 2004, 2008 Develer S.r.l. (http://www.develer.com/) + * All Rights Reserved. + * --> + * + * \brief Compute, save and load ramps for stepper motors (implementation) + * + * + * \author Simone Zinanni <s.z...@de...> + * \author Bernie Innocenti <be...@co...> + * \author Giovanni Bajo <ra...@de...> + * \author Daniele Basile <as...@de...> + * + * + * The formula used by the ramp is the following: + * + * <pre> + * a * b + * f(t) = ------------- + * lerp(a,b,t) + * </pre> + * + * Where <code>a</code> and <code>b</code> are the maximum and minimum speed + * respectively (minimum and maximum wavelength respectively), and <code>lerp</code> + * is a linear interpolation with a factor: + * + * <pre> + * lerp(a,b,t) = a + t * (b - a) = (a * (1 - t)) + (b * t) + * </pre> + * + * <code>t</code> must be in the [0,1] interval. It is easy to see that the + * following holds true: + * + * <pre> + * f(0) = b, f(1) = a + * </pre> + * + * And that the function is monotonic. So, the function effectively interpolates + * between the maximum and minimum speed through its domain ([0,1] -> [b,a]). + * + * The curve drawn by this function is similar to 1 / (sqrt(n)), so it is slower + * than a linear acceleration (which would be 1/n). + * + * The floating point version uses a slightly modified function which accepts + * the parameter in the domain [0, MT] (where MT is maxTime, the length of the + * ramp, which is a setup parameter for the ramp). This is done to reduce the + * number of operations per step. The formula looks like this: + * + * <pre> + * a * b * MT + * g(t) = ---------------------------- + * (a * MT) + t * (b - a) + * </pre> + * + * It can be shown that this <code>g(t) = f(t * MT)</code>. The denominator + * is a linear interpolation in the range [b*MT, a*MT], as t moves in the + * interval [0, MT]. So the interpolation interval of the function is again + * [b, a]. The implementation caches the value of the numerator and parts + * of the denominator, so that the formula becomes: + * + * <pre> + * alpha = a * b * MT + * beta = a * MT + * gamma = b - a + * + * alpha + * g(t) = ---------------------- + * beta + t * gamma + * </pre> + * + * and <code>t</code> is exactly the parameter that ramp_evaluate() gets, + * that is the current time (in range [0, MT]). The operations performed + * for each step are just an addition, a multiplication and a division. + * + * The fixed point version of the formula instead transforms the original + * function as follows: + * + * <pre> + * a * b a + * f(t) = ------------------------- = -------------------- + * a a + * b * ( - * (1 - t) + t ) - * (1 - t) + t + * b b + * </pre> + * + * <code>t</code> must be computed by dividing the current time (24 bit integer) + * by the maximum time (24 bit integer). This is done by precomputing the + * reciprocal of the maximum time as a 0.32 fixed point number, and multiplying + * it to the current time. Multiplication is performed 8-bits a time by + * FIX_MULT32(), so that we end up with a 0.16 fixed point number for + * <code>t</code> (and <code>1-t</code> is just its twos-complement negation). + * <code>a/b</code> is in the range [0,1] (because a is always less than b, + * being the minimum wavelength), so it is precomputed as a 0.16 fixed point. + * The final step is then computing the denominator and executing the division + * (32 cycles using the 1-step division instruction in the DSP). + * + * The assembly implementation is needed for efficiency, but a C version of it + * can be easily written, in case it is needed in the future. + * + */ + +#include "ramp.h" +#include <cfg/debug.h> + +#include <string.h> // memcpy() + +void ramp_compute(struct Ramp *ramp, uint32_t clocksRamp, uint16_t clocksMinWL, uint16_t clocksMaxWL) +{ + ASSERT(clocksMaxWL >= clocksMinWL); + + // Save values in ramp struct + ramp->clocksRamp = clocksRamp; + ramp->clocksMinWL = clocksMinWL; + ramp->clocksMaxWL = clocksMaxWL; + +#if RAMP_USE_FLOATING_POINT + ramp->precalc.gamma = ramp->clocksMaxWL - ramp->clocksMinWL; + ramp->precalc.beta = (float)ramp->clocksMinWL * (float)ramp->clocksRamp; + ramp->precalc.alpha = ramp->precalc.beta * (float)ramp->clocksMaxWL; + +#else + ramp->precalc.max_div_min = ((uint32_t)clocksMinWL << 16) / (uint32_t)clocksMaxWL; + + /* Calcola 1/total_time in fixed point .32. Assumiamo che la rampa possa al + * massimo avere 25 bit (cioé valore in tick fino a 2^25, che con il + * prescaler=3 sono circa 7 secondi). Inoltre, togliamo qualche bit di precisione + * da destra (secondo quanto specificato in RAMP_CLOCK_SHIFT_PRECISION). + */ + ASSERT(ramp->clocksRamp < (1UL << (24 + RAMP_CLOCK_SHIFT_PRECISION))); + ramp->precalc.inv_total_time = 0xFFFFFFFFUL / (ramp->clocksRamp >> RAMP_CLOCK_SHIFT_PRECISION); + ASSERT(ramp->precalc.inv_total_time < 0x1000000UL); + +#endif +} + + +void ramp_setup(struct Ramp* ramp, uint32_t length, uint32_t minFreq, uint32_t maxFreq) +{ + uint32_t minWL, maxWL; + + minWL = TIME2CLOCKS(FREQ2MICROS(maxFreq)); + maxWL = TIME2CLOCKS(FREQ2MICROS(minFreq)); + + ASSERT2(minWL < 65536UL, "Maximum frequency too high"); + ASSERT2(maxWL < 65536UL, "Minimum frequency too high"); + ASSERT(maxFreq > minFreq); + + ramp_compute( + ramp, + TIME2CLOCKS(length), + TIME2CLOCKS(FREQ2MICROS(maxFreq)), + TIME2CLOCKS(FREQ2MICROS(minFreq)) + ); +} + +void ramp_default(struct Ramp *ramp) +{ + ramp_setup(ramp, RAMP_DEF_TIME, RAMP_DEF_MINFREQ, RAMP_DEF_MAXFREQ); +} + +#if RAMP_USE_FLOATING_POINT + +float ramp_evaluate(const struct Ramp* ramp, float curClock) +{ + return ramp->precalc.alpha / (curClock * ramp->precalc.gamma + ramp->precalc.beta); +} + +#else + +INLINE uint32_t fix_mult32(uint32_t m1, uint32_t m2) +{ + uint32_t accum = 0; + accum += m1 * ((m2 >> 0) & 0xFF); + accum >>= 8; + accum += m1 * ((m2 >> 8) & 0xFF); + accum >>= 8; + accum += m1 * ((m2 >> 16) & 0xFF); + return accum; +} + +// a*b >> 16 +INLINE uint16_t fix_mult16(uint16_t a, uint32_t b) +{ + return (b*(uint32_t)a) >> 16; +} + +uint16_t FAST_FUNC ramp_evaluate(const struct Ramp* ramp, uint32_t curClock) +{ + uint16_t t = FIX_MULT32(curClock >> RAMP_CLOCK_SHIFT_PRECISION, ramp->precalc.inv_total_time); + uint16_t denom = fix_mult16((uint16_t)~t + 1, ramp->precalc.max_div_min) + t; + uint16_t cur_delta = ((uint32_t)ramp->clocksMinWL << 16) / denom; + + return cur_delta; +} + +#endif + + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/ramp.h b/elec/boards/USB_CAN/Firmware/bertos/algo/ramp.h new file mode 100644 index 0000000..ad3c919 --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/ramp.h @@ -0,0 +1,166 @@ +/** + * \file + * <!-- + * Copyright 2004, 2008 Develer S.r.l. (http://www.develer.com/) + * All Rights Reserved. + * --> + * + * \brief Compute, save and load ramps for stepper motors. + * + * The acceleration ramp is used to properly accelerate a stepper motor. The main + * entry point is the function ramp_evaluate(), which must be called at every step + * of the motor: it gets as input the time elapsed since the stepper started + * accelerating, and returns the time to wait before sending the next step. A pseudo + * usage pattern is as follows: + * + * <pre> + * float time = 0; + * while (1) + * { + * float delta = ramp_evaluate(&my_ramp, time); + * sleep(delta); + * do_motor_step(); + * time += delta; + * } + * </pre> + * + * A similar pattern can be used to decelerate (it is sufficient to move the total + * time backward, such as "time -= delta"). + * + * The ramp can be configured with ramp_setup(), providing it with the minimum and + * maximum operating frequency of the motor, and the total acceleration time in + * milliseconds (that is, the time that will be needed to accelerate from the + * minimum frequency to the maximum frequency). + * + * Both a very precise floating point and a very fast fixed point implementation + * of the ramp evaluation are provided. The fixed point is hand-optimized assembly + * for DSP56000 (but a portable C version of it can be easily written, see the + * comments in the code). + * + * + * \author Simone Zinanni <s.z...@de...> + * \author Giovanni Bajo <ra...@de...> + * \author Daniele Basile <as...@de...> + * + * $WIZ$ module_name = "ramp" + * $WIZ$ module_configuration = "bertos/cfg/cfg_ramp.h" + */ + +#ifndef ALGO_RAMP_H +#define ALGO_RAMP_H + +#include "hw/hw_stepper.h" + +#include "cfg/cfg_ramp.h" + +#include <cfg/compiler.h> + + +/** + * Convert microseconds to timer clock ticks + */ +#define TIME2CLOCKS(micros) ((uint32_t)(micros) * (STEPPER_CLOCK / 1000000)) + +/** + * Convert timer clock ticks back to microseconds + */ +#define CLOCKS2TIME(clocks) ((uint32_t)(clocks) / (STEPPER_CLOCK / 1000000)) + +/** + * Convert microseconds to Hz + */ +#define MICROS2FREQ(micros) (1000000UL / ((uint32_t)(micros))) + +/** + * Convert frequency (in Hz) to time (in microseconds) + */ +#define FREQ2MICROS(hz) (1000000UL / ((uint32_t)(hz))) + +/** + * Multiply \p a and \p b two integer at 32 bit and extract the high 16 bit word. + */ +#define FIX_MULT32(a,b) (((uint64_t)(a)*(uint32_t)(b)) >> 16) + +/** + * Structure holding pre-calculated data for speeding up real-time evaluation + * of the ramp. This structure is totally different between the fixed and the + * floating point version of the code. + * + * Consult the file-level documentation of ramp.c for more information about + * the values of this structure. + */ +struct RampPrecalc +{ +#if RAMP_USE_FLOATING_POINT + float beta; + float alpha; + float gamma; +#else + uint16_t max_div_min; + uint32_t inv_total_time; +#endif +}; + + +/** + * Ramp structure + */ +struct Ramp +{ + uint32_t clocksRamp; + uint16_t clocksMinWL; + uint16_t clocksMaxWL; + + struct RampPrecalc precalc; ///< pre-calculated values for speed +}; + + +/* + * Function prototypes + */ +void ramp_compute( + struct Ramp * ramp, + uint32_t clocksInRamp, + uint16_t clocksInMinWavelength, + uint16_t clocksInMaxWavelength); + + +/** Setup an acceleration ramp for a stepper motor + * + * \param ramp Ramp to fill + * \param length Length of the ramp (milliseconds) + * \param minFreq Minimum operating frequency of the motor (hertz) + * \param maxFreq Maximum operating frequency of the motor (hertz) + * + */ +void ramp_setup(struct Ramp* ramp, uint32_t length, uint32_t minFreq, uint32_t maxFreq); + + +/** + * Initialize a new ramp with default values + */ +void ramp_default(struct Ramp *ramp); + + +/** + * Evaluate the ramp at the given point. Given a \a ramp, and the current \a clock since + * the start of the acceleration, compute the next step, that is the interval at which + * send the signal to the motor. + * + * \note The fixed point version does not work when curClock is zero. Anyway, + * the first step is always clocksMaxWL, as stored within the ramp structure. + */ +#if RAMP_USE_FLOATING_POINT + float ramp_evaluate(const struct Ramp* ramp, float curClock); +#else + uint16_t ramp_evaluate(const struct Ramp* ramp, uint32_t curClock); +#endif + + +/** Self test */ +int ramp_testSetup(void); +int ramp_testRun(void); +int ramp_testTearDown(void); + +#endif /* ALGO_RAMP_H */ + diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/ramp_test.c b/elec/boards/USB_CAN/Firmware/bertos/algo/ramp_test.c new file mode 100644 index 0000000..0e7d58c --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/ramp_test.c @@ -0,0 +1,186 @@ +/*! + * \file + * <!-- + * Copyright 2004, 2008 Develer S.r.l. (http://www.develer.com/) + * All Rights Reserved. + * --> + * + * \brief Test for compute, save and load ramps for stepper motors (implementation) + * + * + * \author Simone Zinanni <s.z...@de...> + * \author Bernie Innocenti <be...@co...> + * \author Giovanni Bajo <ra...@de...> + * \author Daniele Basile <as...@de...> + * + * + * The formula used by the ramp is the following: + * + * <pre> + * a * b + * f(t) = ------------- + * lerp(a,b,t) + * </pre> + * + * Where <code>a</code> and <code>b</code> are the maximum and minimum speed + * respectively (minimum and maximum wavelength respectively), and <code>lerp</code> + * is a linear interpolation with a factor: + * + * <pre> + * lerp(a,b,t) = a + t * (b - a) = (a * (1 - t)) + (b * t) + * </pre> + * + * <code>t</code> must be in the [0,1] interval. It is easy to see that the + * following holds true: + * + * <pre> + * f(0) = b, f(1) = a + * </pre> + * + * And that the function is monotonic. So, the function effectively interpolates + * between the maximum and minimum speed through its domain ([0,1] -> [b,a]). + * + * The curve drawn by this function is similar to 1 / (sqrt(n)), so it is slower + * than a linear acceleration (which would be 1/n). + * + * The floating point version uses a slightly modified function which accepts + * the parameter in the domain [0, MT] (where MT is maxTime, the length of the + * ramp, which is a setup parameter for the ramp). This is done to reduce the + * number of operations per step. The formula looks like this: + * + * <pre> + * a * b * MT + * g(t) = ---------------------------- + * (a * MT) + t * (b - a) + * </pre> + * + * It can be shown that this <code>g(t) = f(t * MT)</code>. The denominator + * is a linear interpolation in the range [b*MT, a*MT], as t moves in the + * interval [0, MT]. So the interpolation interval of the function is again + * [b, a]. The implementation caches the value of the numerator and parts + * of the denominator, so that the formula becomes: + * + * <pre> + * alpha = a * b * MT + * beta = a * MT + * gamma = b - a + * + * alpha + * g(t) = ---------------------- + * beta + t * gamma + * </pre> + * + * and <code>t</code> is exactly the parameter that ramp_evaluate() gets, + * that is the current time (in range [0, MT]). The operations performed + * for each step are just an addition, a multiplication and a division. + * + * The fixed point version of the formula instead transforms the original + * function as follows: + * + * <pre> + * a * b a + * f(t) = ------------------------- = -------------------- + * a a + * b * ( - * (1 - t) + t ) - * (1 - t) + t + * b b + * </pre> + * + * <code>t</code> must be computed by dividing the current time (24 bit integer) + * by the maximum time (24 bit integer). This is done by precomputing the + * reciprocal of the maximum time as a 0.32 fixed point number, and multiplying + * it to the current time. Multiplication is performed 8-bits a time by + * FIX_MULT32(), so that we end up with a 0.16 fixed point number for + * <code>t</code> (and <code>1-t</code> is just its twos-complement negation). + * <code>a/b</code> is in the range [0,1] (because a is always less than b, + * being the minimum wavelength), so it is precomputed as a 0.16 fixed point. + * The final step is then computing the denominator and executing the division + * (32 cycles using the 1-step division instruction in the DSP). + * + * The assembly implementation is needed for efficiency, but a C version of it + * can be easily written, in case it is needed in the future. + * + */ + +#include "ramp.h" +#include <cfg/debug.h> +#include <cfg/test.h> + + +static bool ramp_test_single(uint32_t minFreq, uint32_t maxFreq, uint32_t length) +{ + struct Ramp r; + uint16_t cur, old; + uint32_t clock; + uint32_t oldclock; + + ramp_setup(&r, length, minFreq, maxFreq); + + cur = old = r.clocksMaxWL; + clock = 0; + oldclock = 0; + + kprintf("testing ramp: (length=%lu, min=%lu, max=%lu)\n", (unsigned long)length, (unsigned long)minFreq, (unsigned long)maxFreq); + kprintf(" [length=%lu, max=%04x, min=%04x]\n", (unsigned long)r.clocksRamp, r.clocksMaxWL, r.clocksMinWL); + + int i = 0; + int nonbyte = 0; + + while (clock + cur < r.clocksRamp) + { + oldclock = clock; + old = cur; + + clock += cur; + cur = ramp_evaluate(&r, clock); + + if (old < cur) + { + uint16_t t1 = FIX_MULT32(oldclock >> RAMP_CLOCK_SHIFT_PRECISION, r.precalc.inv_total_time); + uint16_t t2 = FIX_MULT32(clock >> RAMP_CLOCK_SHIFT_PRECISION, r.precalc.inv_total_time); + uint16_t denom1 = FIX_MULT32((uint16_t)((~t1) + 1), r.precalc.max_div_min) + t1; + uint16_t denom2 = FIX_MULT32((uint16_t)((~t2) + 1), r.precalc.max_div_min) + t2; + + kprintf(" Failed: %04x @ %lu --> %04x @ %lu\n", old, (unsigned long)oldclock, cur, (unsigned long)clock); + kprintf(" T: %04x -> %04x\n", t1, t2); + kprintf(" DENOM: %04x -> %04x\n", denom1, denom2); + + cur = ramp_evaluate(&r, clock); + return false; + } + i++; + if ((old-cur) >= 256) + nonbyte++; + } + + + + kprintf("Test finished: %04x @ %lu [min=%04x, totlen=%lu, numsteps:%d, nonbyte:%d]\n", cur, (unsigned long)clock, r.clocksMinWL, (unsigned long)r.clocksRamp, i, nonbyte); + + return true; +} + +int ramp_testSetup(void) +{ + kdbg_init(); + return 0; +} + +int ramp_testTearDown(void) +{ + return 0; +} + +int ramp_testRun(void) +{ + #define TEST_RAMP(min, max, len) do { \ + if (!ramp_test_single(min, max, len)) \ + return -1; \ + } while(0) + + TEST_RAMP(200, 5000, 3000000); + TEST_RAMP(1000, 2000, 1000000); + + return 0; +} + +TEST_MAIN(ramp); diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/rand.c b/elec/boards/USB_CAN/Firmware/bertos/algo/rand.c new file mode 100644 index 0000000..901e23f --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/rand.c @@ -0,0 +1,52 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * + * Bertos is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2006 Develer S.r.l. (http://www.develer.com/) + * Copyright 1999 Bernie Innocenti <be...@co...> + * + * --> + * + * \brief Very simple rand() algorithm. + * + * \author Bernie Innocenti <be...@co...> + */ + +#include "rand.h" + +/** + * This would really belong to libc + */ +int rand(void) +{ + static unsigned long seed; + + /* Randomize seed */ + seed = (seed ^ 0x4BAD5A39UL) + 6513973UL; + + return (int)(seed>>16); +} diff --git a/elec/boards/USB_CAN/Firmware/bertos/algo/rand.h b/elec/boards/USB_CAN/Firmware/bertos/algo/rand.h new file mode 100644 index 0000000..773429f --- /dev/null +++ b/elec/boards/USB_CAN/Firmware/bertos/algo/rand.h @@ -0,0 +1,44 @@ +/** + * \file + * <!-- + * This file is part of BeRTOS. + * +... [truncated message content] |
From: Jérémie D. <Ba...@us...> - 2011-03-11 21:38:03
|
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 3846984ca2ae71b7c36fed298726cdef90f60080 (commit) from 027ff5fb5214579002885946f570f0993057a35c (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 3846984ca2ae71b7c36fed298726cdef90f60080 Author: Jérémie Dimino <je...@di...> Date: Fri Mar 11 22:37:19 2011 +0100 Add an example which dumps can frames. ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_oasis b/info/control2011/_oasis index 3a26ca3..91ee771 100644 --- a/info/control2011/_oasis +++ b/info/control2011/_oasis @@ -38,6 +38,17 @@ Library can CSources: can_stubs.c # +-------------------------------------------------------------------+ +# | Examples | +# +-------------------------------------------------------------------+ + +Executable "dump-can" + Path: examples + Install: false + CompiledObject: best + MainIs: dump_can.ml + BuildDepends: krobot.can + +# +-------------------------------------------------------------------+ # | Doc | # +-------------------------------------------------------------------+ diff --git a/info/control2011/_tags b/info/control2011/_tags index ce45b27..2e33d60 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -1,7 +1,7 @@ <**/*.ml>: syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: d603b4bf64803246215300604de4811c) +# DO NOT EDIT (digest: 113a86794ede4d5625a352637c66e020) # Library can "src/can": include <src/can/can.{cma,cmxa}>: use_libcan @@ -13,4 +13,11 @@ "src/lib": include <src/lib/*.ml{,i}>: pkg_lwt.unix <src/lib/*.ml{,i}>: pkg_lwt.syntax +# Executable dump-can +<examples/dump_can.{native,byte}>: use_can +<examples/dump_can.{native,byte}>: pkg_lwt.unix +<examples/dump_can.{native,byte}>: pkg_lwt.syntax +<examples/*.ml{,i}>: use_can +<examples/*.ml{,i}>: pkg_lwt.unix +<examples/*.ml{,i}>: pkg_lwt.syntax # OASIS_STOP diff --git a/info/control2011/examples/dump_can.ml b/info/control2011/examples/dump_can.ml new file mode 100644 index 0000000..b54c248 --- /dev/null +++ b/info/control2011/examples/dump_can.ml @@ -0,0 +1,54 @@ +(* + * dump_can.ml + * ----------- + * Copyright : (c) 2011, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* Dump all frames received from the CAN. *) + +open Lwt +open CAN + +let rec loop bus = + lwt frame = CAN.recv bus in + let data = String.create 8 in + String.blit frame.frame_data 0 data 0 (String.length frame.frame_data); + lwt () = + Lwt_io.printf "can frame received: + id = %d; + type = %s; + remote = %B; + format = %d bits; + data = %02x %02x %02x %02x %02x %02x %02x %02x; +" + frame.frame_identifier + (match frame.frame_type with + | Type_data -> "data" + | Type_error -> "error") + frame.frame_remote + (match frame.frame_format with + | Format_11bits -> 11 + | Format_29bits -> 29) + (Char.code data.[0]) + (Char.code data.[1]) + (Char.code data.[2]) + (Char.code data.[3]) + (Char.code data.[4]) + (Char.code data.[5]) + (Char.code data.[6]) + (Char.code data.[7]) + in + loop bus + +lwt () = + if Array.length Sys.argv <> 2 then begin + print_endline "usage: dump-can <interface>"; + exit 2; + end; + try_lwt + CAN.open_can Sys.argv.(1) >>= loop + with Unix.Unix_error(error, func, arg) -> + Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) diff --git a/info/control2011/myocamlbuild.ml b/info/control2011/myocamlbuild.ml index 2725ff4..5084bdd 100644 --- a/info/control2011/myocamlbuild.ml +++ b/info/control2011/myocamlbuild.ml @@ -461,4 +461,16 @@ let package_default = let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; (* OASIS_STOP *) -Ocamlbuild_plugin.dispatch dispatch_default;; + +open Ocamlbuild_plugin + +let () = + dispatch + (fun hook -> + dispatch_default hook; + match hook with + | Before_options -> + Options.make_links := false + | _ -> + ()) + diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index 36bdba2..022aea8 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: d2406eee56464ad95caf1d4a61ce5222) *) +(* DO NOT EDIT (digest: 1304b079e30d590a78f62965c8e260ab) *) (* Regenerated by OASIS v0.2.0~alpha1 Visit http://oasis.forge.ocamlcore.org for more information and @@ -5042,6 +5042,39 @@ let setup_t = files_ab = []; sections = [ + Library + ({ + cs_name = "can"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "src/can"; + bs_compiled_object = Best; + bs_build_depends = + [ + FindlibPackage ("lwt.unix", None); + FindlibPackage ("lwt.syntax", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = ["can_stubs.c"]; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + { + lib_modules = ["CAN"]; + lib_internal_modules = []; + lib_findlib_parent = Some "krobot"; + lib_findlib_name = Some "can"; + lib_findlib_containers = []; + }); SrcRepo ({ cs_name = "head"; @@ -5086,14 +5119,14 @@ let setup_t = }); Library ({ - cs_name = "can"; + cs_name = "krobot"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "src/can"; + bs_path = "src/lib"; bs_compiled_object = Best; bs_build_depends = [ @@ -5101,7 +5134,7 @@ let setup_t = FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; - bs_c_sources = ["can_stubs.c"]; + bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; @@ -5111,28 +5144,24 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { - lib_modules = ["CAN"]; + lib_modules = []; lib_internal_modules = []; - lib_findlib_parent = Some "krobot"; - lib_findlib_name = Some "can"; + lib_findlib_parent = None; + lib_findlib_name = Some "krobot"; lib_findlib_containers = []; }); - Library + Executable ({ - cs_name = "krobot"; + cs_name = "dump-can"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; - bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "src/lib"; + bs_install = [(OASISExpr.EBool true, false)]; + bs_path = "examples"; bs_compiled_object = Best; - bs_build_depends = - [ - FindlibPackage ("lwt.unix", None); - FindlibPackage ("lwt.syntax", None) - ]; + bs_build_depends = [InternalLibrary "can"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; @@ -5143,13 +5172,7 @@ let setup_t = bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, - { - lib_modules = []; - lib_internal_modules = []; - lib_findlib_parent = None; - lib_findlib_name = Some "krobot"; - lib_findlib_containers = []; - }) + {exec_custom = false; exec_main_is = "dump_can.ml"; }) ]; plugins = [(`Extra, "DevFiles", Some "0.2"); (`Extra, "META", Some "0.2")]; diff --git a/info/control2011/src/can/CAN.ml b/info/control2011/src/can/CAN.ml index 00952bb..c2c34ee 100644 --- a/info/control2011/src/can/CAN.ml +++ b/info/control2011/src/can/CAN.ml @@ -40,7 +40,7 @@ end | Openning/closing | +-----------------------------------------------------------------+ *) -external open_can_file_descr : string -> Unix.file_descr = "ocaml_can_open_file_descr" +external open_can_file_descr : string -> Unix.file_descr = "ocaml_can_open_can_file_descr" let open_can iface = let fd = open_can_file_descr iface in hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2011-03-11 21:23:37
|
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 027ff5fb5214579002885946f570f0993057a35c (commit) from 8b653af138a0c699b966c1cddddfc562c107ed66 (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 027ff5fb5214579002885946f570f0993057a35c Author: Jérémie Dimino <je...@di...> Date: Fri Mar 11 22:19:29 2011 +0100 Implement the CAN protocol using SocketCAN on the motherboard side ----------------------------------------------------------------------- Changes: diff --git a/.gitignore b/.gitignore index 762d07b..6db98fc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ *.dmp *.hex *.o.d +setup.data +setup.log +_build diff --git a/info/control2011/Makefile b/info/control2011/Makefile new file mode 100644 index 0000000..68f2e0e --- /dev/null +++ b/info/control2011/Makefile @@ -0,0 +1,38 @@ +# OASIS_START +# DO NOT EDIT (digest: bc1e05bfc8b39b664f29dae8dbd3ebbb) + +SETUP = ocaml setup.ml + +build: setup.data + $(SETUP) -build $(BUILDFLAGS) + +doc: setup.data build + $(SETUP) -doc $(DOCFLAGS) + +test: setup.data build + $(SETUP) -test $(TESTFLAGS) + +all: + $(SETUP) -all $(ALLFLAGS) + +install: setup.data + $(SETUP) -install $(INSTALLFLAGS) + +uninstall: setup.data + $(SETUP) -uninstall $(UNINSTALLFLAGS) + +reinstall: setup.data + $(SETUP) -reinstall $(REINSTALLFLAGS) + +clean: + $(SETUP) -clean $(CLEANFLAGS) + +distclean: + $(SETUP) -distclean $(DISTCLEANFLAGS) + +setup.data: + $(SETUP) -configure $(CONFIGUREFLAGS) + +.PHONY: build doc test all install uninstall reinstall clean distclean configure + +# OASIS_STOP diff --git a/info/control2011/_oasis b/info/control2011/_oasis new file mode 100644 index 0000000..3a26ca3 --- /dev/null +++ b/info/control2011/_oasis @@ -0,0 +1,61 @@ +# +-------------------------------------------------------------------+ +# | Package parameters | +# +-------------------------------------------------------------------+ + +OASISFormat: 0.1 +Name: krobot +Version: 1.0 +LicenseFile: LICENSE +License: BSD3 +Authors: Jérémie Dimino +Homepage: http://sourceforge.net/apps/mediawiki/krobot/index.php?title=Main_Page +BuildTools: ocamlbuild +Plugins: DevFiles (0.2), META (0.2) +Synopsis: [Kro]bot +Description: Control program for the Eurobot robotic cup. + +# +-------------------------------------------------------------------+ +# | Libraries | +# +-------------------------------------------------------------------+ + +Library krobot + FindlibName: krobot + BuildDepends: lwt.unix, lwt.syntax + XMETADescription: The [Kro]bot library + XMETARequires: lwt.unix + Path: src/lib + Install: true + +Library can + FindlibName: can + FindlibParent: krobot + BuildDepends: lwt.unix, lwt.syntax + XMETADescription: CAN interface using SocketCAN + XMETARequires: lwt.unix + Path: src/can + Install: true + Modules: CAN + CSources: can_stubs.c + +# +-------------------------------------------------------------------+ +# | Doc | +# +-------------------------------------------------------------------+ + +Document "krobot-api" + Title: API reference for [Kro]bot + Type: ocamlbuild (0.2) + Install: true + InstallDir: $htmldir/api + DataFiles: style.css + BuildTools: ocamldoc + XOCamlbuildPath: ./ + XOCamlbuildLibraries: krobot.can + +# +-------------------------------------------------------------------+ +# | Misc | +# +-------------------------------------------------------------------+ + +SourceRepository head + Type: git + Location: git://krobot.git.sourceforge.net/gitroot/krobot/krobot + Browser: http://krobot.git.sourceforge.net/git/gitweb.cgi?p=krobot/krobot;a=summary diff --git a/info/control2011/_tags b/info/control2011/_tags new file mode 100644 index 0000000..ce45b27 --- /dev/null +++ b/info/control2011/_tags @@ -0,0 +1,16 @@ +<**/*.ml>: syntax_camlp4o + +# OASIS_START +# DO NOT EDIT (digest: d603b4bf64803246215300604de4811c) +# Library can +"src/can": include +<src/can/can.{cma,cmxa}>: use_libcan +<src/can/*.ml{,i}>: pkg_lwt.unix +<src/can/*.ml{,i}>: pkg_lwt.syntax +"src/can/can_stubs.c": pkg_lwt.unix +"src/can/can_stubs.c": pkg_lwt.syntax +# Library krobot +"src/lib": include +<src/lib/*.ml{,i}>: pkg_lwt.unix +<src/lib/*.ml{,i}>: pkg_lwt.syntax +# OASIS_STOP diff --git a/info/control2011/configure b/info/control2011/configure new file mode 100755 index 0000000..6719c7c --- /dev/null +++ b/info/control2011/configure @@ -0,0 +1,8 @@ +#!/bin/sh + +# OASIS_START +# DO NOT EDIT (digest: ed33e59fe00e48bc31edf413bbc8b8d6) +set -e + +ocaml setup.ml -configure $* +# OASIS_STOP diff --git a/info/control2011/krobot-api.odocl b/info/control2011/krobot-api.odocl new file mode 100644 index 0000000..f8c8de8 --- /dev/null +++ b/info/control2011/krobot-api.odocl @@ -0,0 +1,4 @@ +# OASIS_START +# DO NOT EDIT (digest: 58886b9f951fc765b4b70313e7367405) +src/can/CAN +# OASIS_STOP diff --git a/info/control2011/myocamlbuild.ml b/info/control2011/myocamlbuild.ml new file mode 100644 index 0000000..2725ff4 --- /dev/null +++ b/info/control2011/myocamlbuild.ml @@ -0,0 +1,464 @@ +(* OASIS_START *) +(* DO NOT EDIT (digest: c55b11139c906a1165b22ff2f3e11ddc) *) +module OASISGettext = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISGettext.ml" + + let ns_ str = + str + + let s_ str = + str + + let f_ (str : ('a, 'b, 'c, 'd) format4) = + str + + let fn_ fmt1 fmt2 n = + if n = 1 then + fmt1^^"" + else + fmt2^^"" + + let init = + [] + +end + +module OASISExpr = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISExpr.ml" + + + + open OASISGettext + + type test = string + + type flag = string + + type t = + | EBool of bool + | ENot of t + | EAnd of t * t + | EOr of t * t + | EFlag of flag + | ETest of test * string + + + type 'a choices = (t * 'a) list + + let eval var_get t = + let rec eval' = + function + | EBool b -> + b + + | ENot e -> + not (eval' e) + + | EAnd (e1, e2) -> + (eval' e1) && (eval' e2) + + | EOr (e1, e2) -> + (eval' e1) || (eval' e2) + + | EFlag nm -> + let v = + var_get nm + in + assert(v = "true" || v = "false"); + (v = "true") + + | ETest (nm, vl) -> + let v = + var_get nm + in + (v = vl) + in + eval' t + + let choose ?printer ?name var_get lst = + let rec choose_aux = + function + | (cond, vl) :: tl -> + if eval var_get cond then + vl + else + choose_aux tl + | [] -> + let str_lst = + if lst = [] then + s_ "<empty>" + else + String.concat + (s_ ", ") + (List.map + (fun (cond, vl) -> + match printer with + | Some p -> p vl + | None -> s_ "<no printer>") + lst) + in + match name with + | Some nm -> + failwith + (Printf.sprintf + (f_ "No result for the choice list '%s': %s") + nm str_lst) + | None -> + failwith + (Printf.sprintf + (f_ "No result for a choice list: %s") + str_lst) + in + choose_aux (List.rev lst) + +end + + +module BaseEnvLight = struct +# 21 "/home/dim/sources/oasis/src/base/BaseEnvLight.ml" + + module MapString = Map.Make(String) + + type t = string MapString.t + + let default_filename = + Filename.concat + (Sys.getcwd ()) + "setup.data" + + let load ?(allow_empty=false) ?(filename=default_filename) () = + if Sys.file_exists filename then + begin + let chn = + open_in_bin filename + in + let st = + Stream.of_channel chn + in + let line = + ref 1 + in + let st_line = + Stream.from + (fun _ -> + try + match Stream.next st with + | '\n' -> incr line; Some '\n' + | c -> Some c + with Stream.Failure -> None) + in + let lexer = + Genlex.make_lexer ["="] st_line + in + let rec read_file mp = + match Stream.npeek 3 lexer with + | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] -> + Stream.junk lexer; + Stream.junk lexer; + Stream.junk lexer; + read_file (MapString.add nm value mp) + | [] -> + mp + | _ -> + failwith + (Printf.sprintf + "Malformed data file '%s' line %d" + filename !line) + in + let mp = + read_file MapString.empty + in + close_in chn; + mp + end + else if allow_empty then + begin + MapString.empty + end + else + begin + failwith + (Printf.sprintf + "Unable to load environment, the file '%s' doesn't exist." + filename) + end + + let var_get name env = + let rec var_expand str = + let buff = + Buffer.create ((String.length str) * 2) + in + Buffer.add_substitute + buff + (fun var -> + try + var_expand (MapString.find var env) + with Not_found -> + failwith + (Printf.sprintf + "No variable %s defined when trying to expand %S." + var + str)) + str; + Buffer.contents buff + in + var_expand (MapString.find name env) + + let var_choose lst env = + OASISExpr.choose + (fun nm -> var_get nm env) + lst +end + + +module MyOCamlbuildFindlib = struct +# 21 "/home/dim/sources/oasis/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" + + (** OCamlbuild extension, copied from + * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild + * by N. Pouillard and others + * + * Updated on 2009/02/28 + * + * Modified by Sylvain Le Gall + *) + open Ocamlbuild_plugin + + (* these functions are not really officially exported *) + let run_and_read = + Ocamlbuild_pack.My_unix.run_and_read + + let blank_sep_strings = + Ocamlbuild_pack.Lexers.blank_sep_strings + + let split s ch = + let x = + ref [] + in + let rec go s = + let pos = + String.index s ch + in + x := (String.before s pos)::!x; + go (String.after s (pos + 1)) + in + try + go s + with Not_found -> !x + + let split_nl s = split s '\n' + + let before_space s = + try + String.before s (String.index s ' ') + with Not_found -> s + + (* this lists all supported packages *) + let find_packages () = + List.map before_space (split_nl & run_and_read "ocamlfind list") + + (* this is supposed to list available syntaxes, but I don't know how to do it. *) + let find_syntaxes () = ["camlp4o"; "camlp4r"] + + (* ocamlfind command *) + let ocamlfind x = S[A"ocamlfind"; x] + + let dispatch = + function + | Before_options -> + (* by using Before_options one let command line options have an higher priority *) + (* on the contrary using After_options will guarantee to have the higher priority *) + (* override default commands by ocamlfind ones *) + Options.ocamlc := ocamlfind & A"ocamlc"; + Options.ocamlopt := ocamlfind & A"ocamlopt"; + Options.ocamldep := ocamlfind & A"ocamldep"; + Options.ocamldoc := ocamlfind & A"ocamldoc"; + Options.ocamlmktop := ocamlfind & A"ocamlmktop" + + | After_rules -> + + (* When one link an OCaml library/binary/package, one should use -linkpkg *) + flag ["ocaml"; "link"; "program"] & A"-linkpkg"; + + (* For each ocamlfind package one inject the -package option when + * compiling, computing dependencies, generating documentation and + * linking. *) + List.iter + begin fun pkg -> + flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg]; + flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg]; + flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg]; + flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg]; + flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg]; + end + (find_packages ()); + + (* Like -package but for extensions syntax. Morover -syntax is useless + * when linking. *) + List.iter begin fun syntax -> + flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; + flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; + flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; + flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; + end (find_syntaxes ()); + + (* The default "thread" tag is not compatible with ocamlfind. + * Indeed, the default rules add the "threads.cma" or "threads.cmxa" + * options when using this tag. When using the "-linkpkg" option with + * ocamlfind, this module will then be added twice on the command line. + * + * To solve this, one approach is to add the "-thread" option when using + * the "threads" package using the previous plugin. + *) + flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]); + flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]); + flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"]) + + | _ -> + () + +end + +module MyOCamlbuildBase = struct +# 21 "/home/dim/sources/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" + + (** Base functions for writing myocamlbuild.ml + @author Sylvain Le Gall + *) + + + + open Ocamlbuild_plugin + + type dir = string + type file = string + type name = string + type tag = string + +# 55 "/home/dim/sources/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" + + type t = + { + lib_ocaml: (name * dir list) list; + lib_c: (name * dir * file list) list; + flags: (tag list * (spec OASISExpr.choices)) list; + } + + let env_filename = + Pathname.basename + BaseEnvLight.default_filename + + let dispatch_combine lst = + fun e -> + List.iter + (fun dispatch -> dispatch e) + lst + + let dispatch t e = + let env = + BaseEnvLight.load + ~filename:env_filename + ~allow_empty:true + () + in + match e with + | Before_options -> + let no_trailing_dot s = + if String.length s >= 1 && s.[0] = '.' then + String.sub s 1 ((String.length s) - 1) + else + s + in + List.iter + (fun (opt, var) -> + try + opt := no_trailing_dot (BaseEnvLight.var_get var env) + with Not_found -> + Printf.eprintf "W: Cannot get variable %s" var) + [ + Options.ext_obj, "ext_obj"; + Options.ext_lib, "ext_lib"; + Options.ext_dll, "ext_dll"; + ] + + | After_rules -> + (* Declare OCaml libraries *) + List.iter + (function + | lib, [] -> + ocaml_lib lib; + | lib, dir :: tl -> + ocaml_lib ~dir:dir lib; + List.iter + (fun dir -> + flag + ["ocaml"; "use_"^lib; "compile"] + (S[A"-I"; P dir])) + tl) + t.lib_ocaml; + + (* Declare C libraries *) + List.iter + (fun (lib, dir, headers) -> + (* Handle C part of library *) + flag ["link"; "library"; "ocaml"; "byte"; "use_lib"^lib] + (S[A"-dllib"; A("-l"^lib); A"-cclib"; A("-l"^lib)]); + + flag ["link"; "library"; "ocaml"; "native"; "use_lib"^lib] + (S[A"-cclib"; A("-l"^lib)]); + + flag ["link"; "program"; "ocaml"; "byte"; "use_lib"^lib] + (S[A"-dllib"; A("dll"^lib)]); + + (* When ocaml link something that use the C library, then one + need that file to be up to date. + *) + dep ["link"; "ocaml"; "use_lib"^lib] + [dir/"lib"^lib^"."^(!Options.ext_lib)]; + + (* TODO: be more specific about what depends on headers *) + (* Depends on .h files *) + dep ["compile"; "c"] + headers; + + (* Setup search path for lib *) + flag ["link"; "ocaml"; "use_"^lib] + (S[A"-I"; P(dir)]); + ) + t.lib_c; + + (* Add flags *) + List.iter + (fun (tags, cond_specs) -> + let spec = + BaseEnvLight.var_choose cond_specs env + in + flag tags & spec) + t.flags + | _ -> + () + + let dispatch_default t = + dispatch_combine + [ + dispatch t; + MyOCamlbuildFindlib.dispatch; + ] + +end + + +open Ocamlbuild_plugin;; +let package_default = + { + MyOCamlbuildBase.lib_ocaml = + [("src/can/can", ["src/can"]); ("src/lib/krobot", ["src/lib"])]; + lib_c = [("can", "src/can", [])]; + flags = []; + } + ;; + +let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; + +(* OASIS_STOP *) +Ocamlbuild_plugin.dispatch dispatch_default;; diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml new file mode 100644 index 0000000..36bdba2 --- /dev/null +++ b/info/control2011/setup.ml @@ -0,0 +1,5165 @@ +(* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) + +(* OASIS_START *) +(* DO NOT EDIT (digest: d2406eee56464ad95caf1d4a61ce5222) *) +(* + Regenerated by OASIS v0.2.0~alpha1 + Visit http://oasis.forge.ocamlcore.org for more information and + documentation about functions used in this file. +*) +module OASISGettext = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISGettext.ml" + + let ns_ str = + str + + let s_ str = + str + + let f_ (str : ('a, 'b, 'c, 'd) format4) = + str + + let fn_ fmt1 fmt2 n = + if n = 1 then + fmt1^^"" + else + fmt2^^"" + + let init = + [] + +end + +module OASISContext = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISContext.ml" + + open OASISGettext + + type level = + [ `Debug + | `Info + | `Warning + | `Error] + + type t = + { + verbose: bool; + debug: bool; + ignore_plugins: bool; + printf: level -> string -> unit; + } + + let printf lvl str = + let beg = + match lvl with + | `Error -> s_ "E: " + | `Warning -> s_ "W: " + | `Info -> s_ "I: " + | `Debug -> s_ "D: " + in + match lvl with + | `Error -> + prerr_endline (beg^str) + | _ -> + print_endline (beg^str) + + let default = + ref + { + verbose = true; + debug = false; + ignore_plugins = false; + printf = printf; + } + + let quiet = + {!default with + verbose = false; + debug = false; + } + + + let args () = + ["-quiet", + Arg.Unit (fun () -> default := {!default with verbose = false}), + (s_ " Run quietly"); + + "-debug", + Arg.Unit (fun () -> default := {!default with debug = true}), + (s_ " Output debug message")] +end + +module OASISUtils = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISUtils.ml" + + module MapString = Map.Make(String) + + let map_string_of_assoc assoc = + List.fold_left + (fun acc (k, v) -> MapString.add k v acc) + MapString.empty + assoc + + module SetString = Set.Make(String) + + let set_string_add_list st lst = + List.fold_left + (fun acc e -> SetString.add e acc) + st + lst + + let set_string_of_list = + set_string_add_list + SetString.empty + + + let compare_csl s1 s2 = + String.compare (String.lowercase s1) (String.lowercase s2) + + module HashStringCsl = + Hashtbl.Make + (struct + type t = string + + let equal s1 s2 = + (String.lowercase s1) = (String.lowercase s2) + + let hash s = + Hashtbl.hash (String.lowercase s) + end) + + let split sep str = + let str_len = + String.length str + in + let rec split_aux acc pos = + if pos < str_len then + ( + let pos_sep = + try + String.index_from str pos sep + with Not_found -> + str_len + in + let part = + String.sub str pos (pos_sep - pos) + in + let acc = + part :: acc + in + if pos_sep >= str_len then + ( + (* Nothing more in the string *) + List.rev acc + ) + else if pos_sep = (str_len - 1) then + ( + (* String end with a separator *) + List.rev ("" :: acc) + ) + else + ( + split_aux acc (pos_sep + 1) + ) + ) + else + ( + List.rev acc + ) + in + split_aux [] 0 + + + let varname_of_string ?(hyphen='_') s = + if String.length s = 0 then + begin + invalid_arg "varname_of_string" + end + else + begin + let buff = + Buffer.create (String.length s) + in + (* Start with a _ if digit *) + if '0' <= s.[0] && s.[0] <= '9' then + Buffer.add_char buff hyphen; + + String.iter + (fun c -> + if ('a' <= c && c <= 'z') + || + ('A' <= c && c <= 'Z') + || + ('0' <= c && c <= '9') then + Buffer.add_char buff c + else + Buffer.add_char buff hyphen) + s; + + String.lowercase (Buffer.contents buff) + end + + let varname_concat ?(hyphen='_') p s = + let p = + let p_len = + String.length p + in + if p_len > 0 && p.[p_len - 1] = hyphen then + String.sub p 0 (p_len - 1) + else + p + in + let s = + let s_len = + String.length s + in + if s_len > 0 && s.[0] = hyphen then + String.sub s 1 (s_len - 1) + else + s + in + Printf.sprintf "%s%c%s" p hyphen s + + + let is_varname str = + str = varname_of_string str + + let failwithf1 fmt a = + failwith (Printf.sprintf fmt a) + + let failwithf2 fmt a b = + failwith (Printf.sprintf fmt a b) + + let failwithf3 fmt a b c = + failwith (Printf.sprintf fmt a b c) + + let failwithf4 fmt a b c d = + failwith (Printf.sprintf fmt a b c d) + + let failwithf5 fmt a b c d e = + failwith (Printf.sprintf fmt a b c d e) + +end + +module PropList = struct +# 21 "/home/dim/sources/oasis/src/oasis/PropList.ml" + + open OASISGettext + + type name = string + + exception Not_set of name * string option + exception No_printer of name + exception Unknown_field of name * name + + let string_of_exception = + function + | Not_set (nm, Some rsn) -> + Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn + | Not_set (nm, None) -> + Printf.sprintf (f_ "Field '%s' is not set") nm + | No_printer nm -> + Printf.sprintf (f_ "No default printer for value %s") nm + | Unknown_field (nm, schm) -> + Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm + | e -> + raise e + + module Data = + struct + + type t = + (name, unit -> unit) Hashtbl.t + + let create () = + Hashtbl.create 13 + + let clear t = + Hashtbl.clear t + +# 59 "/home/dim/sources/oasis/src/oasis/PropList.ml" + end + + module Schema = + struct + + type ('ctxt, 'extra) value = + { + get: Data.t -> string; + set: Data.t -> ?context:'ctxt -> string -> unit; + help: (unit -> string) option; + extra: 'extra; + } + + type ('ctxt, 'extra) t = + { + name: name; + fields: (name, ('ctxt, 'extra) value) Hashtbl.t; + order: name Queue.t; + name_norm: string -> string; + } + + let create ?(case_insensitive=false) nm = + { + name = nm; + fields = Hashtbl.create 13; + order = Queue.create (); + name_norm = + (if case_insensitive then + String.lowercase + else + fun s -> s); + } + + let add t nm set get extra help = + let key = + t.name_norm nm + in + + if Hashtbl.mem t.fields key then + failwith + (Printf.sprintf + (f_ "Field '%s' is already defined in schema '%s'") + nm t.name); + Hashtbl.add + t.fields + key + { + set = set; + get = get; + help = help; + extra = extra; + }; + Queue.add nm t.order + + let mem t nm = + Hashtbl.mem t.fields nm + + let find t nm = + try + Hashtbl.find t.fields (t.name_norm nm) + with Not_found -> + raise (Unknown_field (nm, t.name)) + + let get t data nm = + (find t nm).get data + + let set t data nm ?context x = + (find t nm).set + data + ?context + x + + let fold f acc t = + Queue.fold + (fun acc k -> + let v = + find t k + in + f acc k v.extra v.help) + acc + t.order + + let iter f t = + fold + (fun () -> f) + () + t + + let name t = + t.name + end + + module Field = + struct + + type ('ctxt, 'value, 'extra) t = + { + set: Data.t -> ?context:'ctxt -> 'value -> unit; + get: Data.t -> 'value; + sets: Data.t -> ?context:'ctxt -> string -> unit; + gets: Data.t -> string; + help: (unit -> string) option; + extra: 'extra; + } + + let new_id = + let last_id = + ref 0 + in + fun () -> incr last_id; !last_id + + let create ?schema ?name ?parse ?print ?default ?update ?help extra = + (* Default value container *) + let v = + ref None + in + + (* If name is not given, create unique one *) + let nm = + match name with + | Some s -> s + | None -> Printf.sprintf "_anon_%d" (new_id ()) + in + + (* Last chance to get a value: the default *) + let default () = + match default with + | Some d -> d + | None -> raise (Not_set (nm, Some (s_ "no default value"))) + in + + (* Get data *) + let get data = + (* Get value *) + try + (Hashtbl.find data nm) (); + match !v with + | Some x -> x + | None -> default () + with Not_found -> + default () + in + + (* Set data *) + let set data ?context x = + let x = + match update with + | Some f -> + begin + try + f ?context (get data) x + with Not_set _ -> + x + end + | None -> + x + in + Hashtbl.replace + data + nm + (fun () -> v := Some x) + in + + (* Parse string value, if possible *) + let parse = + match parse with + | Some f -> + f + | None -> + fun ?context s -> + failwith + (Printf.sprintf + (f_ "Cannot parse field '%s' when setting value %S") + nm + s) + in + + (* Set data, from string *) + let sets data ?context s = + set ?context data (parse ?context s) + in + + (* Output value as string, if possible *) + let print = + match print with + | Some f -> + f + | None -> + fun _ -> raise (No_printer nm) + in + + (* Get data, as a string *) + let gets data = + print (get data) + in + + begin + match schema with + | Some t -> + Schema.add t nm sets gets extra help + | None -> + () + end; + + { + set = set; + get = get; + sets = sets; + gets = gets; + help = help; + extra = extra; + } + + let fset data t ?context x = + t.set data ?context x + + let fget data t = + t.get data + + let fsets data t ?context s = + t.sets data ?context s + + let fgets data t = + t.gets data + + end + + module FieldRO = + struct + + let create ?schema ?name ?parse ?print ?default ?update ?help extra = + let fld = + Field.create ?schema ?name ?parse ?print ?default ?update ?help extra + in + fun data -> Field.fget data fld + + end +end + +module OASISMessage = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISMessage.ml" + + + open OASISGettext + open OASISContext + + let generic_message ~ctxt lvl fmt = + let cond = + match lvl with + | `Debug -> ctxt.debug + | _ -> ctxt.verbose + in + Printf.ksprintf + (fun str -> + if cond then + begin + ctxt.printf lvl str + end) + fmt + + let debug ~ctxt fmt = + generic_message ~ctxt `Debug fmt + + let info ~ctxt fmt = + generic_message ~ctxt `Info fmt + + let warning ~ctxt fmt = + generic_message ~ctxt `Warning fmt + + let error ~ctxt fmt = + generic_message ~ctxt `Error fmt + + + let string_of_exception e = + try + PropList.string_of_exception e + with + | Failure s -> + s + | e -> + Printexc.to_string e + + (* TODO + let register_exn_printer f = + *) + +end + +module OASISVersion = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISVersion.ml" + + open OASISGettext + + + + type s = string + + type t = string + + type comparator = + | VGreater of t + | VGreaterEqual of t + | VEqual of t + | VLesser of t + | VLesserEqual of t + | VOr of comparator * comparator + | VAnd of comparator * comparator + + + (* Range of allowed characters *) + let is_digit c = + '0' <= c && c <= '9' + + let is_alpha c = + ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') + + let is_special = + function + | '.' | '+' | '-' | '~' -> true + | _ -> false + + let rec version_compare v1 v2 = + if v1 <> "" || v2 <> "" then + begin + (* Compare ascii string, using special meaning for version + * related char + *) + let val_ascii c = + if c = '~' then -1 + else if is_digit c then 0 + else if c = '\000' then 0 + else if is_alpha c then Char.code c + else (Char.code c) + 256 + in + + let len1 = String.length v1 in + let len2 = String.length v2 in + + let p = ref 0 in + + (** Compare ascii part *) + let compare_vascii () = + let cmp = ref 0 in + while !cmp = 0 && + !p < len1 && !p < len2 && + not (is_digit v1.[!p] && is_digit v2.[!p]) do + cmp := (val_ascii v1.[!p]) - (val_ascii v2.[!p]); + incr p + done; + if !cmp = 0 && !p < len1 && !p = len2 then + val_ascii v1.[!p] + else if !cmp = 0 && !p = len1 && !p < len2 then + - (val_ascii v2.[!p]) + else + !cmp + in + + (** Compare digit part *) + let compare_digit () = + let extract_int v p = + let start_p = !p in + while !p < String.length v && is_digit v.[!p] do + incr p + done; + match String.sub v start_p (!p - start_p) with + | "" -> 0, + v + | s -> int_of_string s, + String.sub v !p ((String.length v) - !p) + in + let i1, tl1 = extract_int v1 (ref !p) in + let i2, tl2 = extract_int v2 (ref !p) in + i1 - i2, tl1, tl2 + in + + match compare_vascii () with + | 0 -> + begin + match compare_digit () with + | 0, tl1, tl2 -> + if tl1 <> "" && is_digit tl1.[0] then + 1 + else if tl2 <> "" && is_digit tl2.[0] then + -1 + else + version_compare tl1 tl2 + | n, _, _ -> + n + end + | n -> + n + end + else + begin + 0 + end + + + let version_of_string str = + String.iter + (fun c -> + if is_alpha c || is_digit c || is_special c then + () + else + failwith + (Printf.sprintf + (f_ "Char %C is not allowed in version '%s'") + c str)) + str; + str + + let string_of_version t = + t + + let chop t = + try + let pos = + String.rindex t '.' + in + String.sub t 0 pos + with Not_found -> + t + + let rec comparator_apply v op = + match op with + | VGreater cv -> + (version_compare v cv) > 0 + | VGreaterEqual cv -> + (version_compare v cv) >= 0 + | VLesser cv -> + (version_compare v cv) < 0 + | VLesserEqual cv -> + (version_compare v cv) <= 0 + | VEqual cv -> + (version_compare v cv) = 0 + | VOr (op1, op2) -> + (comparator_apply v op1) || (comparator_apply v op2) + | VAnd (op1, op2) -> + (comparator_apply v op1) && (comparator_apply v op2) + + let rec string_of_comparator = + function + | VGreater v -> "> "^(string_of_version v) + | VEqual v -> "= "^(string_of_version v) + | VLesser v -> "< "^(string_of_version v) + | VGreaterEqual v -> ">= "^(string_of_version v) + | VLesserEqual v -> "<= "^(string_of_version v) + | VOr (c1, c2) -> + (string_of_comparator c1)^" || "^(string_of_comparator c2) + | VAnd (c1, c2) -> + (string_of_comparator c1)^" && "^(string_of_comparator c2) + + let rec varname_of_comparator = + let concat p v = + OASISUtils.varname_concat + p + (OASISUtils.varname_of_string + (string_of_version v)) + in + function + | VGreater v -> concat "gt" v + | VLesser v -> concat "lt" v + | VEqual v -> concat "eq" v + | VGreaterEqual v -> concat "ge" v + | VLesserEqual v -> concat "le" v + | VOr (c1, c2) -> + (varname_of_comparator c1)^"_or_"^(varname_of_comparator c2) + | VAnd (c1, c2) -> + (varname_of_comparator c1)^"_and_"^(varname_of_comparator c2) + +end + +module OASISLicense = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISLicense.ml" + + (** License for _oasis fields + @author Sylvain Le Gall + *) + + + + type license = string + + type license_exception = string + + type license_version = + | Version of OASISVersion.t + | VersionOrLater of OASISVersion.t + | NoVersion + + + type license_dep_5 = + { + license: license; + exceptions: license_exception list; + version: license_version; + } + + type t = + | DEP5License of license_dep_5 + | OtherLicense of string (* URL *) + + +end + +module OASISExpr = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISExpr.ml" + + + + open OASISGettext + + type test = string + + type flag = string + + type t = + | EBool of bool + | ENot of t + | EAnd of t * t + | EOr of t * t + | EFlag of flag + | ETest of test * string + + + type 'a choices = (t * 'a) list + + let eval var_get t = + let rec eval' = + function + | EBool b -> + b + + | ENot e -> + not (eval' e) + + | EAnd (e1, e2) -> + (eval' e1) && (eval' e2) + + | EOr (e1, e2) -> + (eval' e1) || (eval' e2) + + | EFlag nm -> + let v = + var_get nm + in + assert(v = "true" || v = "false"); + (v = "true") + + | ETest (nm, vl) -> + let v = + var_get nm + in + (v = vl) + in + eval' t + + let choose ?printer ?name var_get lst = + let rec choose_aux = + function + | (cond, vl) :: tl -> + if eval var_get cond then + vl + else + choose_aux tl + | [] -> + let str_lst = + if lst = [] then + s_ "<empty>" + else + String.concat + (s_ ", ") + (List.map + (fun (cond, vl) -> + match printer with + | Some p -> p vl + | None -> s_ "<no printer>") + lst) + in + match name with + | Some nm -> + failwith + (Printf.sprintf + (f_ "No result for the choice list '%s': %s") + nm str_lst) + | None -> + failwith + (Printf.sprintf + (f_ "No result for a choice list: %s") + str_lst) + in + choose_aux (List.rev lst) + +end + +module OASISTypes = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISTypes.ml" + + + + + type name = string + type package_name = string + type url = string + type unix_dirname = string + type unix_filename = string + type host_dirname = string + type host_filename = string + type prog = string + type arg = string + type args = string list + type command_line = (prog * arg list) + + type findlib_name = string + type findlib_full = string + + type compiled_object = + | Byte + | Native + | Best + + + type dependency = + | FindlibPackage of findlib_full * OASISVersion.comparator option + | InternalLibrary of name + + + type tool = + | ExternalTool of name + | InternalExecutable of name + + + type vcs = + | Darcs + | Git + | Svn + | Cvs + | Hg + | Bzr + | Arch + | Monotone + | OtherVCS of url + + + type plugin_kind = + [ `Configure + | `Build + | `Doc + | `Test + | `Install + | `Extra + ] + + type plugin_data_purpose = + [ `Configure + | `Build + | `Install + | `Clean + | `Distclean + | `Install + | `Uninstall + | `Test + | `Doc + | `Extra + | `Other of string + ] + + type 'a plugin = 'a * name * OASISVersion.t option + + type all_plugin = plugin_kind plugin + + type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list + +# 102 "/home/dim/sources/oasis/src/oasis/OASISTypes.ml" + + type 'a conditional = 'a OASISExpr.choices + + type custom = + { + pre_command: (command_line option) conditional; + post_command: (command_line option) conditional; + } + + + type common_section = + { + cs_name: name; + cs_data: PropList.Data.t; + cs_plugin_data: plugin_data; + } + + + type build_section = + { + bs_build: bool conditional; + bs_install: bool conditional; + bs_path: unix_dirname; + bs_compiled_object: compiled_object; + bs_build_depends: dependency list; + bs_build_tools: tool list; + bs_c_sources: unix_filename list; + bs_data_files: (unix_filename * unix_filename option) list; + bs_ccopt: args conditional; + bs_cclib: args conditional; + bs_dlllib: args conditional; + bs_dllpath: args conditional; + bs_byteopt: args conditional; + bs_nativeopt: args conditional; + } + + + type library = + { + lib_modules: string list; + lib_internal_modules: string list; + lib_findlib_parent: findlib_name option; + lib_findlib_name: findlib_name option; + lib_findlib_containers: findlib_name list; + } + + type executable = + { + exec_custom: bool; + exec_main_is: unix_filename; + } + + type flag = + { + flag_description: string option; + flag_default: bool conditional; + } + + type source_repository = + { + src_repo_type: vcs; + src_repo_location: url; + src_repo_browser: url option; + src_repo_module: string option; + src_repo_branch: string option; + src_repo_tag: string option; + src_repo_subdir: unix_filename option; + } + + type test = + { + test_type: [`Test] plugin; + test_command: command_line conditional; + test_custom: custom; + test_working_directory: unix_filename option; + test_run: bool conditional; + test_tools: tool list; + } + + type doc_format = + | HTML of unix_filename + | DocText + | PDF + | PostScript + | Info of unix_filename + | DVI + | OtherDoc + + + type doc = + { + doc_type: [`Doc] plugin; + doc_custom: custom; + doc_build: bool conditional; + doc_install: bool conditional; + doc_install_dir: unix_filename; + doc_title: string; + doc_authors: string list; + doc_abstract: string option; + doc_format: doc_format; + doc_data_files: (unix_filename * unix_filename option) list; + doc_build_tools: tool list; + } + + type section = + | Library of common_section * build_section * library + | Executable of common_section * build_section * executable + | Flag of common_section * flag + | SrcRepo of common_section * source_repository + | Test of common_section * test + | Doc of common_section * doc + + + type package = + { + oasis_version: OASISVersion.t; + ocaml_version: OASISVersion.comparator option; + findlib_version: OASISVersion.comparator option; + name: package_name; + version: OASISVersion.t; + license: OASISLicense.t; + license_file: unix_filename option; + copyrights: string list; + maintainers: string list; + authors: string list; + homepage: url option; + synopsis: string; + description: string option; + categories: url list; + + conf_type: [`Configure] plugin; + conf_custom: custom; + + build_type: [`Build] plugin; + build_custom: custom; + + install_type: [`Install] plugin; + install_custom: custom; + uninstall_custom: custom; + + clean_custom: custom; + distclean_custom: custom; + + files_ab: unix_filename list; + sections: section list; + plugins: [`Extra] plugin list; + schema_data: PropList.Data.t; + plugin_data: plugin_data; + } + +end + +module OASISUnixPath = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISUnixPath.ml" + + type unix_filename = string + type unix_dirname = string + + type host_filename = string + type host_dirname = string + + let current_dir_name = "." + + let parent_dir_name = ".." + + let concat f1 f2 = + if f1 = current_dir_name then + f2 + else if f2 = current_dir_name then + f1 + else + f1^"/"^f2 + + let make = + function + | hd :: tl -> + List.fold_left + (fun f p -> concat f p) + hd + tl + | [] -> + invalid_arg "OASISUnixPath.make" + + let dirname f = + try + String.sub f 0 (String.rindex f '/') + with Not_found -> + current_dir_name + + let basename f = + try + let pos_start = + (String.rindex f '/') + 1 + in + String.sub f pos_start ((String.length f) - pos_start) + with Not_found -> + f + + let chop_extension f = + try + let last_dot = + String.rindex f '.' + in + let sub = + String.sub f 0 last_dot + in + try + let last_slash = + String.rindex f '/' + in + if last_slash < last_dot then + sub + else + f + with Not_found -> + sub + + with Not_found -> + f + +end + +module OASISSection = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISSection.ml" + + (** Manipulate section + @author Sylvain Le Gall + *) + + open OASISTypes + + type section_kind = + | KLibrary + | KExecutable + | KFlag + | KSrcRepo + | KTest + | KDoc + + (** Extract generic information + *) + let section_kind_common = + function + | Library (cs, _, _) -> + KLibrary, cs + | Executable (cs, _, _) -> + KExecutable, cs + | Flag (cs, _) -> + KFlag, cs + | SrcRepo (cs, _) -> + KSrcRepo, cs + | Test (cs, _) -> + KTest, cs + | Doc (cs, _) -> + KDoc, cs + + (** Common section of a section + *) + let section_common sct = + snd (section_kind_common sct) + + (** Key used to identify section + *) + let section_id sct = + let k, cs = + section_kind_common sct + in + k, cs.cs_name + + let string_of_section sct = + let k, nm = + section_id sct + in + (match k with + | KLibrary -> "library" + | KExecutable -> "executable" + | KFlag -> "flag" + | KSrcRepo -> "src repository" + | KTest -> "test" + | KDoc -> "doc") + ^" "^nm + +end + +module OASISBuildSection = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISBuildSection.ml" + +end + +module OASISExecutable = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISExecutable.ml" + + open OASISTypes + + let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program = + let dir = + OASISUnixPath.concat + bs.bs_path + (OASISUnixPath.dirname exec.exec_main_is) + in + let is_native_exec = + match bs.bs_compiled_object with + | Native -> true + | Best -> is_native () + | Byte -> false + in + + OASISUnixPath.concat + dir + (cs.cs_name^(suffix_program ())), + + if not is_native_exec && + not exec.exec_custom && + bs.bs_c_sources <> [] then + Some (dir^"/dll"^cs.cs_name^(ext_dll ())) + else + None + +end + +module OASISLibrary = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISLibrary.ml" + + open OASISTypes + open OASISUtils + open OASISGettext + + type library_name = name + + let generated_unix_files ~ctxt (cs, bs, lib) + source_file_exists is_native ext_lib ext_dll = + (* The headers that should be compiled along *) + let headers = + List.fold_left + (fun hdrs modul -> + try + let base_fn = + List.find + (fun fn -> + source_file_exists (fn^".ml") || + source_file_exists (fn^".mli") || + source_file_exists (fn^".mll") || + source_file_exists (fn^".mly")) + (List.map + (OASISUnixPath.concat bs.bs_path) + [modul; + String.uncapitalize modul; + String.capitalize modul]) + in + [base_fn^".cmi"] :: hdrs + with Not_found -> + OASISMessage.warning + ~ctxt + (f_ "Cannot find source file matching \ + module '%s' in library %s") + modul cs.cs_name; + (List.map (OASISUnixPath.concat bs.bs_path) + [modul^".cmi"; + String.uncapitalize modul ^ ".cmi"; + String.capitalize modul ^ ".cmi"]) + :: hdrs) + [] + lib.lib_modules + in + + let acc_nopath = + [] + in + + (* Compute what libraries should be built *) + let acc_nopath = + let byte acc = + [cs.cs_name^".cma"] :: acc + in + let native acc = + [cs.cs_name^".cmxa"] :: [cs.cs_name^(ext_lib ())] :: acc + in + match bs.bs_compiled_object with + | Native -> + byte (native acc_nopath) + | Best when is_native () -> + byte (native acc_nopath) + | Byte | Best -> + byte acc_nopath + in + + (* Add C library to be built *) + let acc_nopath = + if bs.bs_c_sources <> [] then + begin + ["lib"^cs.cs_name^(ext_lib ())] + :: + ["dll"^cs.cs_name^(ext_dll ())] + :: + acc_nopath + end + else + acc_nopath + in + + (* All the files generated *) + List.rev_append + (List.rev_map + (List.rev_map + (OASISUnixPath.concat bs.bs_path)) + acc_nopath) + headers + + + type group_t = + | Container of findlib_name * (group_t list) + | Package of (findlib_name * + common_section * + build_section * + library * + (group_t list)) + + let group_libs pkg = + (** Associate a name with its children *) + let children = + List.fold_left + (fun mp -> + function + | Library (cs, bs, lib) -> + begin + match lib.lib_findlib_parent with + | Some p_nm -> + begin + let children = + try + MapString.find p_nm mp + with Not_found -> + [] + in + MapString.add p_nm ((cs, bs, lib) :: children) mp + end + | None -> + mp + end + | _ -> + mp) + MapString.empty + pkg.sections + in + + (* Compute findlib name of a single node *) + let findlib_name (cs, _, lib) = + match lib.lib_findlib_name with + | Some nm -> nm + | None -> cs.cs_name + in + + (** Build a package tree *) + let rec tree_of_library containers ((cs, bs, lib) as acc) = + match containers with + | hd :: tl -> + Container (hd, [tree_of_library tl acc]) + | [] -> + Package + (findlib_name acc, cs, bs, lib, + (try + List.rev_map + (fun ((_, _, child_lib) as child_acc) -> + tree_of_library + child_lib.lib_findlib_containers + child_acc) + (MapString.find cs.cs_name children) + with Not_found -> + [])) + in + + (** Merge containers with the same name *) + let rec merge_containers groups = + (* Collect packages and create the map "container name -> merged children" *) + let packages, containers = + List.fold_left + (fun (packages, containers) group -> + match group with + | Container(name, children) -> + let children' = + try + MapString.find name containers + with Not_found -> + [] + in + (packages, + MapString.add name (children' @ children) containers) + | Package(name, cs, bs, lib, children) -> + (Package(name, cs, bs, lib, merge_containers children) :: packages, + containers)) + ([], MapString.empty) + groups + in + (* Recreate the list of groups *) + packages @ + (MapString.fold + (fun name children acc -> + Container(name, merge_containers children) :: acc) + containers []) + in + + (* TODO: check that libraries are unique *) + merge_containers + (List.fold_left + (fun acc -> + function + | Library (cs, bs, lib) when lib.lib_findlib_parent = None -> + (tree_of_library lib.lib_findlib_containers (cs, bs, lib)) :: acc + | _ -> + acc) + [] + pkg.sections) + + (** Compute internal to findlib library matchings, including subpackage + and return a map of it. + *) + let findlib_name_map pkg = + + (* Compute names in a tree *) + let rec findlib_names_aux path mp grp = + let fndlb_nm, children, mp = + match grp with + | Container (fndlb_nm, children) -> + fndlb_nm, children, mp + + | Package (fndlb_nm, {cs_name = nm}, _, _, children) -> + fndlb_nm, children, (MapString.add nm (path, fndlb_nm) mp) + in + let fndlb_nm_full = + (match path with + | Some pth -> pth^"." + | None -> "")^ + fndlb_nm + in + List.fold_left + (findlib_names_aux (Some fndlb_nm_full)) + mp + children + in + + List.fold_left + (findlib_names_aux None) + MapString.empty + (group_libs pkg) + + + let findlib_of_name ?(recurse=false) map nm = + try + let (path, fndlb_nm) = + MapString.find nm map + in + match path with + | Some pth when recurse -> pth^"."^fndlb_nm + | _ -> fndlb_nm + + with Not_found -> + failwithf1 + (f_ "Unable to translate internal library '%s' to findlib name") + nm + + let name_findlib_map pkg = + let mp = + findlib_name_map pkg + in + MapString.fold + (fun nm _ acc -> + let fndlb_nm_full = + findlib_of_name + ~recurse:true + mp + nm + in + MapString.add fndlb_nm_full nm acc) + mp + MapString.empty + + let findlib_of_group = + function + | Container (fndlb_nm, _) + | Package (fndlb_nm, _, _, _, _) -> fndlb_nm + + let root_of_group grp = + let rec root_lib_aux = + function + | Container (_, children) -> + root_lib_lst children + | Package (_, cs, bs, lib, children) -> + if lib.lib_findlib_parent = None then + cs, bs, lib + else + root_lib_lst children + and root_lib_lst = + function + | [] -> + raise Not_found + | hd :: tl -> + try + root_lib_aux hd + with Not_found -> + root_lib_lst tl + in + try + root_lib_aux grp + with Not_found -> + failwithf1 + (f_ "Unable to determine root library of findlib library '%s'") + (findlib_of_group grp) + + +end + +module OASISFlag = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISFlag.ml" + +end + +module OASISPackage = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISPackage.ml" + +end + +module OASISSourceRepository = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISSourceRepository.ml" + +end + +module OASISTest = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISTest.ml" + +end + +module OASISDocument = struct +# 21 "/home/dim/sources/oasis/src/oasis/OASISDocument.ml" + +end + + +module BaseEnvLight = struct +# 21 "/home/dim/sources/oasis/src/base/BaseEnvLight.ml" + + module MapString = Map.Make(String) + + type t = string MapString.t + + let default_filename = + Filename.concat + (Sys.getcwd ()) + "setup.data" + + let load ?(allow_empty=false) ?(filename=default_filename) () = + if Sys.file_exists filename then + begin + let chn = + open_in_bin filename + in + let st = + Stream.of_channel chn + in + let line = + ref 1 + in + let st_line = + Stream.from + (fun _ -> + try + match Stream.next st with + | '\n' -> incr line; Some '\n' + | c -> Some c + with Stream.Failure -> None) + in + let lexer = + Genlex.make_lexer ["="] st_line + in + let rec read_file mp = + match Stream.npeek 3 lexer with + | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] -> + Stream.junk lexer; + Stream.junk lexer; + Stream.junk lexer; + read_file (MapString.add nm value mp) + | [] -> + mp + | _ -> + failwith + (Printf.sprintf + "Malformed data file '%s' line %d" + ... [truncated message content] |
From: oiffrig <Ba...@us...> - 2011-03-09 23:20:24
|
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 8b653af138a0c699b966c1cddddfc562c107ed66 (commit) from e476dc09ceff35fb8cdb02567bd1e6a05087b85f (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 8b653af138a0c699b966c1cddddfc562c107ed66 Author: Olivier Iffrig <if...@cr...> Date: Thu Mar 10 00:18:46 2011 +0100 [support miroir] Trous à la bonne distance... ----------------------------------------------------------------------- Changes: diff --git a/meca/2011_Senior/Balises/support_miroir.scad b/meca/2011_Senior/Balises/support_miroir.scad index f78edff..c00c396 100644 --- a/meca/2011_Senior/Balises/support_miroir.scad +++ b/meca/2011_Senior/Balises/support_miroir.scad @@ -8,13 +8,15 @@ dim_miroir = 25.; // Taille du miroir ep_miroir = 2.; // Épaisseur du miroir diam_trou = 7.; // Diamètre du trou diam_vis = 3.1; // Diamètre du trou -ep_fond = 2.; // Épaisseur du fond du trou +ep_fond = 3.5; // Épaisseur du fond du trou dist_trous = 18.3; // Distance entre les trous // distance extérieure 21mm // diamètre trous 2.7mm -D_min = 150.; // Distance minimale d'approche -D_max = 4000.; // Distance maximale +//D_min = 150.; // Distance minimale d'approche +//D_max = 4000.; // Distance maximale +D_min = 370.; // Distance minimale d'approche +D_max = 1200.; // Distance maximale d_balise = 40.; // Décalage du bas de la balise par rapport au miroir h_balise = 80.; // Hauteur de la balise @@ -41,7 +43,7 @@ module trou() { } // Pièce -difference() { +rotate([90, 0, 0]) difference() { // Base scale(dim_base) linear_extrude(height=1, center=false) @@ -52,8 +54,8 @@ difference() { rotate([0, 0, 90. - phi]) cube([ep_miroir, dim_miroir, dim_miroir], center=true); - translate([dim_base/2., 0, dist_trous/2.]) rotate([-90, 0, 0]) trou(); + translate([dim_base/2., 0, dim_base/2. - dist_trous/2.]) rotate([-90, 0, 0]) trou(); - translate([dim_base/2., 0, dim_base - dist_trous/2.]) rotate([-90, 0, 0]) trou(); + translate([dim_base/2., 0, dim_base/2. + dist_trous/2.]) rotate([-90, 0, 0]) trou(); } hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2011-03-09 22:36:56
|
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 e476dc09ceff35fb8cdb02567bd1e6a05087b85f (commit) from 0593cd300075efed3225933eb84e318a15a53cca (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 e476dc09ceff35fb8cdb02567bd1e6a05087b85f Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 9 23:35:08 2011 +0100 [Controller_Motor_STM32] Rock and Roll's ! (but mainly rolls...) ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c index 65e8e2e..c7eac19 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c @@ -75,6 +75,39 @@ static void NORETURN blink_process(void) } } +static void NORETURN square_process(void) +{ + /* blinkenlichten ! */ + while (1) + { + motorSetSpeed(MOTOR3 | MOTOR4, 500); + timer_delay(2000); + motorSetSpeed(MOTOR3, -500); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 500); + timer_delay(2000); + motorSetSpeed(MOTOR4, -500); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 500); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 1000); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 1500); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 2000); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 2500); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 3000); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 3500); + timer_delay(2000); + motorSetSpeed(MOTOR3 | MOTOR4, 0); + timer_delay(2000); + break; + } +} + int main(void) { @@ -83,8 +116,9 @@ int main(void) /* Create a new child process */ proc_new(speaktome_process, NULL, KERN_MINSTACKSIZE * 2, NULL); proc_new(blink_process, NULL, KERN_MINSTACKSIZE * 2, NULL); + proc_new(square_process, NULL, KERN_MINSTACKSIZE * 2, NULL); - LED3_ON(); + enableMotor(MOTOR3 | MOTOR4); /* * The main process is kept to periodically report the stack hooks/post-receive -- krobot |
From: oiffrig <Ba...@us...> - 2011-03-09 22:11:15
|
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 0593cd300075efed3225933eb84e318a15a53cca (commit) from cd2cfc4c2e3ad7102f78c6d6d508c23a6f2139aa (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 0593cd300075efed3225933eb84e318a15a53cca Author: Olivier Iffrig <if...@cr...> Date: Wed Mar 9 23:09:59 2011 +0100 Support de miroir complet ----------------------------------------------------------------------- Changes: diff --git a/meca/2011_Senior/Balises/support_miroir.scad b/meca/2011_Senior/Balises/support_miroir.scad index f040c3e..f78edff 100644 --- a/meca/2011_Senior/Balises/support_miroir.scad +++ b/meca/2011_Senior/Balises/support_miroir.scad @@ -1,12 +1,22 @@ +$fs = 0.1; +$fa = 5; +epsilon = 0.1; + dim_base = 30.; // Taille de la base dim_miroir = 25.; // Taille du miroir ep_miroir = 2.; // Épaisseur du miroir +diam_trou = 7.; // Diamètre du trou +diam_vis = 3.1; // Diamètre du trou +ep_fond = 2.; // Épaisseur du fond du trou +dist_trous = 18.3; // Distance entre les trous +// distance extérieure 21mm +// diamètre trous 2.7mm D_min = 150.; // Distance minimale d'approche D_max = 4000.; // Distance maximale -d_balise = 100.; // Décalage du bas de la balise par rapport au miroir +d_balise = 40.; // Décalage du bas de la balise par rapport au miroir h_balise = 80.; // Hauteur de la balise // Calculs @@ -25,6 +35,11 @@ phi = 45. + theta / 2.; echo("Angle du miroir par rapport à l'horizontale"); echo(phi); +module trou() { + translate([0, 0, ep_fond]) cylinder(r=diam_trou/2., h=dim_base * tan(phi)); + translate([0, 0, -epsilon]) cylinder(r=diam_vis/2., h=dim_base * tan(phi)); +} + // Pièce difference() { // Base @@ -36,5 +51,9 @@ difference() { #translate([dim_base / 2., dim_base * tan(phi)/2., dim_base / 2.]) rotate([0, 0, 90. - phi]) cube([ep_miroir, dim_miroir, dim_miroir], center=true); + + translate([dim_base/2., 0, dist_trous/2.]) rotate([-90, 0, 0]) trou(); + + translate([dim_base/2., 0, dim_base - dist_trous/2.]) rotate([-90, 0, 0]) trou(); } hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2011-03-09 17:43:29
|
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 cd2cfc4c2e3ad7102f78c6d6d508c23a6f2139aa (commit) via 8909d78726794fe3c2322ac35cfe2a49f6172a18 (commit) from d66c75758ef8ece9b93d406ace55c474d0480d77 (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 cd2cfc4c2e3ad7102f78c6d6d508c23a6f2139aa Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 9 18:41:11 2011 +0100 [Motor_Controller_STM32] Added a rapid stm32lib inclusion for PWM management commit 8909d78726794fe3c2322ac35cfe2a49f6172a18 Author: Xavier Lagorce <Xav...@cr...> Date: Wed Mar 9 18:35:45 2011 +0100 [Motor_Controller_STM32] Trying to activate USART3 Remapping ----------------------------------------------------------------------- Changes: diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk index ee4547c..7202af8 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/controller_motor_stm32_user.mk @@ -9,6 +9,9 @@ controller_motor_stm32_PROGRAMMER_PORT = none # Files included by the user. controller_motor_stm32_USER_CSRC = \ + $(controller_motor_stm32_SRC_PATH)/stm32lib/stm32f10x_rcc.c \ + $(controller_motor_stm32_SRC_PATH)/stm32lib/stm32f10x_tim.c \ + $(controller_motor_stm32_SRC_PATH)/motor.c \ $(controller_motor_stm32_SRC_PATH)/main.c \ # diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c index 507af4e..65e8e2e 100644 --- a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/main.c @@ -1,4 +1,8 @@ -// Empty main.c file generated by the wizard +/* + * Firmware for Controller Motor STM32 + * + * Author : Xavier Lagorce <Xav...@cr...> + */ #include <cpu/irq.h> #include <cfg/debug.h> #include <drv/timer.h> @@ -8,13 +12,20 @@ #include <math.h> #include "hw/hw_led.h" +#include "motor.h" static void init(void) { IRQ_ENABLE; // Remapping peripherals + // Enable clocking on AFIO + RCC->APB2ENR |= RCC_APB2_AFIO; + // Remap UART3 stm32_gpioRemap(GPIO_PARTIALREMAP_USART3, GPIO_REMAP_ENABLE); + // UART3 TX in ouput AF mode + stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(10), + GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); /* Initialize debugging module (allow kprintf(), etc.) */ kdbg_init(); @@ -29,9 +40,9 @@ static void init(void) // Initialize LED driver LEDS_INIT(); - stm32_gpioPinConfig((struct stm32_gpio *)GPIOB_BASE, BV(10), - GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); + // Initialize MOTOR driver + motorsInit(); } static void NORETURN speaktome_process(void) diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor.c b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor.c new file mode 100644 index 0000000..8ef9979 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor.c @@ -0,0 +1,359 @@ +/* + * Motor controller interface + * This is a quick implementation based of the stm32lib from ST and from + * previous implementations. + * + * This is supposed to be quick and dirty, waiting for BeRTOS proper + * PWMs integration, to allow work on other systems using PWMs. + * + * Author : Xavier Lagorce + */ + +#include "motor.h" +#include <cfg/macros.h> +#include <drv/gpio_stm32.h> +#include "stm32lib/stm32f10x_tim.h" + +uint8_t enabledMotors = 0, indMotors = 0; +signed char currentSpeedSign[] = {0, 0, 0, 0}; +TIM_OCInitTypeDef TIM_OCInitStructure; + +/* + Some dirty imports from the stm32lib from ST <stm32_lib> + */ + +//#define __IO volatile /*!< defines 'read / write' permissions */ +//typedef __IO uint16_t vu16; + + +/* + End of imports </stm32_lib> + */ + +/* + * Initialises TIM2 for PWM generation and associated GPIOs + */ +void motorsInit(void) { + + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + + //Enable GPIOA, GPIOB, GPIOC and GPIOD clock + RCC->APB2ENR |= RCC_APB2_GPIOA | RCC_APB2_GPIOB | RCC_APB2_GPIOC | RCC_APB2_GPIOD; + + //Enable timer clock + RCC->APB1ENR |= RCC_APB1_TIM2; + + //Setup timer for quadrature encoder interface + //Motor1 : EN PA5 + // INA PC4 + // INB PC5 + // PWM PA0 + // IND LED1 + //Motor2 : EN PB15 + // INA PB1 + // INB PB14 + // PWM PA1 + // IND LED2 + //Motor3 : EN PA10 + // INA PC10 + // INB PC11 + // PWM PA2 + // IND LED3 + //Motor4 : EN PD2 + // INA PB5 + // INB PD9 + // PWM PA3 + // IND LED4 + stm32_gpioPinConfig(((struct stm32_gpio *)GPIOA_BASE), + BV(5) | BV(10), + GPIO_MODE_OUT_PP, GPIO_SPEED_50MHZ); + stm32_gpioPinConfig(((struct stm32_gpio *)GPIOA_BASE), + BV(0) | BV(1) | BV(2) | BV(3), + GPIO_MODE_AF_PP, GPIO_SPEED_50MHZ); + stm32_gpioPinConfig(((struct stm32_gpio *)GPIOB_BASE), + BV(1) | BV(5) | BV(9) | BV(14) | BV(15), + GPIO_MODE_OUT_PP, GPIO_SPEED_50MHZ); + stm32_gpioPinConfig(((struct stm32_gpio *)GPIOC_BASE), + BV(4) | BV(5) | BV(10) | BV(11), + GPIO_MODE_OUT_PP, GPIO_SPEED_50MHZ); + stm32_gpioPinConfig(((struct stm32_gpio *)GPIOD_BASE), + BV(2), + GPIO_MODE_OUT_PP, GPIO_SPEED_50MHZ); + + // Default value of H-Bridge configuration + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOA_BASE), + BV(5) | BV(10), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), + BV(1) | BV(5) | BV(9) | BV(14) | BV(15), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), + BV(4) | BV(5) | BV(10) | BV(11), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOD_BASE), + BV(2), 0); + + // TimeBase configuration + TIM_TimeBaseStructure.TIM_Prescaler = (uint16_t) (72000000 / 72000000) - 1;; + TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; + TIM_TimeBaseStructure.TIM_Period = 3600; // 20 kHz + TIM_TimeBaseStructure.TIM_ClockDivision = 0; + TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure); + + // PWM1 Mode configuration: Channel1 + TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; + TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; + TIM_OCInitStructure.TIM_Pulse = 0; + TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; + + TIM_OC1Init(TIM2, &TIM_OCInitStructure); + TIM_OC1PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_OC2Init(TIM2, &TIM_OCInitStructure); + TIM_OC2PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_OC3Init(TIM2, &TIM_OCInitStructure); + TIM_OC3PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_OC4Init(TIM2, &TIM_OCInitStructure); + TIM_OC4PreloadConfig(TIM2, TIM_OCPreload_Enable); + + // All motors are disabled + enabledMotors = 0; + + //Enable timer Peripherals + TIM_Cmd(TIM2,ENABLE); + + // Disable indicators + //GPIO_ResetBits(GPIOC, GPIO_Pin_3 | GPIO_Pin_5 | GPIO_Pin_9); +} + +/* + * Enable a motor driver + */ +void enableMotor(uint8_t motor) { + + if (motor & MOTOR1) { + enabledMotors |= MOTOR1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOA_BASE), BV(5), 1); + } + if (motor & MOTOR2) { + enabledMotors |= MOTOR2; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(15), 1); + } + if (motor & MOTOR3) { + enabledMotors |= MOTOR3; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOA_BASE), BV(10), 1); + } + if (motor & MOTOR4) { + enabledMotors |= MOTOR4; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOD_BASE), BV(2), 1); + } +} + +/* + * Disable a motor driver + */ +void disableMotor(uint8_t motor) { + + if (motor & MOTOR1) { + enabledMotors &= ~MOTOR1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOA_BASE), BV(5), 0); + } + if (motor & MOTOR2) { + enabledMotors &= ~MOTOR2; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(15), 0); + } + if (motor & MOTOR3) { + enabledMotors &= ~MOTOR3; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOA_BASE), BV(10), 0); + } + if (motor & MOTOR4) { + enabledMotors &= ~MOTOR4; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOD_BASE), BV(2), 0); + } +} + +/* + * Step one motor's speed + */ +void motorSetSpeed(uint8_t motor, int32_t speed) { + + uint8_t ind = 0; + + if (speed == 0) { + motorStop(motor, MOTOR_BRAKE); + return; + } + + if (speed >= MAX_PWM) { + speed = MAX_PWM; + ind = 1; + } else if (speed <= -MAX_PWM) { + speed = -MAX_PWM; + ind = 1; + } else { + ind = 0; + } + + if (motor & MOTOR1) { + if(speed > 0) { + if (currentSpeedSign[0] != 1) { + currentSpeedSign[0] = 1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(4), 1); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(5), 0); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)speed; + } else { + if (currentSpeedSign[0] != -1) { + currentSpeedSign[0] = -1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(4), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(5), 1); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)(-speed); + } + TIM_OC1Init(TIM2, &TIM_OCInitStructure); + TIM_OC1PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_ARRPreloadConfig(TIM2, ENABLE); + if (ind) { + if ((indMotors & MOTOR1) == 0) { + //GPIO_SetBits(GPIOC, GPIO_Pin_3); + indMotors |= MOTOR1; + } + } else if ((indMotors & MOTOR1) != 0) { + //GPIO_ResetBits(GPIOC, GPIO_Pin_3); + indMotors &= ~MOTOR1; + } + } + if (motor & MOTOR2) { + if(speed > 0) { + if (currentSpeedSign[1] != 1) { + currentSpeedSign[1] = 1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(1), 1); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(14), 0); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)speed; + } else { + if (currentSpeedSign[1] != -1) { + currentSpeedSign[1] = -1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(1), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(14), 1); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)(-speed); + } + TIM_OC2Init(TIM2, &TIM_OCInitStructure); + TIM_OC2PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_ARRPreloadConfig(TIM2, ENABLE); + if (ind) { + if ((indMotors & MOTOR2) == 0) { + //GPIO_SetBits(GPIOC, GPIO_Pin_5); + indMotors |= MOTOR2; + } + } else if ((indMotors & MOTOR2) != 0) { + //GPIO_ResetBits(GPIOC, GPIO_Pin_5); + indMotors &= ~MOTOR2; + } + } + if (motor & MOTOR3) { + if(speed > 0) { + if (currentSpeedSign[2] != 1) { + currentSpeedSign[2] = 1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(10), 1); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(11), 0); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)speed; + } else { + if (currentSpeedSign[2] != -1) { + currentSpeedSign[2] = -1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(10), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(11), 1); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)(-speed); + } + TIM_OC3Init(TIM2, &TIM_OCInitStructure); + TIM_OC3PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_ARRPreloadConfig(TIM2, ENABLE); + if (ind) { + if ((indMotors & MOTOR3) == 0) { + //GPIO_SetBits(GPIOC, GPIO_Pin_9); + indMotors |= MOTOR3; + } + } else if ((indMotors & MOTOR3) != 0) { + //GPIO_ResetBits(GPIOC, GPIO_Pin_9); + indMotors &= ~MOTOR3; + } + } + if (motor & MOTOR4) { + if(speed > 0) { + if (currentSpeedSign[3] != 1) { + currentSpeedSign[3] = 1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(5), 1); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(9), 0); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)speed; + } else { + if (currentSpeedSign[3] != -1) { + currentSpeedSign[3] = -1; + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(5), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(9), 1); + } + TIM_OCInitStructure.TIM_Pulse = (uint16_t)(-speed); + } + TIM_OC4Init(TIM2, &TIM_OCInitStructure); + TIM_OC4PreloadConfig(TIM2, TIM_OCPreload_Enable); + TIM_ARRPreloadConfig(TIM2, ENABLE); + if (ind) { + if ((indMotors & MOTOR4) == 0) { + //GPIO_SetBits(GPIOC, GPIO_Pin_9); + indMotors |= MOTOR4; + } + } else if ((indMotors & MOTOR4) != 0) { + //GPIO_ResetBits(GPIOC, GPIO_Pin_9); + indMotors &= ~MOTOR4; + } + } +} + +/* + * Stop a motor using the 'mode' mode. + */ +void motorStop(uint8_t motor, uint8_t mode) { + + if (mode == MOTOR_STOP) { + if (motor & MOTOR1) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(4), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(5), 0); + currentSpeedSign[0] = 0; + } + if (motor & MOTOR2) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(1), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(14), 0); + currentSpeedSign[1] = 0; + } + if (motor & MOTOR3) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(10), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(11), 0); + currentSpeedSign[2] = 0; + } + if (motor & MOTOR4) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(5), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(9), 0); + currentSpeedSign[3] = 0; + } + } else if (mode == MOTOR_BRAKE) { + if (motor & MOTOR1) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(4), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(5), 0); + currentSpeedSign[0] = 0; + } + if (motor & MOTOR2) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(1), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(14), 0); + currentSpeedSign[1] = 0; + } + if (motor & MOTOR3) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(10), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOC_BASE), BV(11), 0); + currentSpeedSign[2] = 0; + } + if (motor & MOTOR4) { + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(5), 0); + stm32_gpioPinWrite(((struct stm32_gpio *)GPIOB_BASE), BV(9), 0); + currentSpeedSign[3] = 0; + } + } +} diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor.h b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor.h new file mode 100644 index 0000000..d69ceeb --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/motor.h @@ -0,0 +1,34 @@ +/* + * Motor controller interface + * This is a quick implementation based of the stm32lib from ST and from + * previous implementations. + * + * This is supposed to be quick and dirty, waiting for BeRTOS proper + * PWMs integration, to allow work on other systems using PWMs. + * + * Author : Xavier Lagorce + */ + +#ifndef HEADER__MOTOR +#define HEADER__MOTOR + +#define MOTOR1 1 +#define MOTOR2 2 +#define MOTOR3 4 +#define MOTOR4 8 + +#define MOTOR_STOP 1 +#define MOTOR_BRAKE 2 + +#define MAX_PWM 3600 + +#include <drv/gpio_stm32.h> +#include <drv/clock_stm32.h> + +void motorsInit(void); +void enableMotor(uint8_t motor); +void disableMotor(uint8_t motor); +void motorSetSpeed(uint8_t motor, int32_t speed); +void motorStop(uint8_t motor, uint8_t mode); + +#endif diff --git a/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/stm32lib/core_cm3.h b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/stm32lib/core_cm3.h new file mode 100644 index 0000000..5c75ec8 --- /dev/null +++ b/elec/boards/Controller_Motor_STM32/Firmware/controller_motor_stm32/stm32lib/core_cm3.h @@ -0,0 +1,1842 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +/* + * Parts of this files have been modified in ChibiOS/RT in order to fix + * some code quality issues. + */ + +/**************************************************************************//** + * @file core_cm3.h + * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File + * @version V1.30 + * @date 30. October 2009 + * + * @note + * Copyright (C) 2009 ARM Limited. All rights reserved. + * + * @par + * ARM Limited (ARM) is supplying this software for use with Cortex-M + * processor based microcontrollers. This file can be freely distributed + * within development tools that are supporting such ARM based processors. + * + * @par + * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED + * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. + * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + * + ******************************************************************************/ + +#ifndef __CM3_CORE_H__ +#define __CM3_CORE_H__ + +/** @addtogroup CMSIS_CM3_core_LintCinfiguration CMSIS CM3 Core Lint Configuration + * + * List of Lint messages which will be suppressed and not shown: + * - Error 10: \n + * register uint32_t __regBasePri __asm("basepri"); \n + * Error 10: Expecting ';' + * . + * - Error 530: \n + * return(__regBasePri); \n + * Warning 530: Symbol '__regBasePri' (line 264) not initialized + * . + * - Error 550: \n + * __regBasePri = (basePri & 0x1ff); \n + * Warning 550: Symbol '__regBasePri' (line 271) not accessed + * . + * - Error 754: \n + * uint32_t RESERVED0[24]; \n + * Info 754: local structure member '<some, not used in the HAL>' (line 109, file ./cm3_core.h) not referenced + * . + * - Error 750: \n + * #define __CM3_CORE_H__ \n + * Info 750: local macro '__CM3_CORE_H__' (line 43, file./cm3_core.h) not referenced + * . + * - Error 528: \n + * static __INLINE void NVIC_DisableIRQ(uint32_t IRQn) \n + * Warning 528: Symbol 'NVIC_DisableIRQ(unsigned int)' (line 419, file ./cm3_core.h) not referenced + * . + * - Error 751: \n + * } InterruptType_Type; \n + * Info 751: local typedef 'InterruptType_Type' (line 170, file ./cm3_core.h) not referenced + * . + * Note: To re-enable a Message, insert a space before 'lint' * + * + */ + +/*lint -save */ +/*lint -e10 */ +/*lint -e530 */ +/*lint -e550 */ +/*lint -e754 */ +/*lint -e750 */ +/*lint -e528 */ +/*lint -e751 */ + + +/** @addtogroup CMSIS_CM3_core_definitions CM3 Core Definitions + This file defines all structures and symbols for CMSIS core: + - CMSIS version number + - Cortex-M core registers and bitfields + - Cortex-M core peripheral base address + @{ + */ + +#ifdef __cplusplus + extern "C" { +#endif + +#define __CM3_CMSIS_VERSION_MAIN (0x01) /*!< [31:16] CMSIS HAL main version */ +#define __CM3_CMSIS_VERSION_SUB (0x30) /*!< [15:0] CMSIS HAL sub version */ +#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | __CM3_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */ + +#define __CORTEX_M (0x03) /*!< Cortex core */ + +#include <stdint.h> /* Include standard types */ + +#if defined (__ICCARM__) + #include <intrinsics.h> /* IAR Intrinsics */ +#endif + + +#ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 4 /*!< standard definition for NVIC Priority Bits */ +#endif + + + + +/** + * IO definitions + * + * define access restrictions to peripheral registers + */ + +#ifdef __cplusplus + #define __I volatile /*!< defines 'read only' permissions */ +#else + #define __I volatile const /*!< defines 'read only' permissions */ +#endif +#define __O volatile /*!< defines 'write only' permissions */ +#define __IO volatile /*!< defines 'read / write' permissions */ + + + +/******************************************************************************* + * Register Abstraction + ******************************************************************************/ +/** @addtogroup CMSIS_CM3_core_register CMSIS CM3 Core Register + @{ +*/ + + +/** @addtogroup CMSIS_CM3_NVIC CMSIS CM3 NVIC + memory mapped structure for Nested Vectored Interrupt Controller (NVIC) + @{ + */ +typedef struct +{ + __IO uint32_t ISER[8]; /*!< Offset: 0x000 Interrupt Set Enable Register */ + uint32_t RESERVED0[24]; + __IO uint32_t ICER[8]; /*!< Offset: 0x080 Interrupt Clear Enable Register */ + uint32_t RSERVED1[24]; + __IO uint32_t ISPR[8]; /*!< Offset: 0x100 Interrupt Set Pending Register */ + uint32_t RESERVED2[24]; + __IO uint32_t ICPR[8]; /*!< Offset: 0x180 Interrupt Clear Pending Register */ + uint32_t RESERVED3[24]; + __IO uint32_t IABR[8]; /*!< Offset: 0x200 Interrupt Active bit Register */ + uint32_t RESERVED4[56]; + __IO uint8_t IP[240]; /*!< Offset: 0x300 Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644]; + __O uint32_t STIR; /*!< Offset: 0xE00 Software Trigger Interrupt Register */ +} NVIC_Type; +/*@}*/ /* end of group CMSIS_CM3_NVIC */ + + +/** @addtogroup CMSIS_CM3_SCB CMSIS CM3 SCB + memory mapped structure for System Control Block (SCB) + @{ + */ +typedef struct +{ + __I uint32_t CPUID; /*!< Offset: 0x00 CPU ID Base Register */ + __IO uint32_t ICSR; /*!< Offset: 0x04 Interrupt Control State Register */ + __IO uint32_t VTOR; /*!< Offset: 0x08 Vector Table Offset Register */ + __IO uint32_t AIRCR; /*!< Offset: 0x0C Application Interrupt / Reset Control Register */ + __IO uint32_t SCR; /*!< Offset: 0x10 System Control Register */ + __IO uint32_t CCR; /*!< Offset: 0x14 Configuration Control Register */ + __IO uint8_t SHP[12]; /*!< Offset: 0x18 System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IO uint32_t SHCSR; /*!< Offset: 0x24 System Handler Control and State Register */ + __IO uint32_t CFSR; /*!< Offset: 0x28 Configurable Fault Status Register */ + __IO uint32_t HFSR; /*!< Offset: 0x2C Hard Fault Status Register */ + __IO uint32_t DFSR; /*!< Offset: 0x30 Debug Fault Status Register */ + __IO uint32_t MMFAR; /*!< Offset: 0x34 Mem Manage Address Register */ + __IO uint32_t BFAR; /*!< Offset: 0x38 Bus Fault Address Register */ + __IO uint32_t AFSR; /*!< Offset: 0x3C Auxiliary Fault Status Register */ + __I uint32_t PFR[2]; /*!< Offset: 0x40 Processor Feature Register */ + __I uint32_t DFR; /*!< Offset: 0x48 Debug Feature Register */ + __I uint32_t ADR; /*!< Offset: 0x4C Auxiliary Feature Register */ + __I uint32_t MMFR[4]; /*!< Offset: 0x50 Memory Model Feature Register */ + __I uint32_t ISAR[5]; /*!< Offset: 0x60 ISA Feature Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFul << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFul << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFul << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFul << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1ul << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1ul << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1ul << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1ul << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1ul << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1ul << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1ul << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFul << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1ul << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFul << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (0x1FFul << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFul << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFul << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFul << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1ul << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7ul << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1ul << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1ul << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1ul << SCB_AIRCR_VECTRESET_Pos) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1ul << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1ul << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1ul << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1ul << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1ul << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1ul << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1ul << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1ul << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1ul << SCB_CCR_NONBASETHRDENA_Pos) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1ul << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1ul << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1ul << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1ul << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1ul << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1ul << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1ul << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1ul << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1ul << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1ul << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1ul << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1ul << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1ul << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1ul << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Registers Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFul << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFul << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFul << SCB_CFSR_MEMFAULTSR_Pos) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* SCB Hard Fault Status Registers Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1ul << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1ul << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1ul << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1ul << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1ul << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1ul << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1ul << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1ul << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */ +/*@}*/ /* end of group CMSIS_CM3_SCB */ + + +/** @addtogroup CMSIS_CM3_SysTick CMSIS CM3 SysTick + memory mapped structure for SysTick + @{ + */ +typedef struct +{ + __IO uint32_t CTRL; /*!< Offset: 0x00 SysTick Control and Status Register */ + __IO uint32_t LOAD; /*!< Offset: 0x04 SysTick Reload Value Register */ + __IO uint32_t VAL; /*!< Offset: 0x08 SysTick Current Value Register */ + __I uint32_t CALIB; /*!< Offset: 0x0C SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1ul << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1ul << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1ul << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1ul << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFul << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1ul << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1ul << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */ +/*@}*/ /* end of group CMSIS_CM3_SysTick */ + + +/** @addtogroup CMSIS_CM3_ITM CMSIS CM3 ITM + memory mapped structure for Instrumentation Trace Macrocell (ITM) + @{ + */ +typedef struct +{ + __O union + { + __O uint8_t u8; /*!< Offset: ITM Stimulus Port 8-bit */ + __O uint16_t u16; /*!< Offset: ITM Stimulus Port 16-bit */ + __O uint32_t u32; /*!< Offset: ITM Stimulus Port 32-bit */ + } PORT [32]; /*!< Offset: 0x00 ITM Stimulus Port Registers */ + uint32_t RESERVED0[864]; + __IO uint32_t TER; /*!< Offset: ITM Trace Enable Register */ + uint32_t RESERVED1[15]; + __IO uint32_t TPR; /*!< Offset: ITM Trace Privilege Register */ + uint32_t RESERVED2[15]; + __IO uint32_t TCR; /*!< Offset: ITM Trace Control Register */ + uint32_t RESERVED3[29]; + __IO uint32_t IWR; /*!< Offset: ITM Integration Write Register */ + __IO uint32_t IRR; /*!< Offset: ITM Integration Read Register */ + __IO uint32_t IMCR; /*!< Offset: ITM Integration Mode Control Register */ + uint32_t RESERVED4[43]; + __IO uint32_t LAR; /*!< Offset: ITM Lock Access Register */ + __IO uint32_t LSR; /*!< Offset: ITM Lock Status Register */ + uint32_t RESERVED5[6]; + __I uint32_t PID4; /*!< Offset: ITM Peripheral Identification Register #4 */ + __I uint32_t PID5; /*!< Offset: ITM Peripheral Identification Register #5 */ + __I uint32_t PID6; /*!< Offset: ITM Peripheral Identification Register #6 */ + __I uint32_t PID7; /*!< Offset: ITM Peripheral Identification Register #7 */ + __I uint32_t PID0; /*!< Offset: ITM Peripheral Identification Register #0 */ + __I uint32_t PID1; /*!< Offset: ITM Peripheral Identification Register #1 */ + __I uint32_t PID2; /*!< Offset: ITM Peripheral Identification Register #2 */ + __I uint32_t PID3; /*!< Offset: ITM Peripheral Identification Register #3 */ + __I uint32_t CID0; /*!< Offset: ITM Component Identification Register #0 */ + __I uint32_t CID1; /*!< Offset: ITM Component Identification Register #1 */ + __I uint32_t CID2; /*!< Offset: ITM Component Identification Register #2 */ + __I uint32_t CID3; /*!< Offset: ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFul << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1ul << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_ATBID_Pos 16 /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_ATBID_Msk (0x7Ful << ITM_TCR_ATBID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3ul << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1ul << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1ul << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1ul << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1ul << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1ul << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1ul << ITM_IWR_ATVALIDM_Pos) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1ul << ITM_IRR_ATREADYM_Pos) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1ul << ITM_IMCR_INTEGRATION_Pos) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1ul << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1ul << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1ul << ITM_LSR_Present_Pos) /*!< ITM LSR: Present Mask */ +/*@}*/ /* end of group CMSIS_CM3_ITM */ + + +/** @addtogroup CMSIS_CM3_InterruptType CMSIS CM3 Interrupt Type + memory mapped structure for Interrupt Type + @{ + */ +typedef struct +{ + uint32_t RESERVED0; + __I uint32_t ICTR; /*!< Offset: 0x04 Interrupt Control Type Register */ +#if ((defined __CM3_REV) && (__CM3_REV >= 0x200)) + __IO uint32_t ACTLR; /*!< Offset: 0x08 Auxiliary Control Register */ +#else + uint32_t RESERVED1; +#endif +} InterruptType_Type; + +/* Interrupt Controller Type Register Definitions */ +#define InterruptType_ICTR_INTLINESNUM_Pos 0 /*!< InterruptType ICTR: INTLINESNUM Position */ +#define InterruptType_ICTR_INTLINESNUM_Msk (0x1Ful << InterruptType_ICTR_INTLINESNUM_Pos) /*!< InterruptType ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define InterruptType_ACTLR_DISFOLD_Pos 2 /*!< InterruptType ACTLR: DISFOLD Position */ +#define InterruptType_ACTLR_DISFOLD_Msk (1ul << InterruptType_ACTLR_DISFOLD_Pos) /*!< InterruptType ACTLR: DISFOLD Mask */ + +#define InterruptType_ACTLR_DISDEFWBUF_Pos 1 /*!< InterruptType ACTLR: DISDEFWBUF Position */ +#define InterruptType_ACTLR_DISDEFWBUF_Msk (1ul << InterruptType_ACTLR_DISDEFWBUF_Pos) /*!< InterruptType ACTLR: DISDEFWBUF Mask */ + +#define InterruptType_ACTLR_DISMCYCINT_Pos 0 /*!< InterruptType ACTLR: DISMCYCINT Position */ +#define InterruptType_ACTLR_DISMCYCINT_Msk (1ul << InterruptType_ACTLR_DISMCYCINT_Pos) /*!< InterruptType ACTLR: DISMCYCINT Mask */ +/*@}*/ /* end of group CMSIS_CM3_InterruptType */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1) +/** @addtogroup CMSIS_CM3_MPU CMSIS CM3 MPU + memory mapped structure for Memory Protection Unit (MPU) + @{ + */ +typedef struct +{ + __I uint32_t TYPE; /*!< Offset: 0x00 MPU Type Register */ + __IO uint32_t CTRL; /*!< Offset: 0x04 MPU Control Register */ + __IO uint32_t RNR; /*!< Offset: 0x08 MPU Region RNRber Register */ + __IO uint32_t RBAR; /*!< Offset: 0x0C MPU Region Base Address Register */ + __IO uint32_t RASR; /*!< Offset: 0x10 MPU Region Attribute and Size Register */ + __IO uint32_t RBAR_A1; /*!< Offset: 0x14 MPU Alias 1 Region Base Address Register */ + __IO uint32_t RASR_A1; /*!< Offset: 0x18 MPU Alias 1 Region Attribute and Size Register */ + __IO uint32_t RBAR_A2; /*!< Offset: 0x1C MPU Alias 2 Region Base Address Register */ + __IO uint32_t RASR_A2; /*!< Offset: 0x20 MPU Alias 2 Region Attribute and Size Register */ + __IO uint32_t RBAR_A3; /*!< Offset: 0x24 MPU Alias 3 Region Base Address Register */ + __IO uint32_t RASR_A3; /*!< Offset: 0x28 MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register */ +#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFul << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFul << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1ul << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register */ +#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1ul << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1ul << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1ul << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register */ +#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFul << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register */ +#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFul << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1ul << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFul << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register */ +#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: XN Position */ +#define MPU_RASR_XN_Msk (1ul << MPU_RASR_XN_Pos) /*!< MPU RASR: XN Mask */ + +#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: AP Position */ +#define MPU_RASR_AP_Msk (7ul << MPU_RASR_AP_Pos) /*!< MPU RASR: AP Mask */ + +#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: TEX Position */ +#define MPU_RASR_TEX_Msk (7ul << MPU_RASR_TEX_Pos) /*!< MPU RASR: TEX Mask */ + +#define MPU_RASR_S_Pos 18 /*!< MPU RASR: Shareable bit Position */ +#define MPU_RASR_S_Msk (1ul << MPU_RASR_S_Pos) /*!< MPU RASR: Shareable bit Mask */ + +#define MPU_RASR_C_Pos 17 /*!< MPU RASR: Cacheable bit Position */ +#define MPU_RASR_C_Msk (1ul << MPU_RASR_C_Pos) /*!< MPU RASR: Cacheable bit Mask */ + +#define MPU_RASR_B_Pos 16 /*!< MPU RASR: Bufferable bit Position */ +#define MPU_RASR_B_Msk (1ul << MPU_RASR_B_Pos) /*!< MPU RASR: Bufferable bit Mask */ + +#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFul << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1Ful << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region S... [truncated message content] |
From: Benjamin A. <Ba...@us...> - 2011-03-07 21:31:27
|
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 d66c75758ef8ece9b93d406ace55c474d0480d77 (commit) from 5ce896b63f8fd44a45e5f174972be02e47256ccd (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 d66c75758ef8ece9b93d406ace55c474d0480d77 Author: Benjamin Aupetit <au...@cr...> Date: Mon Mar 7 22:29:32 2011 +0100 diverses updates modification du roulement pour l'arbre de la roue premieres tentatives de pinces ----------------------------------------------------------------------- Changes: diff --git a/meca/2011_Senior/Arbre moteur.CATPart b/meca/2011_Senior/Arbre moteur.CATPart index 807dcba..2655f02 100644 Binary files a/meca/2011_Senior/Arbre moteur.CATPart and b/meca/2011_Senior/Arbre moteur.CATPart differ diff --git a/meca/2011_Senior/BH0102-40-606.CATPart b/meca/2011_Senior/BH0102-40-606.CATPart index 0a0f66c..209bb17 100644 Binary files a/meca/2011_Senior/BH0102-40-606.CATPart and b/meca/2011_Senior/BH0102-40-606.CATPart differ diff --git a/meca/2011_Senior/Encodeur HEDL 55__.CATPart b/meca/2011_Senior/Encodeur HEDL 55__.CATPart index edc3cf2..b38712b 100644 Binary files a/meca/2011_Senior/Encodeur HEDL 55__.CATPart and b/meca/2011_Senior/Encodeur HEDL 55__.CATPart differ diff --git a/meca/2011_Senior/Moteur.CATPart b/meca/2011_Senior/Moteur.CATPart index a723e2a..8a54f13 100644 Binary files a/meca/2011_Senior/Moteur.CATPart and b/meca/2011_Senior/Moteur.CATPart differ diff --git a/meca/2011_Senior/P20 Arbre.CATPart b/meca/2011_Senior/P20 Arbre.CATPart index bd9c91e..7cc3529 100644 Binary files a/meca/2011_Senior/P20 Arbre.CATPart and b/meca/2011_Senior/P20 Arbre.CATPart differ diff --git a/meca/2011_Senior/P20 Boitier.CATPart b/meca/2011_Senior/P20 Boitier.CATPart index 77d8823..31baa09 100644 Binary files a/meca/2011_Senior/P20 Boitier.CATPart and b/meca/2011_Senior/P20 Boitier.CATPart differ diff --git a/meca/2011_Senior/P20 Sortie.CATPart b/meca/2011_Senior/P20 Sortie.CATPart index 377f6ed..3f4d57b 100644 Binary files a/meca/2011_Senior/P20 Sortie.CATPart and b/meca/2011_Senior/P20 Sortie.CATPart differ diff --git a/meca/2011_Senior/Roulement a billes 606ZZ.CATPart b/meca/2011_Senior/Roulement a billes 606ZZ.CATPart index 360fbdf..cffecf0 100644 Binary files a/meca/2011_Senior/Roulement a billes 606ZZ.CATPart and b/meca/2011_Senior/Roulement a billes 606ZZ.CATPart differ diff --git a/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart b/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart index d938ea4..d14c892 100644 Binary files a/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart and b/meca/2011_Senior/aupetit/AxeGlissiereAscenceur.CATPart differ diff --git a/meca/2011_Senior/aupetit/Bille3.CATPart b/meca/2011_Senior/aupetit/Bille3.CATPart index 2584edf..9875bc7 100644 Binary files a/meca/2011_Senior/aupetit/Bille3.CATPart and b/meca/2011_Senior/aupetit/Bille3.CATPart differ diff --git a/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart b/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart index d55d666..f710225 100644 Binary files a/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart and b/meca/2011_Senior/aupetit/DouilleGlissiereAscenceur.CATPart differ diff --git a/meca/2011_Senior/aupetit/Etage1.CATPart b/meca/2011_Senior/aupetit/Etage1.CATPart new file mode 100644 index 0000000..3519168 Binary files /dev/null and b/meca/2011_Senior/aupetit/Etage1.CATPart differ diff --git a/meca/2011_Senior/aupetit/GuideCodeur.CATPart b/meca/2011_Senior/aupetit/GuideCodeur.CATPart index de1c007..5b86cbc 100644 Binary files a/meca/2011_Senior/aupetit/GuideCodeur.CATPart and b/meca/2011_Senior/aupetit/GuideCodeur.CATPart differ diff --git a/meca/2011_Senior/aupetit/ModuleRoue.CATProduct b/meca/2011_Senior/aupetit/ModuleRoue.CATProduct index f517cf9..bcba8e7 100644 Binary files a/meca/2011_Senior/aupetit/ModuleRoue.CATProduct and b/meca/2011_Senior/aupetit/ModuleRoue.CATProduct differ diff --git a/meca/2011_Senior/aupetit/Repere.CATPart b/meca/2011_Senior/aupetit/Repere.CATPart new file mode 100644 index 0000000..4691ead Binary files /dev/null and b/meca/2011_Senior/aupetit/Repere.CATPart differ diff --git a/meca/2011_Senior/aupetit/Robot.CATProduct b/meca/2011_Senior/aupetit/Robot.CATProduct index 63c6be0..3d5a0ad 100644 Binary files a/meca/2011_Senior/aupetit/Robot.CATProduct and b/meca/2011_Senior/aupetit/Robot.CATProduct differ diff --git a/meca/2011_Senior/aupetit/RoueCodeuse.CATPart b/meca/2011_Senior/aupetit/RoueCodeuse.CATPart index 7b9daa3..9cb2228 100644 Binary files a/meca/2011_Senior/aupetit/RoueCodeuse.CATPart and b/meca/2011_Senior/aupetit/RoueCodeuse.CATPart differ diff --git a/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart b/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart new file mode 100644 index 0000000..baa977e Binary files /dev/null and b/meca/2011_Senior/aupetit/RoulementArbreRoue.CATPart differ diff --git a/meca/2011_Senior/aupetit/SupportRoue.CATPart b/meca/2011_Senior/aupetit/SupportRoue.CATPart index 44114e8..6058e1e 100644 Binary files a/meca/2011_Senior/aupetit/SupportRoue.CATPart and b/meca/2011_Senior/aupetit/SupportRoue.CATPart differ diff --git a/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart b/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart index 88b7157..79715fe 100644 Binary files a/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart and b/meca/2011_Senior/aupetit/Symmetry of Bille MRM-017.CATPart differ diff --git a/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart b/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart index 5f3d5ed..e26cc1b 100644 Binary files a/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart and b/meca/2011_Senior/aupetit/Symmetry of Symmetry of Bille MRM-017.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc-plaque.CATPart b/meca/2011_Senior/aupetit/asc-plaque.CATPart index bff963c..f6a77e6 100644 Binary files a/meca/2011_Senior/aupetit/asc-plaque.CATPart and b/meca/2011_Senior/aupetit/asc-plaque.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/AX-12.CATPart b/meca/2011_Senior/aupetit/asc/AX-12.CATPart index 7ffc45d..890efd6 100644 Binary files a/meca/2011_Senior/aupetit/asc/AX-12.CATPart and b/meca/2011_Senior/aupetit/asc/AX-12.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart b/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart index f7288cb..131b385 100644 Binary files a/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart and b/meca/2011_Senior/aupetit/asc/L_ascenceur.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/OF-12S.CATPart b/meca/2011_Senior/aupetit/asc/OF-12S.CATPart index d4efd3d..7029f65 100644 Binary files a/meca/2011_Senior/aupetit/asc/OF-12S.CATPart and b/meca/2011_Senior/aupetit/asc/OF-12S.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/pince.CATPart b/meca/2011_Senior/aupetit/asc/pince.CATPart index 0b92ff4..b3da7aa 100644 Binary files a/meca/2011_Senior/aupetit/asc/pince.CATPart and b/meca/2011_Senior/aupetit/asc/pince.CATPart differ diff --git a/meca/2011_Senior/aupetit/asc/pince.stl b/meca/2011_Senior/aupetit/asc/pince.stl new file mode 100644 index 0000000..900cf68 --- /dev/null +++ b/meca/2011_Senior/aupetit/asc/pince.stl @@ -0,0 +1,1458 @@ +solid CATIA STL + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 1.100000e+000 -8.000000e+000 + vertex 1.000000e+001 7.778175e-001 -8.777818e+000 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 1.100000e+000 -8.000000e+000 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -7.865646e+000 6.175080e+000 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + vertex 1.000000e+001 -7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + vertex 1.000000e+001 -2.020601e-016 -9.100000e+000 + vertex 1.000000e+001 -7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 7.222183e+000 7.778175e-001 + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 1.000000e+001 1.873249e+001 2.128645e+000 + vertex 1.000000e+001 1.190257e+001 4.746758e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 5.000000e+001 -1.000000e+001 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 7.778175e-001 -8.777818e+000 + vertex 1.000000e+001 -2.020601e-016 -9.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 -2.020601e-016 -9.100000e+000 + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 2.113517e+000 9.774100e+000 + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + vertex 1.000000e+001 7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 7.778175e-001 8.777818e+000 + vertex 1.000000e+001 1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal 9.999999e-001 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 1.100000e+000 8.000000e+000 + vertex 1.000000e+001 7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 7.778175e-001 7.222183e+000 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 1.000000e+001 5.527708e+000 8.333333e+000 + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 1.000000e+001 1.190257e+001 4.746758e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + vertex 1.000000e+001 -6.900000e+000 0.000000e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 -6.900000e+000 0.000000e+000 + vertex 1.000000e+001 -7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 -7.222183e+000 -7.778175e-001 + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + vertex 1.000000e+001 -7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 7.778175e-001 -7.222183e+000 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 7.222183e+000 -7.778175e-001 + vertex 1.000000e+001 6.900000e+000 1.347067e-016 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 -0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 6.900000e+000 1.347067e-016 + vertex 1.000000e+001 7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 7.222183e+000 7.778175e-001 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 2.113517e+000 9.774100e+000 + vertex 1.000000e+001 -1.590912e+000 9.872639e+000 + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + vertex 1.000000e+001 -1.590912e+000 9.872639e+000 + vertex 1.000000e+001 -5.076870e+000 8.615416e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + vertex 1.000000e+001 -5.076870e+000 8.615416e+000 + vertex 1.000000e+001 -7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + vertex 1.000000e+001 -7.865646e+000 6.175080e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + vertex 1.000000e+001 -7.865646e+000 6.175080e+000 + vertex 1.000000e+001 -8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 1.000000e+001 -8.000000e+000 1.100000e+000 + vertex 1.000000e+001 -7.865646e+000 6.175080e+000 + vertex 1.000000e+001 -9.574271e+000 2.886751e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -8.000000e+000 1.100000e+000 + vertex 1.000000e+001 -9.574271e+000 2.886751e+000 + vertex 1.000000e+001 -8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -8.777818e+000 7.778175e-001 + vertex 1.000000e+001 -9.574271e+000 2.886751e+000 + vertex 1.000000e+001 -9.100000e+000 1.347067e-016 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -9.100000e+000 1.347067e-016 + vertex 1.000000e+001 -9.574271e+000 2.886751e+000 + vertex 1.000000e+001 -9.968109e+000 -7.980011e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -9.100000e+000 1.347067e-016 + vertex 1.000000e+001 -9.968109e+000 -7.980011e-001 + vertex 1.000000e+001 -8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal 9.999999e-001 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -8.777818e+000 -7.778175e-001 + vertex 1.000000e+001 -9.968109e+000 -7.980011e-001 + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 -9.968109e+000 -7.980011e-001 + vertex 1.000000e+001 -8.993075e+000 -4.373168e+000 + endloop + endfacet + facet normal 9.999999e-001 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 -8.993075e+000 -4.373168e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -7.778175e-001 8.777818e+000 + vertex 1.000000e+001 -5.076870e+000 8.615416e+000 + vertex 1.000000e+001 -1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.100000e+000 8.000000e+000 + vertex 1.000000e+001 -5.076870e+000 8.615416e+000 + vertex 1.000000e+001 -7.865646e+000 6.175080e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.100000e+000 8.000000e+000 + vertex 1.000000e+001 -7.865646e+000 6.175080e+000 + vertex 1.000000e+001 -7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -7.778175e-001 -7.222183e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + vertex 1.000000e+001 -1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.100000e+000 -8.000000e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 -1.100000e+000 -8.000000e+000 + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + vertex 1.000000e+001 -7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 1.873249e+001 2.128645e+000 + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 1.000000e+001 2.587131e+001 5.350236e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 2.587131e+001 5.350236e-001 + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 1.000000e+001 8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 2.587131e+001 5.350236e-001 + vertex 1.000000e+001 8.777818e+000 7.778175e-001 + vertex 1.000000e+001 3.316625e+001 0.000000e+000 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 3.316625e+001 0.000000e+000 + vertex 1.000000e+001 8.777818e+000 7.778175e-001 + vertex 1.000000e+001 9.100000e+000 0.000000e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 3.316625e+001 0.000000e+000 + vertex 1.000000e+001 9.100000e+000 0.000000e+000 + vertex 1.000000e+001 8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal 1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 3.316625e+001 0.000000e+000 + vertex 1.000000e+001 8.777818e+000 -7.778175e-001 + vertex 1.000000e+001 5.000000e+001 0.000000e+000 + endloop + endfacet + facet normal 9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.000000e+001 0.000000e+000 + vertex 1.000000e+001 8.777818e+000 -7.778175e-001 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 1.000000e+001 5.000000e+001 0.000000e+000 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 5.000000e+001 -1.000000e+001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -7.778175e-001 7.222183e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + endloop + endfacet + facet normal -9.999999e-001 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 -2.020601e-016 -9.100000e+000 + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + vertex 0.000000e+000 7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 1.190257e+001 4.746758e+000 + vertex 0.000000e+000 1.873249e+001 2.128645e+000 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + vertex 0.000000e+000 -2.020601e-016 -9.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + vertex 0.000000e+000 -2.020601e-016 -9.100000e+000 + vertex 0.000000e+000 7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + vertex 0.000000e+000 7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 5.000000e+001 -1.000000e+001 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 1.190257e+001 4.746758e+000 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 7.778175e-001 7.222183e+000 + vertex 0.000000e+000 1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 1.100000e+000 8.000000e+000 + vertex 0.000000e+000 7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 7.778175e-001 8.777818e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.527708e+000 8.333333e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + vertex 0.000000e+000 2.113517e+000 9.774100e+000 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 -7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 -6.900000e+000 0.000000e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -6.900000e+000 0.000000e+000 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 7.222183e+000 7.778175e-001 + vertex 0.000000e+000 6.900000e+000 1.347067e-016 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 6.900000e+000 1.347067e-016 + vertex 0.000000e+000 7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -1.590912e+000 9.872639e+000 + vertex 0.000000e+000 2.113517e+000 9.774100e+000 + vertex 0.000000e+000 -5.076870e+000 8.615416e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -5.076870e+000 8.615416e+000 + vertex 0.000000e+000 2.113517e+000 9.774100e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -5.076870e+000 8.615416e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + vertex 0.000000e+000 -7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + vertex 0.000000e+000 -9.574271e+000 2.886751e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -9.574271e+000 2.886751e+000 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + vertex 0.000000e+000 -8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -9.574271e+000 2.886751e+000 + vertex 0.000000e+000 -8.000000e+000 1.100000e+000 + vertex 0.000000e+000 -8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -9.574271e+000 2.886751e+000 + vertex 0.000000e+000 -8.777818e+000 7.778175e-001 + vertex 0.000000e+000 -9.968109e+000 -7.980011e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -9.968109e+000 -7.980011e-001 + vertex 0.000000e+000 -8.777818e+000 7.778175e-001 + vertex 0.000000e+000 -9.100000e+000 1.347067e-016 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -9.968109e+000 -7.980011e-001 + vertex 0.000000e+000 -9.100000e+000 1.347067e-016 + vertex 0.000000e+000 -8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -9.968109e+000 -7.980011e-001 + vertex 0.000000e+000 -8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 -8.993075e+000 -4.373168e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -8.993075e+000 -4.373168e+000 + vertex 0.000000e+000 -8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -8.993075e+000 -4.373168e+000 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -5.076870e+000 8.615416e+000 + vertex 0.000000e+000 -7.778175e-001 8.777818e+000 + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + vertex 0.000000e+000 -7.778175e-001 8.777818e+000 + vertex 0.000000e+000 -1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -7.865646e+000 6.175080e+000 + vertex 0.000000e+000 -1.100000e+000 8.000000e+000 + vertex 0.000000e+000 -7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + vertex 0.000000e+000 -7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + vertex 0.000000e+000 -7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 -1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + vertex 0.000000e+000 -1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 -7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + vertex 0.000000e+000 1.873249e+001 2.128645e+000 + vertex 0.000000e+000 8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 8.777818e+000 7.778175e-001 + vertex 0.000000e+000 1.873249e+001 2.128645e+000 + vertex 0.000000e+000 2.587131e+001 5.350236e-001 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 8.777818e+000 7.778175e-001 + vertex 0.000000e+000 2.587131e+001 5.350236e-001 + vertex 0.000000e+000 9.100000e+000 0.000000e+000 + endloop + endfacet + facet normal -9.999999e-001 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 9.100000e+000 0.000000e+000 + vertex 0.000000e+000 2.587131e+001 5.350236e-001 + vertex 0.000000e+000 3.316625e+001 0.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 -0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 9.100000e+000 0.000000e+000 + vertex 0.000000e+000 3.316625e+001 0.000000e+000 + vertex 0.000000e+000 8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 3.316625e+001 0.000000e+000 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 3.316625e+001 0.000000e+000 + vertex 0.000000e+000 5.000000e+001 0.000000e+000 + endloop + endfacet + facet normal -1.000000e+000 0.000000e+000 -0.000000e+000 + outer loop + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 5.000000e+001 0.000000e+000 + vertex 0.000000e+000 5.000000e+001 -1.000000e+001 + endloop + endfacet + facet normal 0.000000e+000 9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 6.900000e+000 1.347067e-016 + vertex 0.000000e+000 6.900000e+000 1.347067e-016 + vertex 1.000000e+001 7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 7.222183e+000 7.778175e-001 + vertex 0.000000e+000 6.900000e+000 1.347067e-016 + vertex 0.000000e+000 7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 -9.238794e-001 + outer loop + vertex 1.000000e+001 7.222183e+000 7.778175e-001 + vertex 0.000000e+000 7.222183e+000 7.778175e-001 + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 -9.238794e-001 + outer loop + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 0.000000e+000 7.222183e+000 7.778175e-001 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826833e-001 -9.238796e-001 + outer loop + vertex 1.000000e+001 8.000000e+000 1.100000e+000 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + vertex 1.000000e+001 8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal -0.000000e+000 -3.826833e-001 -9.238796e-001 + outer loop + vertex 1.000000e+001 8.777818e+000 7.778175e-001 + vertex 0.000000e+000 8.000000e+000 1.100000e+000 + vertex 0.000000e+000 8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 -9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 8.777818e+000 7.778175e-001 + vertex 0.000000e+000 8.777818e+000 7.778175e-001 + vertex 1.000000e+001 9.100000e+000 0.000000e+000 + endloop + endfacet + facet normal -0.000000e+000 -9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 9.100000e+000 0.000000e+000 + vertex 0.000000e+000 8.777818e+000 7.778175e-001 + vertex 0.000000e+000 9.100000e+000 0.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 9.100000e+000 0.000000e+000 + vertex 0.000000e+000 9.100000e+000 0.000000e+000 + vertex 1.000000e+001 8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 -9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 9.100000e+000 0.000000e+000 + vertex 0.000000e+000 8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 -3.826833e-001 9.238796e-001 + outer loop + vertex 1.000000e+001 8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 8.777818e+000 -7.778175e-001 + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826833e-001 9.238796e-001 + outer loop + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -0.000000e+000 3.826835e-001 9.238794e-001 + outer loop + vertex 1.000000e+001 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 9.238794e-001 + outer loop + vertex 1.000000e+001 7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal -0.000000e+000 9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 7.222183e+000 -7.778175e-001 + vertex 1.000000e+001 6.900000e+000 1.347067e-016 + endloop + endfacet + facet normal 0.000000e+000 9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 6.900000e+000 1.347067e-016 + vertex 0.000000e+000 7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 6.900000e+000 1.347067e-016 + endloop + endfacet + facet normal 0.000000e+000 9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 -9.100000e+000 1.347067e-016 + vertex 0.000000e+000 -9.100000e+000 1.347067e-016 + vertex 1.000000e+001 -8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 -8.777818e+000 7.778175e-001 + vertex 0.000000e+000 -9.100000e+000 1.347067e-016 + vertex 0.000000e+000 -8.777818e+000 7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 3.826833e-001 -9.238796e-001 + outer loop + vertex 1.000000e+001 -8.777818e+000 7.778175e-001 + vertex 0.000000e+000 -8.777818e+000 7.778175e-001 + vertex 1.000000e+001 -8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826833e-001 -9.238796e-001 + outer loop + vertex 1.000000e+001 -8.000000e+000 1.100000e+000 + vertex 0.000000e+000 -8.777818e+000 7.778175e-001 + vertex 0.000000e+000 -8.000000e+000 1.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 -9.238794e-001 + outer loop + vertex 1.000000e+001 -8.000000e+000 1.100000e+000 + vertex 0.000000e+000 -8.000000e+000 1.100000e+000 + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal -0.000000e+000 -3.826835e-001 -9.238794e-001 + outer loop + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + vertex 0.000000e+000 -8.000000e+000 1.100000e+000 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 -9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 -7.222183e+000 7.778175e-001 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + vertex 1.000000e+001 -6.900000e+000 0.000000e+000 + endloop + endfacet + facet normal -0.000000e+000 -9.238795e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 -6.900000e+000 0.000000e+000 + vertex 0.000000e+000 -7.222183e+000 7.778175e-001 + vertex 0.000000e+000 -6.900000e+000 0.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 -6.900000e+000 0.000000e+000 + vertex 0.000000e+000 -6.900000e+000 0.000000e+000 + vertex 1.000000e+001 -7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 -9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 -7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 -6.900000e+000 0.000000e+000 + vertex 0.000000e+000 -7.222183e+000 -7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 9.238794e-001 + outer loop + vertex 1.000000e+001 -7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 -7.222183e+000 -7.778175e-001 + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 9.238794e-001 + outer loop + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 -7.222183e+000 -7.778175e-001 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + endloop + endfacet + facet normal -0.000000e+000 3.826833e-001 9.238796e-001 + outer loop + vertex 1.000000e+001 -8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + vertex 1.000000e+001 -8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal 0.000000e+000 3.826833e-001 9.238796e-001 + outer loop + vertex 1.000000e+001 -8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 -8.000000e+000 -1.100000e+000 + vertex 0.000000e+000 -8.777818e+000 -7.778175e-001 + endloop + endfacet + facet normal -0.000000e+000 9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 -8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 -8.777818e+000 -7.778175e-001 + vertex 1.000000e+001 -9.100000e+000 1.347067e-016 + endloop + endfacet + facet normal 0.000000e+000 9.238795e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 -9.100000e+000 1.347067e-016 + vertex 0.000000e+000 -8.777818e+000 -7.778175e-001 + vertex 0.000000e+000 -9.100000e+000 1.347067e-016 + endloop + endfacet + facet normal 0.000000e+000 9.238794e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 -1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 -1.100000e+000 -8.000000e+000 + vertex 1.000000e+001 -7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal 0.000000e+000 9.238794e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 -1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 -7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 -7.778175e-001 -7.222183e+000 + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 -7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 1.000000e+001 7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal -0.000000e+000 -3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 6.735335e-017 -6.900000e+000 + vertex 0.000000e+000 7.778175e-001 -7.222183e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238794e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 7.778175e-001 -7.222183e+000 + vertex 1.000000e+001 1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal -0.000000e+000 -9.238794e-001 -3.826835e-001 + outer loop + vertex 1.000000e+001 1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 7.778175e-001 -7.222183e+000 + vertex 0.000000e+000 1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238796e-001 3.826833e-001 + outer loop + vertex 1.000000e+001 1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 1.100000e+000 -8.000000e+000 + vertex 1.000000e+001 7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238796e-001 3.826833e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 7.778175e-001 -8.777818e+000 + vertex 1.000000e+001 -2.020601e-016 -9.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 -2.020601e-016 -9.100000e+000 + vertex 0.000000e+000 7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 -2.020601e-016 -9.100000e+000 + endloop + endfacet + facet normal -0.000000e+000 3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 -2.020601e-016 -9.100000e+000 + vertex 0.000000e+000 -2.020601e-016 -9.100000e+000 + vertex 1.000000e+001 -7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 -2.020601e-016 -9.100000e+000 + vertex 0.000000e+000 -7.778175e-001 -8.777818e+000 + endloop + endfacet + facet normal -0.000000e+000 9.238796e-001 3.826833e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 -7.778175e-001 -8.777818e+000 + vertex 1.000000e+001 -1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 9.238796e-001 3.826833e-001 + outer loop + vertex 1.000000e+001 -1.100000e+000 -8.000000e+000 + vertex 0.000000e+000 -7.778175e-001 -8.777818e+000 + vertex 0.000000e+000 -1.100000e+000 -8.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 9.238796e-001 -3.826833e-001 + outer loop + vertex 1.000000e+001 -1.100000e+000 8.000000e+000 + vertex 0.000000e+000 -1.100000e+000 8.000000e+000 + vertex 1.000000e+001 -7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal 0.000000e+000 9.238796e-001 -3.826833e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 8.777818e+000 + vertex 0.000000e+000 -1.100000e+000 8.000000e+000 + vertex 0.000000e+000 -7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 8.777818e+000 + vertex 0.000000e+000 -7.778175e-001 8.777818e+000 + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + vertex 0.000000e+000 -7.778175e-001 8.777818e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 6.735335e-017 9.100000e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + vertex 1.000000e+001 7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal -0.000000e+000 -3.826835e-001 -9.238795e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 8.777818e+000 + vertex 0.000000e+000 6.735335e-017 9.100000e+000 + vertex 0.000000e+000 7.778175e-001 8.777818e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238796e-001 -3.826833e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 8.777818e+000 + vertex 0.000000e+000 7.778175e-001 8.777818e+000 + vertex 1.000000e+001 1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal -0.000000e+000 -9.238796e-001 -3.826833e-001 + outer loop + vertex 1.000000e+001 1.100000e+000 8.000000e+000 + vertex 0.000000e+000 7.778175e-001 8.777818e+000 + vertex 0.000000e+000 1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238794e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 1.100000e+000 8.000000e+000 + vertex 0.000000e+000 1.100000e+000 8.000000e+000 + vertex 1.000000e+001 7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal 0.000000e+000 -9.238794e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 7.222183e+000 + vertex 0.000000e+000 1.100000e+000 8.000000e+000 + vertex 0.000000e+000 7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 7.778175e-001 7.222183e+000 + vertex 0.000000e+000 7.778175e-001 7.222183e+000 + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + endloop + endfacet + facet normal 0.000000e+000 -3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 7.778175e-001 7.222183e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + endloop + endfacet + facet normal -0.000000e+000 3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 1.000000e+001 -7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal 0.000000e+000 3.826835e-001 9.238795e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 7.222183e+000 + vertex 0.000000e+000 -2.020601e-016 6.900000e+000 + vertex 0.000000e+000 -7.778175e-001 7.222183e+000 + endloop + endfacet + facet normal -0.000000e+000 9.238794e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 -7.778175e-001 7.222183e+000 + vertex 0.000000e+000 -7.778175e-001 7.222183e+000 + vertex 1.000000e+001 -1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 9.238794e-001 3.826835e-001 + outer loop + vertex 1.000000e+001 -1.100000e+000 8.000000e+000 + vertex 0.000000e+000 -7.778175e-001 7.222183e+000 + vertex 0.000000e+000 -1.100000e+000 8.000000e+000 + endloop + endfacet + facet normal 0.000000e+000 1.000000e+000 0.000000e+000 + outer loop + vertex 0.000000e+000 5.000000e+001 -1.000000e+001 + vertex 0.000000e+000 5.000000e+001 0.000000e+000 + vertex 1.000000e+001 5.000000e+001 -1.000000e+001 + endloop + endfacet + facet normal 0.000000e+000 1.000000e+000 -0.000000e+000 + outer loop + vertex 1.000000e+001 5.000000e+001 -1.000000e+001 + vertex 0.000000e+000 5.000000e+001 0.000000e+000 + vertex 1.000000e+001 5.000000e+001 0.000000e+000 + endloop + endfacet + facet normal -0.000000e+000 0.000000e+000 -1.000000e+000 + outer loop + vertex 0.000000e+000 5.000000e+001 -1.000000e+001 + vertex 1.000000e+001 5.000000e+001 -1.000000e+001 + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + endloop + endfacet + facet normal 0.000000e+000 0.000000e+000 -1.000000e+000 + outer loop + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 5.000000e+001 -1.000000e+001 + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + endloop + endfacet + facet normal -0.000000e+000 -1.852870e-001 -9.826844e-001 + outer loop + vertex 0.000000e+000 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + endloop + endfacet + facet normal 0.000000e+000 -1.852870e-001 -9.826844e-001 + outer loop + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + vertex 1.000000e+001 -1.836910e-015 -1.000000e+001 + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + endloop + endfacet + facet normal -0.000000e+000 -5.304164e-001 -8.477372e-001 + outer loop + vertex 0.000000e+000 -3.641573e+000 -9.313375e+000 + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + endloop + endfacet + facet normal 0.000000e+000 -5.304164e-001 -8.477372e-001 + outer loop + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + vertex 1.000000e+001 -3.641573e+000 -9.313375e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + endloop + endfacet + facet normal -0.000000e+000 -8.027064e-001 -5.963745e-001 + outer loop + vertex 0.000000e+000 -6.783067e+000 -7.347789e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + vertex 0.000000e+000 -8.993075e+000 -4.373168e+000 + endloop + endfacet + facet normal 0.000000e+000 -8.027064e-001 -5.963745e-001 + outer loop + vertex 0.000000e+000 -8.993075e+000 -4.373168e+000 + vertex 1.000000e+001 -6.783067e+000 -7.347789e+000 + vertex 1.000000e+001 -8.993075e+000 -4.373168e+000 + endloop + endfacet + facet normal -0.000000e+000 -9.647646e-001 -2.631144e-001 + outer loop + vertex 0.000000e+000 -8.993075e+000 -4.373168e+000 + vertex 1.000000e+001 -8.993075e+000 -4.373168e+000 + vertex 0.000000e+000 -9.968109e+000 -7.980011e-001 + endloop + endfacet + facet normal 0.000000e+000 -9.647646e-001 -2.631144e-001 + outer loop + vertex 0.000000e+... [truncated message content] |