remove for good confusing ATT_1/2/NONE tags

This was all REVERSED in the original library, causing endless
confusion. Now, explicit ATT_MINUS_20dB labels are used, so no confusion
is possible.
parent 5241b71c
......@@ -123,11 +123,11 @@ enum oau_att_value_enum oau_att_get_relay (int fd, int channel)
int r2 = ( ctx->relay_state & r2_mask );
if( r1 && !r2 )
return ATT_1;
return ATT_MINUS_20dB;
else if ( r1 && r2 )
return ATT_2;
return ATT_ZERO_dB;
else if ( !r1 && !r2 )
return ATT_NONE;
return ATT_MINUS_40dB;
return ATT_ERR;
}
......@@ -145,14 +145,14 @@ int oau_att_set_relay (int fd, int channel, enum oau_att_value_enum val)
switch(val)
{
case ATT_NONE:
case ATT_MINUS_40dB:
ctx->relay_state &= ~(r1_mask | r2_mask);
break;
case ATT_1:
case ATT_MINUS_20dB:
ctx->relay_state &= ~r2_mask;
ctx->relay_state |= r1_mask;
break;
case ATT_2:
case ATT_ZERO_dB:
ctx->relay_state |= r1_mask;
ctx->relay_state |= r2_mask;
break;
......
......@@ -11,17 +11,17 @@ int main()
for(;;)
{
fprintf(stderr,".");
oau_att_set_relay ( fd, 4, ATT_1 );
oau_att_set_relay ( fd, 4, ATT_MINUS_20dB );
sleep(1);
fprintf(stderr,".");
oau_att_set_relay ( fd, 4, ATT_2 );
oau_att_set_relay ( fd, 4, ATT_ZERO_dB );
sleep(1);
fprintf(stderr,".");
oau_att_set_relay ( fd, 4, ATT_NONE );
oau_att_set_relay ( fd, 4, ATT_MINUS_40dB );
sleep(1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment