projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kill MOC and use QT_MOC instead
[bertos.git]
/
app
/
triface
/
protocol.c
diff --git
a/app/triface/protocol.c
b/app/triface/protocol.c
index 6a415118cf076d38d0a5ab44ee47ab188482487d..fa4c0bad9741bf18a8eed63e01a9a159773b45b1 100644
(file)
--- a/
app/triface/protocol.c
+++ b/
app/triface/protocol.c
@@
-27,7
+27,7
@@
* the GNU General Public License.
*
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
* the GNU General Public License.
*
* Copyright 2003, 2004, 2006 Develer S.r.l. (http://www.develer.com/)
- * Copyright 2000 Bern
ardo
Innocenti <bernie@codewiz.org>
+ * Copyright 2000 Bern
ie
Innocenti <bernie@codewiz.org>
*
* -->
*
*
* -->
*
@@
-38,13
+38,15
@@
*
* \author Giovanni Bajo <rasky@develer.com>
* \author Marco Benelli <marco@develer.com>
*
* \author Giovanni Bajo <rasky@develer.com>
* \author Marco Benelli <marco@develer.com>
- * \author Bern
ardo Innocenti <bernie@develer.com
>
+ * \author Bern
ie Innocenti <bernie@codewiz.org
>
* \author Daniele Basile <asterix@develer.com>
*/
#include "protocol.h"
#include "cmd_ctor.h" // MAKE_CMD, REGISTER_CMD
#include "verstag.h"
* \author Daniele Basile <asterix@develer.com>
*/
#include "protocol.h"
#include "cmd_ctor.h" // MAKE_CMD, REGISTER_CMD
#include "verstag.h"
+#include "hw/hw_adc.h"
+#include "hw/hw_input.h"
#include <drv/timer.h>
#include <drv/ser.h>
#include <drv/timer.h>
#include <drv/ser.h>
@@
-60,15
+62,9
@@
#include <kern/kfile.h>
#include <kern/kfile.h>
-#include "hw_adc.h"
-#include "hw_input.h"
-
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
-//#include <cmd_hunk.h>
-
-
// Define the format string for ADC
#define ADC_FORMAT_STR "dddd"
// Define the format string for ADC
#define ADC_FORMAT_STR "dddd"
@@
-91,7
+87,8
@@
uint8_t reg_status_dout;
/**
* Send a NAK asking the host to send the current message again.
*
/**
* Send a NAK asking the host to send the current message again.
*
- * \param err human-readable description of the error for debug purposes.
+ * \a fd kfile handler for serial.
+ * \a err human-readable description of the error for debug purposes.
*/
INLINE void NAK(KFile *fd, const char *err)
{
*/
INLINE void NAK(KFile *fd, const char *err)
{
@@
-297,15
+294,6
@@
MAKE_CMD(rdout, "", "d",
0;
}), 0)
0;
}), 0)
-/* Doutx sperimentale....... */
-MAKE_CMD(doutx, "d", "",
- ({
- sipo_putchar((uint8_t)args[1].l);
-
- //Store status of dout ports.
- reg_status_dout = (uint8_t)args[1].l;
- 0;
- }), 0)
/* Reset */
MAKE_CMD(reset, "", "",
/* Reset */
MAKE_CMD(reset, "", "",
@@
-314,7
+302,14
@@
MAKE_CMD(reset, "", "",
(void)args;
wdt_init(7);
wdt_start();
(void)args;
wdt_init(7);
wdt_start();
+
+ /*We want to have an infinite loop that lock access on watchdog timer.
+ This piece of code it's equivalent to a while(true), but we have done this because
+ gcc generate a warning message that suggest to use "noreturn" parameter in function reset.*/
+ ASSERT(args);
+ while(args);
0;
0;
+
}), 0)
/* Din */
}), 0)
/* Din */
@@
-353,7
+348,6
@@
static void protocol_registerCmds(void)
//Set off all dout ports.
reg_status_dout = 0;
REGISTER_CMD(rdout);
//Set off all dout ports.
reg_status_dout = 0;
REGISTER_CMD(rdout);
- REGISTER_CMD(doutx);
REGISTER_CMD(reset);
REGISTER_CMD(din);
REGISTER_CMD(ain);
REGISTER_CMD(reset);
REGISTER_CMD(din);
REGISTER_CMD(ain);