File tree 5 files changed +49
-61
lines changed
5 files changed +49
-61
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ struct altos_device {
42
42
int serial ;
43
43
char name [256 ];
44
44
char path [256 ];
45
+ int (* method_1 )(int x , int y );
45
46
//%mutable;
46
47
};
47
48
Original file line number Diff line number Diff line change 2
2
%{
3
3
#include "libaltos.h"
4
4
%}
5
-
5
+ %extend altos_device {
6
+ int method_1(int x, int y) {
7
+ return ($self->method_1)(x, y);
8
+ }
9
+ }
Original file line number Diff line number Diff line change 3
3
#
4
4
#
5
5
6
- include ../stmf0/Makefile.defs
6
+ TOPDIR =..
7
+
8
+ include $(TOPDIR ) /stmf0/Makefile.defs
7
9
8
10
INC = \
9
11
ao.h \
@@ -13,8 +15,6 @@ INC = \
13
15
ao_pins.h \
14
16
ao_product.h \
15
17
ao_task.h \
16
- ao_lisp.h \
17
- ao_lisp_const.h \
18
18
stm32f0.h \
19
19
Makefile
20
20
@@ -25,42 +25,24 @@ ALTOS_SRC = \
25
25
ao_romconfig.c \
26
26
ao_cmd.c \
27
27
ao_config.c \
28
+ ao_data.c \
28
29
ao_task.c \
29
30
ao_led_stmf0.c \
30
- ao_beep_stm.c \
31
31
ao_dma_stm.c \
32
32
ao_stdio.c \
33
33
ao_panic.c \
34
34
ao_timer.c \
35
35
ao_mutex.c \
36
36
ao_usb_stm.c \
37
- ao_serial_stm.c \
38
37
ao_flash_stm.c \
39
- ao_lisp_atom.c \
40
- ao_lisp_builtin.c \
41
- ao_lisp_cons.c \
42
- ao_lisp_error.c \
43
- ao_lisp_eval.c \
44
- ao_lisp_frame.c \
45
- ao_lisp_int.c \
46
- ao_lisp_lambda.c \
47
- ao_lisp_lex.c \
48
- ao_lisp_mem.c \
49
- ao_lisp_poly.c \
50
- ao_lisp_read.c \
51
- ao_lisp_rep.c \
52
- ao_lisp_save.c \
53
- ao_lisp_stack.c \
54
- ao_lisp_string.c \
55
- ao_lisp_os_save.c
38
+ ao_spi_stm.c \
39
+ ao_bmi088.c
56
40
57
41
PRODUCT =Nucleo-32
58
42
PRODUCT_DEF =-DNUCLEO
59
43
IDPRODUCT =0x000a
60
44
61
- CFLAGS = $(PRODUCT_DEF ) $(STMF0_CFLAGS )
62
-
63
- LDFLAGS =$(CFLAGS ) -L$(TOPDIR ) /stmf0 -Wl,-Tload.ld -n
45
+ CFLAGS = $(PRODUCT_DEF ) $(STMF0_CFLAGS ) $(PROFILE_DEF )
64
46
65
47
PROGNAME =nucleo-32
66
48
PROG =$(PROGNAME ) -$(VERSION ) .elf
@@ -72,20 +54,14 @@ OBJ=$(SRC:.c=.o)
72
54
all : $(PROG ) $(HEX )
73
55
74
56
$(PROG ) : Makefile $(OBJ ) altos.ld
75
- $(call quiet,CC) $(LDFLAGS ) $( CFLAGS ) -o $(PROG ) $(OBJ ) $(LIBS )
57
+ $(call quiet,CC) $(LDFLAGS ) -o $(PROG ) $(OBJ ) $(LIBS ) -Wl,-Map= $( PROGNAME ) - $( VERSION ) .map
76
58
77
59
$(OBJ ) : $(INC )
78
60
79
- ao_product.h : ao-make-product.5c ../Version
80
- $(call quiet,NICKLE,$< ) $< -m altusmetrum.org -i $(IDPRODUCT ) -p $(PRODUCT ) -v $(VERSION ) > $@
81
-
82
- load : $(PROG )
83
- stm-load $(PROG )
84
-
85
61
distclean : clean
86
62
87
63
clean :
88
- rm -f * .o $(PROGNAME ) -* .elf $(PROGNAME ) -* .ihx
64
+ rm -f * .o $(PROGNAME ) -* .elf $(PROGNAME ) -* .ihx $( PROGNAME ) - * .map
89
65
rm -f ao_product.h
90
66
91
67
install :
Original file line number Diff line number Diff line change 13
13
*/
14
14
15
15
#include <ao.h>
16
- #include <ao_lisp.h>
17
- #include <ao_beep.h>
16
+ #include <ao_bmi088.h>
18
17
19
- static void lisp_cmd () {
20
- ao_lisp_read_eval_print ();
21
- }
22
-
23
- static void beep () {
24
- ao_beep_for (AO_BEEP_MID , AO_MS_TO_TICKS (200 ));
25
- }
26
-
27
- static const struct ao_cmds blink_cmds [] = {
28
- { lisp_cmd , "l\0Run lisp interpreter" },
29
- { beep , "b\0Beep" },
30
- { 0 , 0 }
31
- };
18
+ uint8_t ao_sensor_errors ;
32
19
33
- void main (void )
20
+ int main (void )
34
21
{
35
- ao_led_init (LEDS_AVAILABLE );
22
+ ao_led_init ();
36
23
ao_clock_init ();
37
24
ao_task_init ();
38
25
ao_timer_init ();
39
26
ao_dma_init ();
40
27
ao_usb_init ();
41
- ao_serial_init ();
42
- ao_beep_init ();
28
+ ao_spi_init ();
29
+ ao_bmi088_init ();
43
30
ao_cmd_init ();
44
- ao_cmd_register (blink_cmds );
45
31
ao_start_scheduler ();
46
32
}
47
33
Original file line number Diff line number Diff line change 47
47
#define HAS_USB 1
48
48
#define AO_USB_DIRECTIO 0
49
49
#define AO_PA11_PA12_RMP 0
50
- #define HAS_BEEP 1
51
-
52
- #define BEEPER_TIMER 2
53
- #define BEEPER_CHANNEL 4
54
- #define BEEPER_PORT (&stm_gpioa)
55
- #define BEEPER_PIN 3
50
+ #define HAS_BEEP 0
56
51
57
52
#define IS_FLASH_LOADER 0
58
53
59
- #define HAS_SERIAL_2 1
54
+ #define HAS_SERIAL_2 0
60
55
#define SERIAL_2_PA2_PA15 1
61
56
#define USE_SERIAL_2_FLOW 0
62
57
#define USE_SERIAL_2_STDIN 1
63
58
#define DELAY_SERIAL_2_STDIN 0
64
59
60
+ #define HAS_SPI_1 1
61
+ #define SPI_1_PA5_PA6_PA7 1
62
+ #define SPI_1_OSPEEDR STM_OSPEEDR_HIGH
63
+ #define SPI_1_PB3_PB4_PB5 0
64
+
65
+ #define HAS_SPI_2 0
66
+
67
+ #define HAS_BMI088 1
68
+ #define HAS_IMU 1
69
+
70
+ #define ao_data_along (packet ) ((packet)->bmi088.acc.x)
71
+ #define ao_data_across (packet ) (-(packet)->bmi088.acc.y)
72
+ #define ao_data_through (packet ) ((packet)->bmi088.acc.z)
73
+
74
+ #define ao_data_roll (packet ) ((packet)->bmi088.gyr.x)
75
+ #define ao_data_pitch (packet ) (-(packet)->bmi088.gyr.y)
76
+ #define ao_data_yaw (packet ) ((packet)->bmi088.gyr.z)
77
+
78
+ #define AO_BMI088_ACC_CS_PORT (&stm_gpioa)
79
+ #define AO_BMI088_ACC_CS_PIN 0
80
+ #define AO_BMI088_GYR_CS_PORT (&stm_gpioa)
81
+ #define AO_BMI088_GYR_CS_PIN 1
82
+ #define AO_BMI088_SPI_BUS (AO_SPI_1_PA5_PA6_PA7 | AO_SPI_MODE_0)
83
+
84
+ #define AO_DATA_RING 32
85
+
65
86
#endif /* _AO_PINS_H_ */
You can’t perform that action at this time.
0 commit comments