Skip to content

Commit

Permalink
Increase autotrigger
Browse files Browse the repository at this point in the history
  • Loading branch information
alvieboy committed Oct 30, 2009
1 parent 3400908 commit bb3fa96
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
28 changes: 28 additions & 0 deletions UI/display.c
Expand Up @@ -21,6 +21,7 @@
#include "serial.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>

GtkWidget *window;
GdkPixbuf *pixbuf;
Expand Down Expand Up @@ -77,6 +78,22 @@ gboolean prescaler_changed(GtkWidget *widget)
serial_set_prescaler(base);
return TRUE;
}
gboolean vref_changed(GtkWidget *widget)
{
unsigned char base;
gchar *c = gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget));

/* Ugly :) */
if (!strcmp(c,"AREF")) {
base=0;
} else if (!strcmp(c,"AVcc")) {
base=1;
} else {
base = 3;
}
serial_set_vref(base);
return TRUE;
}

int main(int argc,char **argv)
{
Expand Down Expand Up @@ -134,6 +151,17 @@ int main(int argc,char **argv)
gtk_combo_box_append_text(GTK_COMBO_BOX(scale),"2");
gtk_combo_box_set_active(GTK_COMBO_BOX(scale),0);

hbox = gtk_hbox_new(FALSE,4);
gtk_box_pack_start(GTK_BOX(vbox),hbox,TRUE,TRUE,0);
gtk_box_pack_start(GTK_BOX(hbox),gtk_label_new("VRef source:"),TRUE,TRUE,0);
scale=gtk_combo_box_new_text();
gtk_box_pack_start(GTK_BOX(hbox),scale,TRUE,TRUE,0);
g_signal_connect(G_OBJECT(scale),"changed",G_CALLBACK(&vref_changed),NULL);

gtk_combo_box_append_text(GTK_COMBO_BOX(scale),"AREF");
gtk_combo_box_append_text(GTK_COMBO_BOX(scale),"AVcc");
gtk_combo_box_append_text(GTK_COMBO_BOX(scale),"Internal 1.1V");

scope_display_set_data(image,data,sizeof(data));

gtk_widget_show_all(window);
Expand Down
4 changes: 2 additions & 2 deletions oscope.pde
Expand Up @@ -44,7 +44,7 @@ unsigned char dataBuffer[NUM_SAMPLES];
unsigned short dataBufferPtr;
unsigned char triggerLevel=0;
unsigned char triggerFlags=0;
unsigned char autoTrigSamples = 100;
unsigned short autoTrigSamples = 512;
unsigned char holdoffSamples = 0;

/* Booleans merged */
Expand Down Expand Up @@ -233,7 +233,7 @@ void loop() {
ISR(ADC_vect)
{
static unsigned char last=0;
static unsigned char autoTrigCount=0;
static unsigned short autoTrigCount=0;
static boolean do_store_data;
static unsigned char holdoff;

Expand Down

0 comments on commit bb3fa96

Please sign in to comment.