• R/O
  • SSH
  • HTTPS

qrobosdk: コミット


コミットメタ情報

リビジョン1917 (tree)
日時2010-09-17 23:50:43
作者satofumi

ログメッセージ

SCI1 の受信が割り込みで動作するのを確認

変更サマリ

差分

--- branches/tsukuba_2010/libs/run_drive/Makefile (revision 1916)
+++ branches/tsukuba_2010/libs/run_drive/Makefile (revision 1917)
@@ -80,9 +80,11 @@
8080 protocol_handler.o: protocol_handler.h run_t.h controller_config.h
8181 protocol_handler.o: odometry_t.h path_t.h wheel_t.h encoder_t.h motor_t.h
8282 protocol_handler.o: communication_handler.h
83+ring_buffer.o: ring_buffer.h
8384 run_drive.o: initialize_state.h run_t.h controller_config.h odometry_t.h
8485 run_drive.o: path_t.h wheel_t.h encoder_t.h motor_t.h control_state.h
85-sci_interrupt_read_write.o: sci_read_write.h cpu_clock.h
86+sci_interrupt_read_write.o: sci_read_write.h imask.h cpu_clock.h
87+sci_interrupt_read_write.o: ring_buffer.h
8688 sci_read_write.o: sci_read_write.h cpu_clock.h
8789 sci_utilities.o: sci_utilities.h sci_read_write.h
8890 std_string.o: std_string.h
--- branches/tsukuba_2010/libs/run_drive/samples/sci_interrupt_echoback.c (nonexistent)
+++ branches/tsukuba_2010/libs/run_drive/samples/sci_interrupt_echoback.c (revision 1917)
@@ -0,0 +1,36 @@
1+/*!
2+ \example sci_echoback.c シリアル出力
3+
4+ \author Satofumi KAMIMURA
5+
6+ $Id$
7+*/
8+
9+#include "clock_initialize.h"
10+#include "imask.h"
11+#include "sci_interrupt_read_write.h"
12+#include "interrupt_priority.h"
13+
14+
15+int main(void)
16+{
17+ const char first_message[] = "echoback test.\r\n";
18+
19+ imask_initialize();
20+ clock_initialize();
21+ sci_initialize(INTERRUPT_PRIORITY_COMMUNICATION, 38400);
22+ set_imask_exr(0);
23+
24+ sci_write(first_message, sizeof(first_message) - 1);
25+
26+ while (1) {
27+ char ch;
28+ int n;
29+
30+ // 受信した内容を送信する
31+ n = sci_read(&ch, 1);
32+ if (n > 0) {
33+ sci_write(&ch, 1);
34+ }
35+ }
36+}
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
--- branches/tsukuba_2010/libs/run_drive/samples/Makefile (revision 1916)
+++ branches/tsukuba_2010/libs/run_drive/samples/Makefile (revision 1917)
@@ -23,6 +23,7 @@
2323 encoder_print.mot \
2424 wheel_velocity_run.mot \
2525 sci_interrupt_write.mot \
26+ sci_interrupt_echoback.mot \
2627
2728 all : $(TARGET)
2829
@@ -45,6 +46,7 @@
4546 pwm_output.mot : pwm_output.o $(SOURCE_DIR)/pwm_control.o
4647 wheel_velocity_run.mot : wheel_velocity_run.o $(BASE_OBJ) $(SOURCE_DIR)/wheel_velocity.o $(SOURCE_DIR)/encoder_reader.o $(SOURCE_DIR)/motor_velocity.o $(SOURCE_DIR)/mtu2_initialize.o $(SOURCE_DIR)/motor_pwm.o $(SOURCE_DIR)/timer_control.o
4748 sci_interrupt_write.mot : sci_interrupt_write.o $(BASE_OBJ) $(SOURCE_DIR)/sci_interrupt_read_write.o $(SOURCE_DIR)/sci_utilities.o $(SOURCE_DIR)/ring_buffer.o
49+sci_interrupt_echoback.mot : sci_interrupt_echoback.o $(BASE_OBJ) $(SOURCE_DIR)/sci_interrupt_read_write.o $(SOURCE_DIR)/ring_buffer.o
4850
4951 # DO NOT DELETE
5052
旧リポジトリブラウザで表示