I managed to get back to the benchmark program running at 24 secs again.
I undid some of the things I removed and put a few things back as they were. i used the while(0) in place of the '{}'
I ran the benchmark on one of my filled to the max Altair-duinos with the Speed limiter turned off and the same benchmark was 34 Seconds.
so the modifications are shaving about 10 seconds off the benchmark.
I don't have a completely stock setup altair-duino but i don't think the information i found about the benchmark taking 50 seconds as a base is correct.
if i change this line
#define host_set_data_leds(v) REG_PIOD_ODSR = v
then everything goes haywire. it does not like {} or while(0) there either compiler fails. if i set REG_PIOD_ODSR = 0 then everything goes wrong as well since it needs the proper 'v' value.
Is there another place in the source code that just updates the Data LEDs outside of host_due.h?
I see in the main.ino there are lots of host_set_data_leds references.
for the host_due.h
this is how i have the led code:
// ------------------------------------------ status LEDs
/* reading global variables is faster than reading back the i/o register
=> INTE and WAIT are read often so we keep their state in a global variable */
#define host_set_status_led_INT() while(0) //REG_PIOB_SODR = 1<<25
#define host_set_status_led_WO() while(0) //REG_PIOC_CODR = 1<<28
#define host_set_status_led_STACK() while(0) //REG_PIOC_SODR = 1<<26
#define host_set_status_led_HLTA() while(0) //REG_PIOC_SODR = 1<<25
#define host_set_status_led_M1() while(0) //REG_PIOC_SODR = 1<<23
#define host_set_status_led_MEMR() while(0) //REG_PIOC_SODR = 1<<21
#define host_set_status_led_INTE() while(0) //REG_PIOD_SODR = 1<<8;
#define host_set_status_led_PROT() while(0) //REG_PIOB_SODR = 1<<27
#define host_set_status_led_WAIT() { REG_PIOC_SODR = 1<<29; status_wait = true; }
#define host_set_status_led_HLDA() while(0) //REG_PIOB_SODR = 1<<26
#define host_clr_status_led_INT() while(0) //REG_PIOB_CODR = 1<<25
#define host_clr_status_led_WO() while(0) //REG_PIOC_SODR = 1<<28
#define host_clr_status_led_STACK() while(0) //REG_PIOC_CODR = 1<<26
#define host_clr_status_led_HLTA() while(0) //REG_PIOC_CODR = 1<<25
#define host_clr_status_led_M1() while(0) //REG_PIOC_CODR = 1<<23
#define host_clr_status_led_MEMR() while(0) //REG_PIOC_CODR = 1<<21
#define host_clr_status_led_INTE() while(0) //REG_PIOD_CODR = 1<<8;
#define host_clr_status_led_PROT() while(0) //REG_PIOB_CODR = 1<<27
#define host_clr_status_led_WAIT() { REG_PIOC_CODR = 1<<29; status_wait = false; }
#define host_clr_status_led_HLDA() while(0) //REG_PIOB_CODR = 1<<26
#define host_read_status_led_WAIT() status_wait
#define host_read_status_led_M1() (REG_PIOC_PDSR & (1<<23))
#define host_read_status_led_HLTA() (REG_PIOC_PDSR & (1<<25))
#define host_read_status_led_INTE() status_inte
#if USE_IO_BUS>0
// switch WAIT and DATA LEDs to inputs and turn on INP LED
#define host_set_status_led_INP() while(0) //{ REG_PIOD_ODR = 0xFF; REG_PIOC_ODR = 1<<29; REG_PIOC_SODR = 1<<22; }
#define host_clr_status_led_INP() while(0) // { REG_PIOC_CODR = 1<<22; REG_PIOC_OER = 1<<29; REG_PIOD_OER = 0xFF; }
// switch WAIT LED to input and turn on OUT LED
#define host_set_status_led_OUT() while(0) // { REG_PIOC_ODR = 1<<29; REG_PIOC_SODR = 1<<24; }
#define host_clr_status_led_OUT() while(0) // { REG_PIOC_CODR = 1<<24; REG_PIOC_OER = 1<<29; }
// read input from pins connected to DATA and WAIT LEDs
#define host_read_data_bus while(0) // host_read_data_leds
#define host_read_status_WAIT() while(0) // (REG_PIOC_PDSR & (1<<29))
#else
#define host_set_status_led_INP() while(0) // REG_PIOC_SODR = 1<<22;
#define host_clr_status_led_INP() while(0) // REG_PIOC_CODR = 1<<22;
#define host_set_status_led_OUT() while(0) // REG_PIOC_SODR = 1<<24
#define host_clr_status_led_OUT() while(0) // REG_PIOC_CODR = 1<<24
#endif
when i change host_set_status_led_WAIT() and take out REG_PIOC_CODR = 1<<29 or REG_PIOC_SODR = 1<<29 it seems to run slower which is interesting.
address Leds are all commented out.
changing the data bus Led code from:
#define host_set_data_leds(v) REG_PIOD_ODSR = v
byte host_read_data_leds();
seems to break everything.
should
void altair_set_outputs(uint16_t a, byte v)
{
host_set_addr_leds(a);
host_set_data_leds(v);
if( mem_is_protected(a) )
host_set_status_led_PROT();
else
host_clr_status_led_PROT();
if( host_read_status_led_M1() ) print_dbg_info();
print_panel_serial();
}
be changed where host_set_data_leds(v); is commented out.
This is where i am at the moment.
I also have the 4 top left leds still on as it seems if i play around with MEMR, MI, STACK, WO is breaks things.