File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 270270 let dC = 0 ; // count of digital buses (for parallel I2S)
271271 let LTs = d . Sf . querySelectorAll ( "#mLC select[name^=LT]" ) ;
272272 LTs . forEach ( ( s , i ) => {
273- s . addEventListener ( 'change' , updateTypeDropdowns ) ;
274- //if (i < LTs.length-1) s.disabled = true; // prevent changing type (as we can't update options)
275273 // is the field a LED type?
276274 var n = s . name . substring ( 2 , 3 ) ; // bus number (0-Z)
277275 var t = parseInt ( s . value ) ;
435433 gId ( 'fpsNone' ) . style . display = ( d . Sf . FR . value == 0 ) ? 'block' :'none' ;
436434 gId ( 'fpsWarn' ) . style . display = ( d . Sf . FR . value == 0 ) || ( d . Sf . FR . value >= 80 ) ? 'block' :'none' ;
437435 gId ( 'fpsHigh' ) . style . display = ( d . Sf . FR . value >= 80 ) ? 'block' :'none' ;
436+ // restrict bus types in dropdowns to max allowed digital/analog buses
437+ updateTypeDropdowns ( ) ;
438438 }
439439 function lastEnd ( i ) {
440440 if ( i -- < 1 ) return 0 ;
524524
525525 if ( ! init ) {
526526 UI ( ) ;
527- updateTypeDropdowns ( ) ;
528527 }
529528 }
530529
726725 if ( i . value !== "" && i . value >= 0 )
727726 i . dataset . val = i . value ;
728727 } ) ;
729- updateTypeDropdowns ( ) ;
730728 }
731729 function pinUpd ( e ) {
732730 // update changed select options across all usermods
818816 // max digital count
819817 let maxDB = maxD - ( ( is32 ( ) || isS2 ( ) || isS3 ( ) ) ? ( ! d . Sf [ "PR" ] . checked ) * 8 - ( ! isS3 ( ) ) : 0 ) ;
820818 // disallow adding more of a type that has reached its limit
821- if ( digitalB >= maxDB && ! isDig ( curType ) ) disable ( 'option[data-type="D"]' ) ;
819+ if ( digitalB >= maxDB && ! ( isDig ( curType ) && ! isD2P ( curType ) ) ) disable ( 'option[data-type="D"]' ) ;
822820 if ( twopinB >= 2 && ! isD2P ( curType ) ) disable ( 'option[data-type="2P"]' ) ;
823821 disable ( `option[data-type^="${ 'A' . repeat ( maxA - analogB + ( isPWM ( curType ) ?numPins ( curType ) :0 ) + 1 ) } "]` ) ;
824822 } ) ;
You can’t perform that action at this time.
0 commit comments