Skip to content

Commit

Permalink
Number of queues in op_queue now defined at compile time
Browse files Browse the repository at this point in the history
Closes OpenMYR#42
  • Loading branch information
brandonbrown2 committed Jul 21, 2016
1 parent 7ae506f commit b6ed4e3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 55 deletions.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ base_env = Environment(
Export('base_env')

SConscript('src/SConscript', variant_dir = './build/out', duplicate = 0)
SConscript('build/SConscript')
SConscript('build/SConscript')
4 changes: 3 additions & 1 deletion build/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ base_env.Alias('flash-stepper', base_env.Command(None, ['bin/stepper_driver-0x00
Clean('.', 'bin')
Clean('.', 'out')

Default('quad', 'stepper')
Default('quad', 'stepper')
if GetOption("clean"):
Default('.')
12 changes: 10 additions & 2 deletions src/SConscript
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
Import('base_env')

base_env.Program('stepper_driver', ['main.c', 'hw_timer.c', 'command_layer.c', 'stepper_driver.c', 'udp.c', 'tcp.c', 'wifi.c', 'op_queue.c', 'jsmn.c'])
base_env.Program('quad_servo_driver', ['main.c', 'hw_timer.c', 'command_layer.c', 'quad_servo_driver.c', 'udp.c', 'tcp.c', 'wifi.c', 'quad_op_queue.c', 'jsmn.c'])
quad_queue = base_env.Clone();
quad_queue.Append(CCFLAGS = ['-DMOTOR_COUNT=4'])
quad_queue.Object(source = 'op_queue.c', target = 'quad_op_queue.o')

stepper_queue = base_env.Clone();
stepper_queue.Append(CCFLAGS = ['-DMOTOR_COUNT=1'])
stepper_queue.Object(source = 'op_queue.c', target = 'stepper_op_queue.o')

base_env.Program('stepper_driver', ['main.c', 'hw_timer.c', 'command_layer.c', 'stepper_driver.c', 'udp.c', 'tcp.c', 'wifi.c', 'stepper_op_queue.o', 'jsmn.c'])
base_env.Program('quad_servo_driver', ['main.c', 'hw_timer.c', 'command_layer.c', 'quad_servo_driver.c', 'udp.c', 'tcp.c', 'wifi.c', 'quad_op_queue.o', 'jsmn.c'])
1 change: 0 additions & 1 deletion src/op_queue.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "op_queue.h"
#include "osapi.h"

#define MOTOR_COUNT 1
#define BUFFER_SIZE (1000 / MOTOR_COUNT)

static struct stepper_command_data command_queue[MOTOR_COUNT][BUFFER_SIZE];
Expand Down
50 changes: 0 additions & 50 deletions src/quad_op_queue.c

This file was deleted.

0 comments on commit b6ed4e3

Please sign in to comment.