firmware/lanternfish/daySchedule.cpp
bool DaySchedule::delPoint(const unsigned char pos){
    if( pos >= getSize() ){
        return false;
    }
    
    // Shifts the remaining points
    for(unsigned char i = pos; i < getSize()-1; i++){
        ptHour[i] = ptHour[i+1];
        ptMin[i] = ptMin[i+1];
        ptDC[i] = ptDC[i+1];
    }
    
    //Sets the last point to zeros
    ptHour[getSize()-1] = 0;
    ptMin[getSize()-1] = 0;
    ptDC[getSize()-1] = 0;
    
    //Update size
    setSize(getSize()-1);
    
    return save();
}
/*
 * Deletes a point from the schedule given it's position.
 * 
 * In:
 *  pos : unsigned char containing the position [0; size[
 * Out:
 *  bool: true if point was successfully found and deleted
 *        false otherwise
 */
Deletes a point from the schedule given it's position.

pos : unsigned char containing the position [0; size[
Out:
bool: true if point was successfully found and deleted
false otherwise
Deletes a point from the schedule given it ' s position . pos : unsigned char containing the position [ 0 ; size [ Out : bool : true if point was successfully found and deleted false otherwise
bool DaySchedule::delPoint(const unsigned char pos){
    if( pos >= getSize() ){
        return false;
    }
    for(unsigned char i = pos; i < getSize()-1; i++){
        ptHour[i] = ptHour[i+1];
        ptMin[i] = ptMin[i+1];
        ptDC[i] = ptDC[i+1];
    }
    ptHour[getSize()-1] = 0;
    ptMin[getSize()-1] = 0;
    ptDC[getSize()-1] = 0;
    setSize(getSize()-1);
    return save();
}
bool DaySchedule :: delPoint ( const unsigned char pos ) { if ( pos >= getSize ( ) ) { return false ; } for ( unsigned char i = pos ; i < getSize ( ) - 1 ; i ++ ) { ptHour [ i ] = ptHour [ i + 1 ] ; ptMin [ i ] = ptMin [ i + 1 ] ; ptDC [ i ] = ptDC [ i + 1 ] ; } ptHour [ getSize ( ) - 1 ] = 0 ; ptMin [ getSize ( ) - 1 ] = 0 ; ptDC [ getSize ( ) - 1 ] = 0 ; setSize ( getSize ( ) - 1 ) ; return save ( ) ; }
Deletes a point from the schedule given it's position.
Deletes a point from the schedule given it ' s position .
// Shifts the remaining points
 //Sets the last point to zeros
 //Update size
